public class SyncDeliverTasks
extends java.lang.Object
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 and Description |
---|
SyncDeliverTasks(DefaultThreadPool pool,
long timeout)
Construct a new sync deliver tasks.
|
Modifier and Type | Method and Description |
---|---|
void |
execute(java.util.Collection<EventHandlerProxy> 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
|
public SyncDeliverTasks(DefaultThreadPool pool, long timeout)
pool
- The thread pool used to spin-off new threads.public void update(long timeout)
public void execute(java.util.Collection<EventHandlerProxy> tasks, org.osgi.service.event.Event event, boolean filterAsyncUnordered)
tasks
- The event handler dispatch tasks to executeCopyright © 2006-2014 The Apache Software Foundation. All Rights Reserved.