Class GenericController

  • All Implemented Interfaces:
    java.io.Serializable , java.lang.Cloneable , org.apache.jmeter.control.Controller , org.apache.jmeter.gui.Searchable , org.apache.jmeter.testelement.TestElement , org.apache.jmeter.threads.TestCompilerHelper

    
    public class GenericController
    extends AbstractTestElement implements Controller, Serializable, TestCompilerHelper
                        

    This class is the basis for all the controllers. It also implements SimpleController.

    The main entry point is next(), which is called by JMeterThread as follows:

    while (running && (sampler = controller.next()) != null)

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
    • Constructor Summary

      Constructors 
      Constructor Description
      GenericController() Creates a Generic Controller
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
    • Method Summary

      Modifier and Type Method Description
      GenericControllerSchema getSchema()
      PropertiesAccessor<out GenericController, out GenericControllerSchema> getProps() Allows type-safe accessors to the properties of the current element.
      void initialize() Called to initialize a controller at the beginning of a test iteration.
      Sampler next() Determines the next sampler to be processed.
      boolean isDone()
      void triggerEndOfLoop() Trigger end of loop condition on controller (used by Start Next Loop feature)
      void addTestElement(TestElement child)
      final boolean addTestElementOnce(TestElement child) Add child test element only if it has not already been added.
      void addIterationListener(LoopIterationListener lis) Controllers have to notify listeners of when they begin an iteration through their sub-elements.
      void removeIterationListener(LoopIterationListener iterationListener) Remove listener
      void setFirst(boolean b) If b is true, it means first is reset which means Controller has executed all its children
      • Methods inherited from class org.apache.jmeter.testelement.AbstractTestElement

        canRemove, clear, clearTestElementChildren, clone, equals, getComment, getName, getProperty, getPropertyAsBoolean, getPropertyAsBoolean, getPropertyAsDouble, getPropertyAsFloat, getPropertyAsInt, getPropertyAsInt, getPropertyAsLong, getPropertyAsLong, getPropertyAsString, getPropertyAsString, getPropertyOrNull, getSearchableTokens, getThreadContext, getThreadName, hashCode, isEnabled, isRunningVersion, isTemporary, propertyIterator, recoverRunningVersion, removeProperty, setComment, setEnabled, setName, setProperty, setProperty, setProperty, setProperty, setProperty, setProperty, setProperty, setProperty, setProperty, setRunningVersion, setTemporary, setThreadContext, setThreadName, traverse
      • Methods inherited from class org.apache.jmeter.testelement.TestElement

        canRemove, clear, clearTestElementChildren, clone, get, get, get, get, get, get, get, get, get, getComment, getName, getOrCreate, getOrCreate, getOrNull, getOrNull, getOrNull, getProperty, getPropertyAsBoolean, getPropertyAsDouble, getPropertyAsFloat, getPropertyAsInt, getPropertyAsLong, getPropertyAsString, getPropertyOrNull, getString, isEnabled, isRunningVersion, isTemporary, propertyIterator, recoverRunningVersion, removeProperty, removed, set, setComment, setEnabled, setName, setProperty, setTemporary, traverse
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • GenericController

        GenericController()
        Creates a Generic Controller
    • Method Detail

      • initialize

         void initialize()

        Called to initialize a controller at the beginning of a test iteration.

      • next

         Sampler next()

        Determines the next sampler to be processed.

        If isDone is true, returns null.

        Gets the list element using current pointer. If this is null, calls nextIsNull.

        If the list element is a Sampler, calls nextIsASampler, otherwise calls nextIsAController

        If any of the called methods throws NextIsNullException, returns null, otherwise the value obtained above is returned.

        Returns:

        the next sampler or null

      • triggerEndOfLoop

         void triggerEndOfLoop()

        Trigger end of loop condition on controller (used by Start Next Loop feature)

      • addTestElementOnce

         final boolean addTestElementOnce(TestElement child)

        Add child test element only if it has not already been added.

        Only for use by TestCompiler.

      • setFirst

         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