alma::acs::concurrent::ThreadLoopRunner::TaskWrapper Class Reference

Collaboration diagram for alma::acs::concurrent::ThreadLoopRunner::TaskWrapper:
Collaboration graph
[legend]

List of all members.

Public Member Functions

void run ()

Package Functions

 TaskWrapper (Runnable delegate)
boolean isRunning ()
void attemptCancelTask ()
boolean awaitTaskFinish (long timeout, TimeUnit unit) throws InterruptedException

Private Attributes

final Runnable delegate
final ReentrantLock runLock
volatile boolean isRunning

Detailed Description

Wrapper of the user-supplied Runnable, which can inform callers about the execution status of the run() method, or block clients until it finishes.


Constructor & Destructor Documentation

alma::acs::concurrent::ThreadLoopRunner::TaskWrapper::TaskWrapper ( Runnable  delegate  )  [inline, package]

References isRunning(), and runLock.


Member Function Documentation

void alma::acs::concurrent::ThreadLoopRunner::TaskWrapper::attemptCancelTask (  )  [inline, package]

Checks if the delegate Runnable is of subtype CancelableRunnable, and if so, calls the cancel() method.

References delegate.

Referenced by alma::acs::concurrent::ThreadLoopRunner::shutdown().

boolean alma::acs::concurrent::ThreadLoopRunner::TaskWrapper::awaitTaskFinish ( long  timeout,
TimeUnit  unit 
) throws InterruptedException [inline, package]

Blocks the calling thread if and as long as the delegate::run method executes, but at most for the given timeout.

Exceptions:
InterruptedException 

References runLock.

Referenced by alma::acs::concurrent::ThreadLoopRunner::suspendLoopAndWait().

Tests if delegate::run is currently executing.

Returns:

Referenced by run(), and TaskWrapper().

void alma::acs::concurrent::ThreadLoopRunner::TaskWrapper::run (  )  [inline]

References delegate, isRunning(), and runLock.


Member Data Documentation

Referenced by attemptCancelTask(), and run().

Referenced by awaitTaskFinish(), run(), and TaskWrapper().


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

Generated by  doxygen 1.6.2