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     */
017    package org.apache.commons.scxml;
018    
019    import java.util.List;
020    import java.util.Map;
021    
022    /**
023     * The event controller interface used to send messages containing
024     * events or other information directly to another SCXML Interpreter,
025     * other external systems using an Event I/O Processor or to raise
026     * events in the current SCXML session.
027     *
028     */
029    public interface EventDispatcher {
030    
031        /**
032         * Cancel the specified send message.
033         *
034         * @param sendId The ID of the send message to cancel
035         */
036        void cancel(String sendId);
037    
038        /**
039         * Send this message to the target.
040         *
041         * @param sendId The ID of the send message
042         * @param target An expression returning the target location of the event
043         * @param targetType The type of the Event I/O Processor that the event
044         *  should be dispatched to
045         * @param event The type of event being generated.
046         * @param params A list of zero or more whitespace separated variable
047         *  names to be included with the event.
048         * @param hints The data containing information which may be
049         *  used by the implementing platform to configure the event processor
050         * @param delay The event is dispatched after the delay interval elapses
051         * @param externalNodes The list of external nodes associated with
052         *  the <send> element.
053         */
054        void send(String sendId, String target, String targetType,
055                String event, Map params, Object hints, long delay,
056                List externalNodes);
057    
058    }
059