Class GenericController

    • Field Detail

      • subControllersAndSamplers

        protected transient List<TestElement> subControllersAndSamplers
      • current

        protected transient int current
        Index of current sub controller or sampler
    • Constructor Detail

      • GenericController

        public GenericController()
        Creates a Generic Controller
    • Method Detail

      • initialize

        public void initialize()
        Description copied from interface: Controller
        Called to initialize a controller at the beginning of a test iteration.
        Specified by:
        initialize in interface Controller
      • initializeSubControllers

        protected void initializeSubControllers()
        (re)Initializes sub controllers See Bug 50032
      • reInitialize

        protected void reInitialize()
        Resets the controller (called after execution of last child of controller):
        • resetCurrent() (i.e. current=0)
        • increment iteration count
        • sets first=true
        • recoverRunningVersion() to set the controller back to the initial state
      • isDone

        public boolean isDone()
        Description copied from interface: Controller
        Indicates whether the Controller is done delivering Samplers for the rest of the test. When the top-level controller returns true to JMeterThread, the thread is complete.
        Specified by:
        isDone in interface Controller
        Returns:
        boolean
        See Also:
        Controller.isDone()
      • setDone

        protected void setDone​(boolean done)
      • isFirst

        protected boolean isFirst()
        Returns:
        true if it's the controller is returning the first of its children
      • setFirst

        public void setFirst​(boolean b)
        If b is true, it means first is reset which means Controller has executed all its children
        Parameters:
        b - The flag, whether first is reseted
      • nextIsAController

        protected Sampler nextIsAController​(Controller controller)
                                     throws NextIsNullException
        Called by next() if the element is a Controller, and returns the next sampler from the controller. If this is null, then updates the current pointer and makes recursive call to next().
        Parameters:
        controller - the current next element
        Returns:
        the next sampler
        Throws:
        NextIsNullException - when the end of the list has already been reached
      • nextIsASampler

        protected Sampler nextIsASampler​(Sampler element)
                                  throws NextIsNullException
        Increment the current pointer and return the element. Called by next() if the element is a sampler. (May be overriden by sub-classes).
        Parameters:
        element - the current next element
        Returns:
        input element
        Throws:
        NextIsNullException - when the end of the list has already been reached
      • triggerEndOfLoop

        public void triggerEndOfLoop()
        Trigger end of loop condition on controller (used by Start Next Loop feature)
        Specified by:
        triggerEndOfLoop in interface Controller
      • reInitializeSubController

        protected void reInitializeSubController()
        Deprecated.
        replaced by GeneriController#initializeSubControllers
        Called to re-initialize a index of controller's elements (Bug 50032)
      • currentReturnedNull

        protected void currentReturnedNull​(Controller c)
        If the controller is done, remove it from the list, otherwise increment to next entry in list.
        Parameters:
        c - controller
      • getSubControllers

        protected List<TestElement> getSubControllers()
        Gets the SubControllers attribute of the GenericController object
        Returns:
        the SubControllers value
      • setCurrentElement

        protected void setCurrentElement​(TestElement currentElement)
                                  throws NextIsNullException
        Empty implementation - does nothing.
        Parameters:
        currentElement - the current element
        Throws:
        NextIsNullException - when the list has been completed already
      • getCurrentElement

        protected TestElement getCurrentElement()
                                         throws NextIsNullException

        Gets the element indicated by the current index, if one exists, from the subControllersAndSamplers list.

        If the subControllersAndSamplers list is empty, then set done = true, and throw NextIsNullException.

        Returns:
        the current element - or null if current index too large
        Throws:
        NextIsNullException - if list is empty
      • removeCurrentElement

        protected void removeCurrentElement()
      • incrementCurrent

        protected void incrementCurrent()
        Increments the current pointer; called by currentReturnedNull to move the controller on to its next child.
      • resetCurrent

        protected void resetCurrent()
      • addTestElementOnce

        public final boolean addTestElementOnce​(TestElement child)
        Add child test element only if it has not already been added.

        Only for use by TestCompiler.

        Specified by:
        addTestElementOnce in interface TestCompilerHelper
        Parameters:
        child - the TestElement to be added
        Returns:
        true if the child was added
      • fireIterEvents

        protected void fireIterEvents()
      • fireIterationStart

        protected void fireIterationStart()
      • getIterCount

        protected int getIterCount()
      • incrementIterCount

        protected void incrementIterCount()
      • resetIterCount

        protected void resetIterCount()
      • readResolve

        protected Object readResolve()