Classes | Public Member Functions | Private Attributes | Static Private Attributes
org.ros.concurrent.RetryingExecutorService Class Reference

List of all members.

Classes

class  RetryLoop

Public Member Functions

 RetryingExecutorService (ScheduledExecutorService scheduledExecutorService)
void setRetryDelay (long delay, TimeUnit unit)
void shutdown (long timeout, TimeUnit unit) throws InterruptedException
void submit (Callable< Boolean > callable)

Private Attributes

final Map< Future< Boolean >
, Callable< Boolean > > 
callables
final CompletionService< Boolean > completionService
final Map< Callable< Boolean >
, CountDownLatch > 
latches
final Object mutex
long retryDelay
final RetryLoop retryLoop
TimeUnit retryTimeUnit
boolean running
final ScheduledExecutorService scheduledExecutorService

Static Private Attributes

static final boolean DEBUG = false
static final long DEFAULT_RETRY_DELAY = 5
static final TimeUnit DEFAULT_RETRY_TIME_UNIT = TimeUnit.SECONDS
static final Log log = LogFactory.getLog(RetryingExecutorService.class)

Detailed Description

Wraps an ScheduledExecutorService to execute Callables with retries.

Author:
damonkohler@google.com (Damon Kohler)

Definition at line 43 of file RetryingExecutorService.java.


Constructor & Destructor Documentation

org.ros.concurrent.RetryingExecutorService.RetryingExecutorService ( ScheduledExecutorService  scheduledExecutorService) [inline]
Parameters:
scheduledExecutorServicethe ExecutorService to wrap

Definition at line 93 of file RetryingExecutorService.java.


Member Function Documentation

void org.ros.concurrent.RetryingExecutorService.setRetryDelay ( long  delay,
TimeUnit  unit 
) [inline]
Parameters:
delaythe delay in units of
 unit 
unitthe TimeUnit of the delay

Definition at line 135 of file RetryingExecutorService.java.

void org.ros.concurrent.RetryingExecutorService.shutdown ( long  timeout,
TimeUnit  unit 
) throws InterruptedException [inline]

Stops accepting new Callables and waits for all submitted Callables to finish within the specified timeout.

Parameters:
timeoutthe timeout in units of
 unit 
unitthe TimeUnit of
 timeout 
Exceptions:
InterruptedException

Definition at line 150 of file RetryingExecutorService.java.

void org.ros.concurrent.RetryingExecutorService.submit ( Callable< Boolean >  callable) [inline]

Submit a new Callable to be executed. The submitted Callable should return

 true 

to be retried,

 false 

otherwise.

Parameters:
callablethe Callable to execute
Exceptions:
RejectedExecutionExceptionif the RetryingExecutorService is shutting down

Definition at line 117 of file RetryingExecutorService.java.


Member Data Documentation

final Map<Future<Boolean>, Callable<Boolean> > org.ros.concurrent.RetryingExecutorService.callables [private]

Definition at line 54 of file RetryingExecutorService.java.

final CompletionService<Boolean> org.ros.concurrent.RetryingExecutorService.completionService [private]

Definition at line 55 of file RetryingExecutorService.java.

final boolean org.ros.concurrent.RetryingExecutorService.DEBUG = false [static, private]

Definition at line 45 of file RetryingExecutorService.java.

Definition at line 48 of file RetryingExecutorService.java.

final TimeUnit org.ros.concurrent.RetryingExecutorService.DEFAULT_RETRY_TIME_UNIT = TimeUnit.SECONDS [static, private]

Definition at line 49 of file RetryingExecutorService.java.

final Map<Callable<Boolean>, CountDownLatch> org.ros.concurrent.RetryingExecutorService.latches [private]

Definition at line 53 of file RetryingExecutorService.java.

final Log org.ros.concurrent.RetryingExecutorService.log = LogFactory.getLog(RetryingExecutorService.class) [static, private]

Definition at line 46 of file RetryingExecutorService.java.

Definition at line 56 of file RetryingExecutorService.java.

Definition at line 58 of file RetryingExecutorService.java.

Definition at line 52 of file RetryingExecutorService.java.

Definition at line 59 of file RetryingExecutorService.java.

Definition at line 60 of file RetryingExecutorService.java.

Definition at line 51 of file RetryingExecutorService.java.


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


rosjava_core
Author(s):
autogenerated on Wed Aug 26 2015 16:06:50