public abstract class AbstractJavaActionActor extends AbstractActionActorTXPNode<JavaActionActorBase.Settings> implements IJavaActionActor
IJavaActionActor
required to handle execution of a VirtualSpace action in conjunction with the TXP engine.ITXPNode.State
hasProcessTimedOut, hasTimedOut, hasTimedOutWaiting, pid, process, state, timeout, timeoutTask, txplog
Modifier | Constructor and Description |
---|---|
protected |
AbstractJavaActionActor()
Default constructor.
|
Modifier and Type | Method and Description |
---|---|
ITXPNode.State |
begin(ITXProcess process,
ITXPid pid)
Notifies the node it got associated with a transactional process.
|
ITXPNode.State |
commit(ITXProcess process)
Instructs the node to commit the work.
|
void |
execute()
Method called to do the serialized work of the action actor.
|
void |
forget(ITXProcess process)
Notifies the node it got disassociated from the process ie it can abort,
rollback (if needed) and forget about the process.
|
abstract void |
onAction()
Performs the action as a part of a commit operation.
|
protected void |
onBegin()
Notifies the node it got associated with a transactional process.
|
protected void |
onCommit()
Instructs the node to commit the work.
|
protected void |
onForget()
Notifies the node it got disassociated from the process i.e.
|
protected void |
onPrepare()
Action actor specific action needed for preparation.
|
protected void |
onRollback()
Instructs the node to roll back the work.
|
protected void |
prepare()
Action actor specific action needed for preparation.
|
ITXPNode.State |
rollback(ITXProcess process)
Instructs the node to roll back the work.
|
assignSettings, cleanUp, createLogger, executeAction, getAction, getActionProcess, getLoggerInfo, getSettings, getVirtualSpace, onCleanup, prepareAction, setState
cancelTimeout, getPid, getProcess, getState, getTimeout, hasProcessTimedOut, hasTimedOut, hasTimedOutWaiting, isIdempotent, log, onTimeout, processTimeout, ready, recover, retry, setTimeout, timeout, undo
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getPid, getState, getTimeout, hasProcessTimedOut, hasTimedOut, isIdempotent, processTimeout, recover, retry, timeout, undo
assignSettings, getAction, getActionProcess, getSettings, getVirtualSpace
public final ITXPNode.State begin(ITXProcess process, ITXPid pid)
protected final void prepare() throws Exception
This method cannot be overridden.
Override the method
to perform custom
processing.onPrepare()
prepare
in class AbstractActionActorTXPNode<JavaActionActorBase.Settings>
Exception
- For any error in the prepare phase.public void execute() throws Exception
By default, this method calls the
method but can be overridden.onAction()
execute
in class AbstractActionActorTXPNode<JavaActionActorBase.Settings>
Exception
- For any error in the execution phase.public final void forget(ITXProcess process)
This method cannot be overridden.
Override the method
to perform custom
processing.onForget()
forget
in interface ITXPNode
forget
in class AbstractActionActorTXPNode<JavaActionActorBase.Settings>
process
- The process.public ITXPNode.State rollback(ITXProcess process)
ITXPNode.State.COMPLETED
or ITXPNode.State.FAILED
depending on
its state. NOTE if the node failed its work it is already rolled back and
will return ITXPNode.State.COMPLETED
but remain in state
ITXPNode.State.FAILED
.
This method cannot be overridden.
Override the method
to perform custom
processing.onRollback()
public ITXPNode.State commit(ITXProcess process)
ITXPNode.State.COMPLETED
or ITXPNode.State.FAILED
depending on its
state. If a commit failed the node is expected to have rolled back the
work.protected void onBegin() throws Exception
Override this method to perform specific processing.
Exception
- For any kind of error.protected void onPrepare() throws Exception
Override this method to perform specific processing.
Exception
- For any kind of error.protected void onCommit() throws Exception
This method can be overridden to process commit.
Exception
- For any kind of error.protected void onRollback() throws Exception
This method can be overridden to process rollback.
Exception
- For any kind of error.protected void onForget() throws Exception
A node that handles commit and rollback should override this method and call rollback.
The default is to make sure that
has been
called, and if not it gets called.onRollback()
Exception
- For any kind of error.public abstract void onAction()
onAction
in interface IJavaActionActor
iizi® is a registered trademark of Mindus SARL. © Copyright Mindus SARL, 2020. All rights reserved.