public abstract class PersistingUnit extends Invoker.Unit
Invoker unit which does some database
operation and then calls back to an InvocationService.InvocationListener of some
sort. If the database operation fails, the error will be logged and the result listener will be
replied to with InvocationCodes.INTERNAL_ERROR.queueStamp| Constructor and Description |
|---|
PersistingUnit(InvocationService.InvocationListener listener) |
PersistingUnit(String name,
InvocationService.InvocationListener listener) |
PersistingUnit(String name,
InvocationService.InvocationListener listener,
Object... args)
Creates a persisting unit with the supplied name and listener and a set of key/value pairs
that will be included in the failure message if this unit fails.
|
| Modifier and Type | Method and Description |
|---|---|
void |
handleFailure(Exception error)
Handles the failure case by logging the error and reporting an internal error to the
listener.
|
void |
handleResult() |
void |
handleSuccess()
Handles the success case, which by default posts a response to a ConfirmListener.
|
boolean |
invoke() |
abstract void |
invokePersistent()
This method is where the unit performs its persistent actions.
|
getDetail, getLongThreshold, run, toStringpublic PersistingUnit(InvocationService.InvocationListener listener)
public PersistingUnit(String name, InvocationService.InvocationListener listener)
public PersistingUnit(String name, InvocationService.InvocationListener listener, Object... args)
public abstract void invokePersistent()
throws Exception
getFailureMessage(), if any.Exceptionpublic void handleSuccess()
public void handleFailure(Exception error)
public boolean invoke()
invoke in class Invoker.Unitpublic void handleResult()
handleResult in class Invoker.UnitCopyright © 2015. All rights reserved.