|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object GenericWorker
public class GenericWorker
This is a 'generic' event handler used for benchmarking. It accepts BufferElements and then spins on the CPU for 'cpu1' msecs, sleeps for 'sleep' msecs, and spins on the CPU for 'cpu2' msecs. It then delivers the original event to the worker specified by 'next_handler'.
Field Summary | |
---|---|
private int |
CPU1_TIME
|
private int |
CPU2_TIME
|
private static boolean |
DEBUG
|
private SinkIF |
nextHandlerSink
|
private int |
SLEEP_TIME
|
Constructor Summary | |
---|---|
GenericWorker()
|
Method Summary | |
---|---|
void |
destroy()
Called when an event handler is destroyed. |
void |
handleEvent(QueueElementIF item)
Handle the event corresponding to the given QueueElementIF. |
void |
handleEvents(QueueElementIF[] items)
Handle the events corresponding to the given QueueElementIF array. |
void |
init(ConfigDataIF config)
Called when an event handler is initialized. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private static final boolean DEBUG
private SinkIF nextHandlerSink
private int CPU1_TIME
private int CPU2_TIME
private int SLEEP_TIME
Constructor Detail |
---|
public GenericWorker()
Method Detail |
---|
public void init(ConfigDataIF config) throws java.lang.Exception
EventHandlerIF
init
in interface EventHandlerIF
config
- The set of configuration parameters for the stage.
java.lang.Exception
- The EventHandler can indicate an
error to the runtime during initialization by throwing an
Exception.public void destroy()
EventHandlerIF
destroy
in interface EventHandlerIF
public void handleEvent(QueueElementIF item)
EventHandlerIF
handleEvent
in interface EventHandlerIF
public void handleEvents(QueueElementIF[] items)
EventHandlerIF
handleEvents
in interface EventHandlerIF
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |