Class EndBranchComponent

  • All Implemented Interfaces:
    java.util.Map

    public class EndBranchComponent
    extends AssemblyLineComponent
    The EndBranchComponent is an internal component that is associated with a BranchComponent. Its job is to check if we are in an if/else-if/else construct and skip any else-if/else type branch components based on the execute status of the associated BranchComponent.
    • Constructor Detail

      • EndBranchComponent

        public EndBranchComponent​(AssemblyLine parent,
                                  BranchingComponent bc)
        The Constructor for the EndBranchComponent
        Parameters:
        parent - The AssemblyLine that contains this EndBranchComponent
        bc - The BranchingComponent that this is an end for
    • Method Detail

      • willExecute

        public boolean willExecute​(Entry work)
        This method always returns true. Our test is performed in the add operation.
        Overrides:
        willExecute in class AssemblyLineComponent
        Parameters:
        work - The work Entry. Not used.
        Returns:
        true
      • getType

        public int getType()
        This method returns the AL component type (ServerConstants.TYPE_BRANCH)
        Overrides:
        getType in class AssemblyLineComponent
        Returns:
        The type value (ServerConstants.TYPE_BRANCH)
      • add

        public void add​(Entry meta)
                 throws java.lang.Exception
        This method is called by the hosting AssemblyLine. Check for if/else-if/else construct and set the next connector to execute based on branch type and execution status.
        Overrides:
        add in class AssemblyLineComponent
        Parameters:
        meta - The work entry (not used)
        Throws:
        java.lang.Exception - if a problem occurs
      • getParentBranchType

        public int getParentBranchType()
        Returns the type of the original branch to which this end branch belongs.
        Returns:
        the type of the parrent branch
      • handleException

        public void handleException​(java.lang.String oper,
                                    java.lang.Throwable e,
                                    Entry meta)
                             throws java.lang.Exception
        Any errors during execution of add() ends up here. We don't have error hooks so we just rethrow the exception.
        Overrides:
        handleException in class AssemblyLineComponent
        Parameters:
        oper - Not used.
        e - Exception
        meta - Not used.
        Throws:
        java.lang.Exception - The "e" exception
      • trigger

        public boolean trigger​(java.lang.String oper,
                               Entry work,
                               Entry conn)
        NOOP. This component has no triggers.
        Overrides:
        trigger in class AssemblyLineComponent
        Parameters:
        oper - Not used.
        work - Not used.
        conn - Not used.
        Returns:
        false
      • trigger

        public boolean trigger​(java.lang.String oper,
                               Entry work)
        NOOP. This component has no triggers.
        Overrides:
        trigger in class AssemblyLineComponent
        Parameters:
        oper - Not used.
        work - Not used.
        Returns:
        false
      • close

        public void close()
                   throws java.lang.Exception
        Release resources.
        Overrides:
        close in class AssemblyLineComponent
        Throws:
        java.lang.Exception - None