seda.sandStorm.test.bench.stage_latency
Class GenericHandler
java.lang.Object
seda.sandStorm.test.bench.stage_latency.GenericHandler
- All Implemented Interfaces:
- EventHandlerIF
public class GenericHandler
- extends java.lang.Object
- implements EventHandlerIF
Constructor Summary |
GenericHandler(java.lang.String nextHandler,
int cpu1_time,
int cpu2_time,
int sleep_time)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
DEBUG
private static final boolean DEBUG
- See Also:
- Constant Field Values
nextHandlerSink
private SinkIF nextHandlerSink
CPU1_TIME
private int CPU1_TIME
CPU2_TIME
private int CPU2_TIME
SLEEP_TIME
private int SLEEP_TIME
NEXT_HANDLER
private java.lang.String NEXT_HANDLER
GenericHandler
public GenericHandler(java.lang.String nextHandler,
int cpu1_time,
int cpu2_time,
int sleep_time)
init
public void init(ConfigDataIF config)
throws java.lang.Exception
- Description copied from interface:
EventHandlerIF
- Called when an event handler is initialized. This method should
perform any initialization operations as required by the application.
- Specified by:
init
in interface EventHandlerIF
- Parameters:
config
- The set of configuration parameters for the stage.
- Throws:
java.lang.Exception
- The EventHandler can indicate an
error to the runtime during initialization by throwing an
Exception.
destroy
public void destroy()
- Description copied from interface:
EventHandlerIF
- Called when an event handler is destroyed. This method should
perform any cleanup or shutdown operations as required by the
application before the event handler is removed from the system.
- Specified by:
destroy
in interface EventHandlerIF
handleEvent
public void handleEvent(QueueElementIF item)
- Description copied from interface:
EventHandlerIF
- Handle the event corresponding to the given QueueElementIF.
This method is invoked by the system when a single event is
pending for the event handler.
- Specified by:
handleEvent
in interface EventHandlerIF
handleEvents
public void handleEvents(QueueElementIF[] items)
- Description copied from interface:
EventHandlerIF
- Handle the events corresponding to the given QueueElementIF array.
This method is invoked when multiple events are pending for the
event handler. The application may reorder, filter, or drop
these events if it wishes to do so.
- Specified by:
handleEvents
in interface EventHandlerIF