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)
-
-
Field Summary
Fields Modifier and Type Field Description private transient boolean
runningVersion
public transient JMeterContext
threadContext
public transient String
threadName
public final static TestElement.Companion
Companion
public final static String
NAME
public final static String
GUI_CLASS
public final static String
ENABLED
public final static String
TEST_CLASS
public final static String
COMMENTS
-
Constructor Summary
Constructors Constructor Description GenericController()
Creates a Generic Controller
-
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
-
-
Method Detail
-
getSchema
GenericControllerSchema getSchema()
-
getProps
PropertiesAccessor<out GenericController, out GenericControllerSchema> getProps()
Allows type-safe accessors to the properties of the current element. Note: when overriding the method, ensure you emit wildcards. For instance: JMeterElementInstance<? extends TestPlanClass> getProps() { return ... }
-
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
-
isDone
boolean isDone()
-
triggerEndOfLoop
void triggerEndOfLoop()
Trigger end of loop condition on controller (used by Start Next Loop feature)
-
addTestElement
void addTestElement(TestElement child)
-
addTestElementOnce
final boolean addTestElementOnce(TestElement child)
Add child test element only if it has not already been added.
Only for use by TestCompiler.
-
addIterationListener
void addIterationListener(LoopIterationListener lis)
Controllers have to notify listeners of when they begin an iteration through their sub-elements.
-
removeIterationListener
void removeIterationListener(LoopIterationListener iterationListener)
Remove listener
-
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
-
-
-
-