public class DefaultSubmissionService extends AbstractService implements SubmissionService
actionMetrics, circuitBreaker, isShutdown, semaphoreMAX_CONCURRENCY_LEVEL, MAX_TIMEOUT_MILLIS| Constructor and Description |
|---|
DefaultSubmissionService(java.util.concurrent.ExecutorService service,
PrecipiceSemaphore semaphore) |
DefaultSubmissionService(java.util.concurrent.ExecutorService service,
PrecipiceSemaphore semaphore,
ActionMetrics actionMetrics) |
DefaultSubmissionService(java.util.concurrent.ExecutorService service,
PrecipiceSemaphore semaphore,
ActionMetrics actionMetrics,
CircuitBreaker circuitBreaker) |
DefaultSubmissionService(java.util.concurrent.ExecutorService service,
PrecipiceSemaphore semaphore,
ActionMetrics actionMetrics,
CircuitBreaker circuitBreaker,
java.util.concurrent.atomic.AtomicBoolean isShutdown) |
DefaultSubmissionService(java.util.concurrent.ExecutorService service,
PrecipiceSemaphore semaphore,
CircuitBreaker breaker) |
| Modifier and Type | Method and Description |
|---|---|
void |
shutdown()
Attempts to shutdown the service.
|
<T> ResilientFuture<T> |
submit(ResilientAction<T> action,
long millisTimeout)
Submits a
ResilientAction that will be run asynchronously. |
<T> ResilientFuture<T> |
submit(ResilientAction<T> action,
ResilientCallback<T> callback,
long millisTimeout)
Submits a
ResilientAction that will be run asynchronously similar to
SubmissionService.submit(ResilientAction, long). |
acquirePermitOrRejectIfActionNotAllowed, getActionMetrics, getCircuitBreakerclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetActionMetrics, getCircuitBreakerpublic DefaultSubmissionService(java.util.concurrent.ExecutorService service,
PrecipiceSemaphore semaphore)
public DefaultSubmissionService(java.util.concurrent.ExecutorService service,
PrecipiceSemaphore semaphore,
ActionMetrics actionMetrics)
public DefaultSubmissionService(java.util.concurrent.ExecutorService service,
PrecipiceSemaphore semaphore,
CircuitBreaker breaker)
public DefaultSubmissionService(java.util.concurrent.ExecutorService service,
PrecipiceSemaphore semaphore,
ActionMetrics actionMetrics,
CircuitBreaker circuitBreaker)
public DefaultSubmissionService(java.util.concurrent.ExecutorService service,
PrecipiceSemaphore semaphore,
ActionMetrics actionMetrics,
CircuitBreaker circuitBreaker,
java.util.concurrent.atomic.AtomicBoolean isShutdown)
public <T> ResilientFuture<T> submit(ResilientAction<T> action, long millisTimeout)
SubmissionServiceResilientAction that will be run asynchronously.
The result of the action will be delivered to the future returned
by this call. An attempt to cancel the action will be made if it
does not complete before the timeout.submit in interface SubmissionServiceT - the type of the result of the actionaction - the action to submitmillisTimeout - milliseconds before the action times outResilientFuture representing pending completion of the actionpublic <T> ResilientFuture<T> submit(ResilientAction<T> action, ResilientCallback<T> callback, long millisTimeout)
SubmissionServiceResilientAction that will be run asynchronously similar to
SubmissionService.submit(ResilientAction, long). However, at the completion of the task,
the provided callback will be executed. The callback will be run regardless of the result
of the action.submit in interface SubmissionServiceT - the type of the result of the actionaction - the action to submitcallback - to run on action completionmillisTimeout - milliseconds before the action times outResilientFuture representing pending completion of the actionpublic void shutdown()
ServiceRejectedActionException. Implementations may differ on if pending
or executing actions are cancelled.Copyright © 2014 Tim Brooks. All Rights Reserved.