T - data signature typeV - data typepublic abstract class EventDataHandler<T,V extends EventData<T>> extends Object
IEvent the instance of EventData is created with
the IEventDataFactory that can add some additional information like system info
or version.
This data instance is immediately cached with IEventDataCache that can for example
merge data with the same signature by summing there count.
If the previous processing operation is finished and the wait time is passed then the next event is retrieved from cache
(it may be for example based on some comparator like the biggest count, if EventDataCacheComparatorBased
is used, or just queue based if the EventDataCacheQueueBased is used or any other order determined by
custom cache) and the processing is started asynchronously
This class can be considered thread-safe if the cache and factory instances aren't used anywhere else in the code.| Constructor and Description |
|---|
EventDataHandler(IEventDataCache<T,V> cache,
IEventDataFactory<T,V> factory,
long initialWaitTimeMillis,
long maxWaitTimeMillis) |
| Modifier and Type | Method and Description |
|---|---|
List<V> |
clear() |
WaitTime |
getWaitTime() |
void |
increaseWaitTime() |
protected void |
onFailure(V data) |
protected boolean |
onProcessException(Exception exception)
Is called when exception is thrown in process.
|
protected void |
onSuccess(V data) |
protected abstract boolean |
process(V data) |
void |
register(IEvent event,
IMetaInfo metaInfo) |
void |
resetWaitTime() |
void |
setNoWaitTime() |
void |
tryProcessNext() |
void |
tryProcessNextAsync() |
void |
tryProcessNextAsync(Boolean daemon) |
void |
tryProcessRest()
Method that will try to immediately process all cashed data, ignoring the usual error fallback procedures.
|
public EventDataHandler(IEventDataCache<T,V> cache, IEventDataFactory<T,V> factory, long initialWaitTimeMillis, long maxWaitTimeMillis)
public void tryProcessNext()
public void tryProcessNextAsync()
public void tryProcessNextAsync(Boolean daemon)
public void tryProcessRest()
public void resetWaitTime()
public void increaseWaitTime()
public void setNoWaitTime()
public WaitTime getWaitTime()
protected void onSuccess(V data)
protected void onFailure(V data)
protected boolean onProcessException(Exception exception)
exception - caught exceptionprotected abstract boolean process(V data)
Copyright © 1998–2019 iText Group NV. All rights reserved.