com.evelopers.unimod.runtime
Class QueuedHandler

java.lang.Object
  extended bycom.evelopers.unimod.runtime.QueuedHandler
All Implemented Interfaces:
EventManager, LifeCycleManager

public class QueuedHandler
extends java.lang.Object
implements EventManager

Event handler with queue of event support. Uses additional daemon thread.


Constructor Summary
QueuedHandler()
           
 
Method Summary
 void dispose()
          Stops managed objects.
 void handle(Event e, StateMachineContext context)
          Calls of event providers or model engine client to ModelEngine#handle will be delegated to this method.
 void handleAndWait(Event event, StateMachineContext context)
          Calls of event providers or model engine client to ModelEngine#handle will be delegated to this method.
 void init(ModelEngine engine)
          Initializes managed objects.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

QueuedHandler

public QueuedHandler()
Method Detail

init

public void init(ModelEngine engine)
Description copied from interface: LifeCycleManager
Initializes managed objects.

Specified by:
init in interface LifeCycleManager
Parameters:
engine - model engine that runs state machine

handle

public void handle(Event e,
                   StateMachineContext context)
Description copied from interface: EventManager
Calls of event providers or model engine client to ModelEngine#handle will be delegated to this method. If event manager uses dispatch queue, returns immediately

Specified by:
handle in interface EventManager
Parameters:
e -
context -

handleAndWait

public void handleAndWait(Event event,
                          StateMachineContext context)
Description copied from interface: EventManager
Calls of event providers or model engine client to ModelEngine#handle will be delegated to this method. If event manager uses dispatch queue, waits for end of event processing

Specified by:
handleAndWait in interface EventManager
Parameters:
event -
context -

dispose

public void dispose()
Description copied from interface: LifeCycleManager
Stops managed objects.

Specified by:
dispose in interface LifeCycleManager