001/*
002 * Licensed to the Apache Software Foundation (ASF) under one or more
003 * contributor license agreements.  See the NOTICE file distributed with
004 * this work for additional information regarding copyright ownership.
005 * The ASF licenses this file to You under the Apache License, Version 2.0
006 * (the "License"); you may not use this file except in compliance with
007 * the License.  You may obtain a copy of the License at
008 *
009 *     http://www.apache.org/licenses/LICENSE-2.0
010 *
011 * Unless required by applicable law or agreed to in writing, software
012 * distributed under the License is distributed on an "AS IS" BASIS,
013 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
014 * See the License for the specific language governing permissions and
015 * limitations under the License.
016 */
017package org.apache.commons.scxml2;
018
019import java.util.List;
020import java.util.Map;
021
022import org.w3c.dom.Node;
023
024/**
025 * The event controller interface used to send messages containing
026 * events or other information directly to another SCXML Interpreter,
027 * other external systems using an Event I/O Processor or to raise
028 * events in the current SCXML session.
029 *
030 */
031public interface EventDispatcher {
032
033    /**
034     * Cancel the specified send message.
035     *
036     * @param sendId The ID of the send message to cancel
037     */
038    void cancel(String sendId);
039
040    /**
041     * Send this message to the target.
042     *
043     * @param sendId The ID of the send message
044     * @param target An expression returning the target location of the event
045     * @param type The type of the Event I/O Processor that the event should
046     *  be dispatched to
047     * @param event The type of event being generated.
048     * @param params A list of zero or more whitespace separated variable
049     *  names to be included with the event.
050     * @param hints The data containing information which may be
051     *  used by the implementing platform to configure the event processor
052     * @param delay The event is dispatched after the delay interval elapses
053     * @param externalNodes The list of external nodes associated with
054     *  the <send> element.
055     */
056    void send(String sendId, String target, String type,
057            String event, Map<String, Object> params, Object hints,
058            long delay, List<Node> externalNodes);
059
060}
061