|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.felix.eventadmin.impl.tasks.AsyncDeliverTasks
public class AsyncDeliverTasks
This class does the actual work of the asynchronous event dispatch.
It serves two purposes: first, it will append tasks to its queue hence, asynchronous event delivery is executed - second, it will set up a given dispatch task with its ThreadPool in a way that it is associated with a DeliverTask that will block in case the thread hits the SyncDeliverTasks.
In other words, if the asynchronous event dispatching thread is used to send a synchronous event then it will spin-off a new asynchronous dispatching thread while the former waits for the synchronous event to be delivered and then return to its ThreadPool.
Constructor Summary | |
---|---|
AsyncDeliverTasks(TaskQueue queue,
TaskQueue handoverQueue,
ThreadPool pool)
The constructor of the class that will use the asynchronous queue to append event dispatch handlers. |
Method Summary | |
---|---|
DeliverTask |
createTask()
Return a DeliverTask that can be used to execute asynchronous event dispatch. |
void |
execute(DispatchTask task)
Execute the handover in case of timeout or that the asynchronous event dispatching thread is used to send a synchronous event. |
void |
execute(HandlerTask[] tasks)
Execute asynchronous event dispatch. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public AsyncDeliverTasks(TaskQueue queue, TaskQueue handoverQueue, ThreadPool pool)
queue
- The asynchronous event queuehandoverQueue
- The synchronous event queue, to be used in case that the
asynchronous event dispatching thread is used to send a synchronous eventpool
- The thread pool used to spin-off new asynchronous event
dispatching threads in case of timeout or that the asynchronous event
dispatching thread is used to send a synchronous eventMethod Detail |
---|
public DeliverTask createTask()
createTask
in interface DeliverTasks
DeliverTasks.createTask()
public void execute(HandlerTask[] tasks)
execute
in interface DeliverTask
tasks
- The event dispatch tasks to executeDeliverTask.execute(org.apache.felix.eventadmin.impl.tasks.HandlerTask[])
public void execute(DispatchTask task)
execute
in interface HandoverTask
task
- The task to set-up in a new threadHandoverTask.execute(org.apache.felix.eventadmin.impl.tasks.DispatchTask)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |