org.apache.felix.eventadmin.impl.tasks
Class DispatchTask

java.lang.Object
  extended by org.apache.felix.eventadmin.impl.tasks.DispatchTask
All Implemented Interfaces:
Runnable

public class DispatchTask
extends Object
implements Runnable

This class is the core of the event dispatching (for both, synchronous and asynchronous). It implements handover and timeout capabilities.

Author:
Felix Project Team

Constructor Summary
DispatchTask(TaskProducer producer, Scheduler scheduler, HandoverTask handover)
          The constructor of the object.
 
Method Summary
 void handover()
          This method will trigger a callback to the handover callback and stop this task.
 void hold()
          This will pause the task (including its timeout clock) until a call to resume()
 void resume()
          This will let the previously hold task resume.
 void run()
          This will loop until the producer returns null.
 void stop()
          This method stops the tasks without a handover
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DispatchTask

public DispatchTask(TaskProducer producer,
                    Scheduler scheduler,
                    HandoverTask handover)
The constructor of the object.

Parameters:
producer - The producer (i.e., the event queue) that provides the next tasks
scheduler - The scheduler to use for timeout actions
handover - The callback to use on timeouts and handovers
Method Detail

run

public void run()
This will loop until the producer returns null. Until then the returned tasks are executed.

Specified by:
run in interface Runnable
See Also:
Runnable.run()

handover

public void handover()
This method will trigger a callback to the handover callback and stop this task.


stop

public void stop()
This method stops the tasks without a handover


hold

public void hold()
This will pause the task (including its timeout clock) until a call to resume()


resume

public void resume()
This will let the previously hold task resume.



Copyright © 2006-2011 Apache Software Foundation. All Rights Reserved.