activemq-cpp-3.4.0

activemq::threads::CompositeTaskRunner Class Reference

A Task Runner that can contain one or more CompositeTasks that are each checked for pending work and run if any is present in the order that the tasks were added. More...

#include <src/main/activemq/threads/CompositeTaskRunner.h>

Inheritance diagram for activemq::threads::CompositeTaskRunner:

Public Member Functions

 CompositeTaskRunner ()
virtual ~CompositeTaskRunner ()
void addTask (CompositeTask *task)
 Adds a new CompositeTask to the Set of Tasks that this class manages.
void removeTask (CompositeTask *task)
 Removes a CompositeTask that was added previously.
virtual void shutdown (unsigned int timeout)
 Shutdown after a timeout, does not guarantee that the task's iterate method has completed and the thread halted.
virtual void shutdown ()
 Shutdown once the task has finished and the TaskRunner's thread has exited.
virtual void wakeup ()
 Signal the TaskRunner to wakeup and execute another iteration cycle on the task, the Task instance will be run until its iterate method has returned false indicating it is done.

Protected Member Functions

virtual void run ()
 Run method - called by the Thread class in the context of the thread.
virtual bool iterate ()
 Perform one iteration of work, returns true if the task needs to run again to complete or false to indicate that the task is now complete.

Detailed Description

A Task Runner that can contain one or more CompositeTasks that are each checked for pending work and run if any is present in the order that the tasks were added.

Since:
3.0

Constructor & Destructor Documentation

activemq::threads::CompositeTaskRunner::CompositeTaskRunner ( )
virtual activemq::threads::CompositeTaskRunner::~CompositeTaskRunner ( ) [virtual]

Member Function Documentation

void activemq::threads::CompositeTaskRunner::addTask ( CompositeTask task)

Adds a new CompositeTask to the Set of Tasks that this class manages.

Parameters:
task- Pointer to a CompositeTask instance.
virtual bool activemq::threads::CompositeTaskRunner::iterate ( ) [protected, virtual]

Perform one iteration of work, returns true if the task needs to run again to complete or false to indicate that the task is now complete.

Returns:
true if the task should be run again or false if the task has completed and the runner should wait for a wakeup call.

Implements activemq::threads::Task.

void activemq::threads::CompositeTaskRunner::removeTask ( CompositeTask task)

Removes a CompositeTask that was added previously.

Parameters:
task- Pointer to a CompositeTask instance.
virtual void activemq::threads::CompositeTaskRunner::run ( ) [protected, virtual]

Run method - called by the Thread class in the context of the thread.

Implements decaf::lang::Runnable.

virtual void activemq::threads::CompositeTaskRunner::shutdown ( ) [virtual]

Shutdown once the task has finished and the TaskRunner's thread has exited.

Implements activemq::threads::TaskRunner.

virtual void activemq::threads::CompositeTaskRunner::shutdown ( unsigned int  timeout) [virtual]

Shutdown after a timeout, does not guarantee that the task's iterate method has completed and the thread halted.

Parameters:
timeout- Time in Milliseconds to wait for the task to stop.

Implements activemq::threads::TaskRunner.

virtual void activemq::threads::CompositeTaskRunner::wakeup ( ) [virtual]

Signal the TaskRunner to wakeup and execute another iteration cycle on the task, the Task instance will be run until its iterate method has returned false indicating it is done.

Implements activemq::threads::TaskRunner.


The documentation for this class was generated from the following file: