Class AbstractActionActorTXPNode<SETTINGS extends AbstractSettings>

    • Constructor Detail

      • AbstractActionActorTXPNode

        protected AbstractActionActorTXPNode()
        Default constructor used by the AbstractJavaActionActor constructor.
      • AbstractActionActorTXPNode

        protected AbstractActionActorTXPNode​(VSActionTXProcess actionProcess,
                                             SETTINGS settings)
        Constructor for action actors.
    • Method Detail

      • createLogger

        protected final void createLogger()
        Overrides logger creation to set our own.
        Overrides:
        createLogger in class AbstractTXPNode
      • setState

        protected void setState​(ITXPNode.State state)
        Changes the node's state to the specified state. Any changes in the state will be logged.
        Parameters:
        state - The new node state.
      • assignSettings

        public final void assignSettings​(VSActionTXProcess actionProcess,
                                         SETTINGS settings)
                                  throws java.lang.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:
        assignSettings in interface IActionActorSettingsReceiver<SETTINGS extends AbstractSettings>
        Parameters:
        actionProcess - The action process.
        settings - The property container instance.
        Throws:
        java.lang.IllegalStateException - If called outside of the framework.
      • getSettings

        public final SETTINGS getSettings()
        Gets the settings container. If this call is done in the constructor, it will return null.
        Specified by:
        getSettings in 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.
      • getLoggerInfo

        public final java.lang.String getLoggerInfo()
        Gets the node information string.
        Returns:
        Node information string information to pass to the logger output, or null for not yet initialized.
      • prepareAction

        public final java.lang.Throwable prepareAction()
        Method 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.
      • prepare

        protected void prepare()
                        throws java.lang.Exception
        Action actor specific action needed for preparation. This method is called from the prepareAction.

        This method is overridden by the action actor as required.

        Throws:
        java.lang.Exception - For any error in the prepare phase.
      • executeAction

        public final java.lang.Throwable executeAction()
        Method 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.
      • execute

        public abstract void execute()
                              throws java.lang.Exception
        Method 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:
        java.lang.Exception - For any error in the execution phase.
      • forget

        public 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.
        Specified by:
        forget in interface ITXPNode
        Parameters:
        process - The process.
      • cleanUp

        protected final void cleanUp()
        Cleans up once by calling onCleanup() and then logs potential clean-up error. The node is then cleared of TXProcess references.
      • onCleanup

        protected void onCleanup()
        Called last to perform clean-up.

        Override this method to perform the required clean-up of resources, etc.