activemq-cpp-3.6.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 ()
virtual void start ()
 Starts the task runner.
virtual bool isStarted () const
 true if the start method has been called.
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 (long long 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.
- Public Member Functions inherited from activemq::threads::TaskRunner
virtual ~TaskRunner ()
- Public Member Functions inherited from activemq::threads::Task
virtual ~Task ()
- Public Member Functions inherited from decaf::lang::Runnable
virtual ~Runnable ()

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::isStarted ( ) const
virtual

true if the start method has been called.

Implements activemq::threads::TaskRunner.

virtual bool activemq::threads::CompositeTaskRunner::iterate ( )
protectedvirtual

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 ( )
protectedvirtual

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

Implements decaf::lang::Runnable.

virtual void activemq::threads::CompositeTaskRunner::shutdown ( long long  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::shutdown ( )
virtual

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

Implements activemq::threads::TaskRunner.

virtual void activemq::threads::CompositeTaskRunner::start ( )
virtual

Starts the task runner.

Prior to call this method tasks can be added to a Runner, but no executions will occur. The start method will create the background Thread(s) which do the work for this task runner.

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: