public interface QueueItemHandler<Q,T,R>
MessageHandler| Modifier and Type | Method and Description |
|---|---|
T |
convert(Q queueItem)
Convert the given queue item on the queue item processing thread.
|
void |
onComplete(Q queueItem)
Called whether the processing results in success or failure on the
queue item processing thread.
|
void |
onError(Q queueItem,
java.lang.Throwable throwable)
Called when an Exception occurs while processing the given queue item on
the queue item processing thread.
|
void |
onSuccess(Q queueItem,
R result)
Called when processing completes successfully on the queue item processing
thread.
|
R |
process(T convertedQueueItem)
Return the result of processing a queue item of the given converted type on
the queue item processing thread.
|
void |
withFuture(Q queueItem,
java.util.concurrent.Future<org.apache.commons.lang3.tuple.Pair<Q,R>> future)
Called after the queue item is retrieved off of the queue and handed off to
an Executor for processing.
|
T convert(Q queueItem) throws java.lang.Exception
queueItem - a queue item to convertjava.lang.ExceptionR process(T convertedQueueItem) throws java.lang.Exception
convertedQueueItem - the converted target queue itemjava.lang.Exceptionvoid onSuccess(Q queueItem, R result)
queueItem - the original queue item that was successfully processedresult - the result returned from successful queue item handlingvoid onError(Q queueItem, java.lang.Throwable throwable)
queueItem - the queue item receivedthrowable - the error that occurred while trying to process the queue itemvoid onComplete(Q queueItem)
queueItem - the original queue item being handledvoid withFuture(Q queueItem, java.util.concurrent.Future<org.apache.commons.lang3.tuple.Pair<Q,R>> future)
queueItem - the queue item to be processedfuture - the Future created after submitting the handling task to the executor