org.apache.commons.scxml.env
Class SimpleScheduler

java.lang.Object
  extended by org.apache.commons.scxml.env.SimpleScheduler
All Implemented Interfaces:
Serializable, EventDispatcher

public class SimpleScheduler
extends Object
implements EventDispatcher, Serializable

EventDispatcher implementation that can schedule delayed <send> events for the "scxml" targettype attribute value (which is also the default). This implementation uses J2SE Timers.

No other targettypes are processed. Subclasses may support additional targettypes by overriding the send(...) and cancel(...) methods and delegating to their super counterparts for the "scxml" targettype.

See Also:
Serialized Form

Constructor Summary
SimpleScheduler(SCXMLExecutor executor)
          Constructor.
 
Method Summary
 void cancel(String sendId)
          Cancel the specified send message.
protected  SCXMLExecutor getExecutor()
          Get the executor we're attached to.
protected  org.apache.commons.logging.Log getLog()
          Get the log instance.
protected  Map getTimers()
          Get the current timers.
 void send(String sendId, String target, String targettype, String event, Map params, Object hints, long delay, List externalNodes)
          Send this message to the target.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SimpleScheduler

public SimpleScheduler(SCXMLExecutor executor)
Constructor.

Parameters:
executor - The owning SCXMLExecutor instance.
Method Detail

cancel

public void cancel(String sendId)
Description copied from interface: EventDispatcher
Cancel the specified send message.

Specified by:
cancel in interface EventDispatcher
Parameters:
sendId - The ID of the send message to cancel
See Also:
EventDispatcher.cancel(String)

send

public void send(String sendId,
                 String target,
                 String targettype,
                 String event,
                 Map params,
                 Object hints,
                 long delay,
                 List externalNodes)
Description copied from interface: EventDispatcher
Send this message to the target.

Specified by:
send in interface EventDispatcher
Parameters:
sendId - The ID of the send message
target - An expression returning the target location of the event
targettype - The type of the Event I/O Processor that the event should be dispatched to
event - The type of event being generated.
params - A list of zero or more whitespace separated variable names to be included with the event.
hints - The data containing information which may be used by the implementing platform to configure the event processor
delay - The event is dispatched after the delay interval elapses
externalNodes - The list of external nodes associated with the <send> element.
See Also:
EventDispatcher.send(String,String,String,String,Map,Object,long,List)

getLog

protected org.apache.commons.logging.Log getLog()
Get the log instance.

Returns:
The current log instance

getTimers

protected Map getTimers()
Get the current timers.

Returns:
The currently scheduled timers

getExecutor

protected SCXMLExecutor getExecutor()
Get the executor we're attached to.

Returns:
The owning executor instance


Copyright © 2005-2008 The Apache Software Foundation. All Rights Reserved.