|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.lwes.listener.ThreadedDequeuer
public abstract class ThreadedDequeuer
An abstract consumer of events.
| Field Summary | |
|---|---|
protected java.util.List<QueueElement> |
queue
|
| Constructor Summary | |
|---|---|
ThreadedDequeuer()
Default constructor. |
|
| Method Summary | |
|---|---|
void |
addHandler(EventHandler handler)
Add an event handler to this dequeuer. |
void |
addHandler(java.lang.String name,
EventHandler handler)
Adds a handler to this dequeuer with a specified name. |
protected void |
dispatchEvent(Event event)
Handles events and calls EventHandler handlers. |
EventHandler |
getHandler(java.lang.String name)
Get an event handler by name. |
protected ThreadedEventDispatcher |
getIdleProcessor()
Gets an idle processor from the list |
int |
getMaxThreads()
Gets the maximum number of threads allowed in the system |
java.util.List<QueueElement> |
getQueue()
Returns the queue to use for this dequeuer |
void |
initialize()
Default initialize() method. |
void |
makeAvailable(ThreadedEventDispatcher dispatcher)
Makes a process available for dispatch |
void |
removeHandler(EventHandler handler)
Removes a handler so it no longer is processing events |
void |
removeHandler(java.lang.String name)
Removes a handler by name so it no longer is processing events |
void |
run()
Default run loop. |
void |
setMaxThreads(int threads)
Sets the maximum number of threads allowed in the system, up to 64. |
void |
setQueue(java.util.List<QueueElement> queue)
Sets the queue to use for this dequeuer. |
void |
shutdown()
Default shutdown() method. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected java.util.List<QueueElement> queue
| Constructor Detail |
|---|
public ThreadedDequeuer()
| Method Detail |
|---|
public java.util.List<QueueElement> getQueue()
public void setQueue(java.util.List<QueueElement> queue)
queue - the thread-synchronized List elementpublic int getMaxThreads()
public void setMaxThreads(int threads)
threads - the number of threads to allow.public EventHandler getHandler(java.lang.String name)
name - the name of the event handler to fetch
public void addHandler(EventHandler handler)
handler - the actual handler
public void addHandler(java.lang.String name,
EventHandler handler)
name - the name of this handlerhandler - the actual handlerpublic void removeHandler(EventHandler handler)
handler - the handler to removepublic void removeHandler(java.lang.String name)
name - the name of the handler to remove
public void initialize()
throws java.io.IOException
java.io.IOExceptionpublic void shutdown()
public void run()
run in interface java.lang.Runnableprotected void dispatchEvent(Event event)
event - the Event to dispatch to the EventHandlersprotected ThreadedEventDispatcher getIdleProcessor()
public void makeAvailable(ThreadedEventDispatcher dispatcher)
dispatcher - the dispatcher to make available
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||