Class AbstractJavaActionActor

    • Constructor Detail

      • AbstractJavaActionActor

        protected AbstractJavaActionActor()
        Default constructor.
    • Method Detail

      • begin

        public final ITXPNode.State begin​(ITXProcess process,
                                          ITXPid pid)
        Notifies the node it got associated with a transactional process.
        Specified by:
        begin in interface ITXPNode
        Parameters:
        process - The process.
        pid - The pid for this node of the process.
        Returns:
        the state of the node, either WORKING for success, or FAILURE.
      • prepare

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

        This method cannot be overridden. Override the method onPrepare() to perform custom processing.

        Overrides:
        prepare in class AbstractActionActorTXPNode<JavaActionActorBase.Settings>
        Throws:
        java.lang.Exception - For any error in the prepare phase.
      • execute

        public 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.

        By default, this method calls the onAction() method but can be overridden.

        Specified by:
        execute in class AbstractActionActorTXPNode<JavaActionActorBase.Settings>
        Throws:
        java.lang.Exception - For any error in the execution phase.
      • onBegin

        protected void onBegin()
                        throws java.lang.Exception
        Notifies the node it got associated with a transactional process. The node should set up its local transaction context as required.

        Override this method to perform specific processing.

        Throws:
        java.lang.Exception - For any kind of error.
      • onPrepare

        protected void onPrepare()
                          throws java.lang.Exception
        Action actor specific action needed for preparation. Called after begin to prepare the operation.

        Override this method to perform specific processing.

        Throws:
        java.lang.Exception - For any kind of error.
      • onCommit

        protected void onCommit()
                         throws java.lang.Exception
        Instructs the node to commit the work.

        This method can be overridden to process commit.

        Throws:
        java.lang.Exception - For any kind of error.
      • onRollback

        protected void onRollback()
                           throws java.lang.Exception
        Instructs the node to roll back the work.

        This method can be overridden to process rollback.

        Throws:
        java.lang.Exception - For any kind of error.
      • onForget

        protected void onForget()
                         throws java.lang.Exception
        Notifies the node it got disassociated from the process i.e. it can abort, rollback (if needed) and forget about the process.

        A node that handles commit and rollback should override this method and call rollback.

        The default is to make sure that onRollback() has been called, and if not it gets called.

        Throws:
        java.lang.Exception - For any kind of error.
      • onAction

        public abstract void onAction()
        Performs the action as a part of a commit operation.
        Specified by:
        onAction in interface IJavaActionActor