public abstract class ThresholdTimeoutService<T> extends Object
| Constructor and Description |
|---|
ThresholdTimeoutService(int threshold,
int timeout)
fires
processBeforeAll(Object), processAll(Collection)
and processAfterAll(Object) when threshold or timeout is reached |
ThresholdTimeoutService(int threshold,
int timeout,
Comparator<T> cmp) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
addToQueue(Iterable<T> data) |
boolean |
addToQueue(T... data) |
int |
getProcessesRunning() |
int |
getThreshold() |
int |
getTimeout() |
abstract void |
processAfterAll(T arg)
post processing
|
abstract boolean |
processAll(Collection<T> args)
main processing
|
abstract boolean |
processBeforeAll(T arg)
pre processing
|
void |
setThreshold(int threshold) |
void |
setTimeout(int timeout) |
public ThresholdTimeoutService(int threshold,
int timeout)
processBeforeAll(Object), processAll(Collection)
and processAfterAll(Object) when threshold or timeout is reachedthreshold - timeout - in Secondspublic ThresholdTimeoutService(int threshold,
int timeout,
Comparator<T> cmp)
@SafeVarargs public final boolean addToQueue(T... data)
public abstract boolean processBeforeAll(T arg) throws Exception
arg - Exceptionpublic abstract boolean processAll(Collection<T> args)
args - public abstract void processAfterAll(T arg) throws Exception
arg - Exceptionpublic final int getTimeout()
public final void setTimeout(int timeout)
public final int getThreshold()
public final void setThreshold(int threshold)
public int getProcessesRunning()
Copyright © 2014–2015. All rights reserved.