|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.felix.eventadmin.impl.tasks.SyncDeliverTasks
public class SyncDeliverTasks
This class does the actual work of the synchronous event delivery. This is the heart of the event delivery. If an event is delivered without timeout handling, the event is directly delivered using the calling thread. If timeout handling is enabled, a new thread is taken from the thread pool and this thread is used to deliver the event. The calling thread is blocked until either the deliver is finished or the timeout occurs.
Note that in case of a timeout while a task is disabled the thread is released and we spin-off a new thread that resumes the disabled task hence, this is the only place were we break the semantics of the synchronous delivery. While the only one to notice this is the timed-out handler - it is the fault of this handler too (i.e., it blocked the dispatch for to long) but since it will not receive events anymore it will not notice this semantic difference except that it might not see events it already sent before. If during an event delivery a new event should be delivered from within the event handler, the timeout handler is stopped for the delivery time of the inner event!
| Constructor Summary | |
|---|---|
SyncDeliverTasks(DefaultThreadPool pool,
long timeout)
Construct a new sync deliver tasks. |
|
| Method Summary | |
|---|---|
void |
execute(java.util.Collection tasks,
org.osgi.service.event.Event event,
boolean filterAsyncUnordered)
This blocks an unrelated thread used to send a synchronous event until the event is send (or a timeout occurs). |
void |
update(long timeout)
Update the timeout configuration |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public SyncDeliverTasks(DefaultThreadPool pool,
long timeout)
pool - The thread pool used to spin-off new threads.| Method Detail |
|---|
public void update(long timeout)
public void execute(java.util.Collection tasks,
org.osgi.service.event.Event event,
boolean filterAsyncUnordered)
tasks - The event handler dispatch tasks to execute
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||