Package com.iizix.txp.impl
Class AbstractActionActorTXPNode<SETTINGS extends AbstractSettings>
java.lang.Object
com.iizix.txp.impl.AbstractTXPNode
com.iizix.txp.impl.AbstractActionActorTXPNode<SETTINGS>
- All Implemented Interfaces:
- IActionActorSettingsReceiver<SETTINGS>,- ITimeoutListener,- ITXPNode
- Direct Known Subclasses:
- AbstractJavaActionActor,- DatabaseActionTXPNode
public abstract class AbstractActionActorTXPNode<SETTINGS extends AbstractSettings> extends AbstractTXPNode implements IActionActorSettingsReceiver<SETTINGS>
The abstract TXP node that the Action Actors needs to extend from.
- Author:
- Christopher Mindus
- Nested Class Summary- Nested classes/interfaces inherited from interface com.iizix.txp.ITXPNode- ITXPNode.State
- Field Summary- Fields inherited from class com.iizix.txp.impl.AbstractTXPNode- hasProcessTimedOut, hasTimedOut, hasTimedOutWaiting, pid, process, state, timeout, timeoutTask, txplog
- Constructor SummaryConstructorsModifierConstructorDescription- protectedDefault constructor used by the- AbstractJavaActionActorconstructor.- protected- AbstractActionActorTXPNode- (VSActionTXProcess actionProcess, SETTINGS settings) Constructor for action actors.
- Method SummaryModifier and TypeMethodDescription- final void- assignSettings- (VSActionTXProcess actionProcess, SETTINGS settings) Called when the construction is performed of the node to assign the settings property container.- protected final void- cleanUp()Cleans up once by calling- onCleanup()- protected final voidOverrides logger creation to set our own.- abstract void- execute()Method called to do the serialized work of the action actor.- final ThrowableMethod called to do the serialized execution 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.- final VSActionGets the action associated with the VirtualSpace Action TXP process.- final VSActionTXProcessGets the action transaction process.- final StringGets the node information string.- final SETTINGSGets the settings container.- final VirtualSpaceGets the VirtualSpace for the process VirtualSpace Action TXP process.- protected voidCalled last to perform clean-up.- protected void- prepare()Action actor specific action needed for preparation.- final ThrowableMethod called to do the serialized preparation of the action actor.- protected void- setState- (ITXPNode.State state) Changes the node's state to the specified state.- Methods inherited from class com.iizix.txp.impl.AbstractTXPNode- cancelTimeout, getPid, getProcess, getState, getTimeout, hasProcessTimedOut, hasTimedOut, hasTimedOutWaiting, isIdempotent, log, onTimeout, processTimeout, ready, recover, retry, setTimeout, timeout, undo
- Constructor Details- AbstractActionActorTXPNodeprotected AbstractActionActorTXPNode()Default constructor used by the- AbstractJavaActionActorconstructor.
- AbstractActionActorTXPNodeConstructor for action actors.
 
- Method Details- createLoggerprotected final void createLogger()Overrides logger creation to set our own.- Overrides:
- createLoggerin class- AbstractTXPNode
 
- setStateChanges the node's state to the specified state. Any changes in the state will be logged.- Parameters:
- state- The new node state.
 
- assignSettingspublic final void assignSettings- (VSActionTXProcess actionProcess, SETTINGS settings) throws IllegalStateException Called when the construction is performed of the node to assign the settings property container.- This method is called by the framework and should not be called. - Specified by:
- assignSettingsin interface- IActionActorSettingsReceiver<SETTINGS extends AbstractSettings>
- Parameters:
- actionProcess- The action process.
- settings- The property container instance.
- Throws:
- IllegalStateException- If called outside of the framework.
 
- getSettingsGets the settings container. If this call is done in the constructor, it will return null.- Specified by:
- getSettingsin interface- IActionActorSettingsReceiver<SETTINGS extends AbstractSettings>
- Returns:
- The settings container, or null if not yet set. After constructor has been called, this value is non-null.
 
- getActionProcessGets the action transaction process.- Specified by:
- getActionProcessin interface- IActionActorSettingsReceiver<SETTINGS extends AbstractSettings>
- Returns:
- The VSActionTXProcess instance invoking this Java Actor, or nullif called in e.g. the constructor and the initialization usingassignSettings(VSActionTXProcess, AbstractSettings)
 
- getActionGets the action associated with the VirtualSpace Action TXP process.- Specified by:
- getActionin interface- IActionActorSettingsReceiver<SETTINGS extends AbstractSettings>
- Returns:
- The VSAction instance invoking this Java Actor, or nullif called in e.g. the constructor and the initialization usingassignSettings(VSActionTXProcess, AbstractSettings)
 
- getVirtualSpaceGets the VirtualSpace for the process VirtualSpace Action TXP process.- Specified by:
- getVirtualSpacein interface- IActionActorSettingsReceiver<SETTINGS extends AbstractSettings>
- Returns:
- The VirtualSpace instance invoking this Java Actor, or nullif called in e.g. the constructor and the initialization usingassignSettings(VSActionTXProcess, AbstractSettings)
 
- getLoggerInfoGets the node information string.- Returns:
- Node information string information to pass to the logger output, or null for not yet initialized.
 
- prepareActionMethod called to do the serialized preparation of the action actor.- This method is called once all nodes are associated with the TXProcess and each node has processed "begin" successfully. - If this action fails preparation, the process is rolled back, and this is handled by the framework. - Returns:
- null for success of the action prepare stage, otherwise the exception.
 
- prepareAction actor specific action needed for preparation. This method is called from the prepareAction.- This method is overridden by the action actor as required. - Throws:
- Exception- For any error in the prepare phase.
 
- executeActionMethod called to do the serialized execution work of the action actor.- This method is called once all nodes are associated with the TXProcess, each node has processed "begin" and "prepare" successfully. - Returns:
- null for success of the action execution, otherwise the exception.
 
- executeMethod called to do the serialized work of the action actor. This method is called once all nodes are associated with the TXProcess and each node has processed "begin" successfully.- This method must be implemented by the action actor. - Throws:
- Exception- For any error in the execution phase.
 
- forgetNotifies the node it got disassociated from the process ie it can abort, rollback (if needed) and forget about the process.
- cleanUpprotected final void cleanUp()Cleans up once by calling- onCleanup()
- onCleanupprotected void onCleanup()Called last to perform clean-up.- Override this method to perform the required clean-up of resources, etc.