Public Member Functions | |
void | cancel () |
CancellableLoop () | |
boolean | isRunning () |
void | run () |
Protected Member Functions | |
void | handleInterruptedException (InterruptedException e) |
abstract void | loop () throws InterruptedException |
void | setup () |
Private Attributes | |
final Object | mutex |
boolean | ranOnce = false |
Thread | thread |
An interruptable loop that can be run by an ExecutorService.
Definition at line 28 of file CancellableLoop.java.
org.ros.concurrent.CancellableLoop.CancellableLoop | ( | ) | [inline] |
Definition at line 42 of file CancellableLoop.java.
void org.ros.concurrent.CancellableLoop.cancel | ( | ) | [inline] |
Interrupts the loop.
Definition at line 88 of file CancellableLoop.java.
void org.ros.concurrent.CancellableLoop.handleInterruptedException | ( | InterruptedException | e | ) | [inline, protected] |
An InterruptedException was thrown.
Reimplemented in org.ros.internal.transport.queue.MessageDispatcher< T >.
Definition at line 82 of file CancellableLoop.java.
boolean org.ros.concurrent.CancellableLoop.isRunning | ( | ) | [inline] |
true
Definition at line 97 of file CancellableLoop.java.
abstract void org.ros.concurrent.CancellableLoop.loop | ( | ) | throws InterruptedException [protected, pure virtual] |
The body of the loop. This will run continuously until the CancellableLoop has been interrupted externally or by calling cancel().
Implemented in org.ros.internal.transport.queue.MessageDispatcher< T >, org.ros.concurrent.RetryingExecutorService.RetryLoop, org.ros.internal.transport.queue.OutgoingMessageQueue< T >.Writer, org.ros.internal.node.topic.RepeatingPublisher< MessageType >.RepeatingPublisherLoop, and org.ros.concurrent.EventDispatcher< T >.
void org.ros.concurrent.CancellableLoop.run | ( | ) | [inline] |
Definition at line 47 of file CancellableLoop.java.
void org.ros.concurrent.CancellableLoop.setup | ( | ) | [inline, protected] |
The setup block for the loop. This will be called exactly once before the first call to loop().
Definition at line 69 of file CancellableLoop.java.
final Object org.ros.concurrent.CancellableLoop.mutex [private] |
Reimplemented in org.ros.internal.transport.queue.MessageDispatcher< T >.
Definition at line 30 of file CancellableLoop.java.
boolean org.ros.concurrent.CancellableLoop.ranOnce = false [private] |
true
if the code has been run once,
false
otherwise.
Definition at line 35 of file CancellableLoop.java.
Thread org.ros.concurrent.CancellableLoop.thread [private] |
The Thread the code will be running in.
Definition at line 40 of file CancellableLoop.java.