View Javadoc
1   /*
2    * Licensed to the Apache Software Foundation (ASF) under one or more
3    * contributor license agreements.  See the NOTICE file distributed with
4    * this work for additional information regarding copyright ownership.
5    * The ASF licenses this file to You under the Apache License, Version 2.0
6    * (the "License"); you may not use this file except in compliance with
7    * the License.  You may obtain a copy of the License at
8    *
9    *     http://www.apache.org/licenses/LICENSE-2.0
10   *
11   * Unless required by applicable law or agreed to in writing, software
12   * distributed under the License is distributed on an "AS IS" BASIS,
13   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14   * See the License for the specific language governing permissions and
15   * limitations under the License.
16   */
17  package org.apache.commons.scxml2;
18  
19  import java.util.Map;
20  
21  /**
22   * The event controller interface used to send messages containing
23   * events or other information directly to another SCXML Interpreter,
24   * other external systems using an Event I/O Processor or to raise
25   * events in the current SCXML session.
26   *
27   */
28  public interface EventDispatcher {
29  
30      /**
31       * Cancel the specified send message.
32       *
33       * @param sendId The ID of the send message to cancel
34       */
35      void cancel(String sendId);
36  
37      /**
38       * Send this message to the target.
39       *
40       * @param ioProcessors the available SCXMLIOProcessors, the same map as the SCXML system variable _ioprocessors
41       * @param id The ID of the send message
42       * @param target An expression returning the target location of the event
43       * @param type The type of the Event I/O Processor that the event should
44       *  be dispatched to
45       * @param event The type of event being generated.
46       * @param data The event payload
47       * @param hints The data containing information which may be
48       *  used by the implementing platform to configure the event processor
49       * @param delay The event is dispatched after the delay interval elapses
50       */
51      void send(Map<String, SCXMLIOProcessor> ioProcessors, String id, String target, String type, String event,
52                Object data, Object hints, long delay);
53  
54  }
55