This class is the basis for all the controllers.
It also implements SimpleController.
The main entry point is next(), which is called by by JMeterThread as follows:
while (running && (sampler = controller.next()) != null)
currentReturnedNull
protected void currentReturnedNull(Controller c)
If the controller is done, remove it from the list,
otherwise increment to next entry in list.
fireIterEvents
protected void fireIterEvents()
fireIterationStart
protected void fireIterationStart()
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.
- the current element - or null if current index too large
getIterCount
protected int getIterCount()
getSubControllers
protected List getSubControllers()
Gets the SubControllers attribute of the GenericController object
incrementCurrent
protected void incrementCurrent()
Increments the current pointer; called by currentReturnedNull to move the
controller on to its next child.
incrementIterCount
protected void incrementIterCount()
isFirst
protected boolean isFirst()
next
public Sampler next()
Determines the next sampler to be processed.
If isDone, returns null.
Gets the list element using current pointer.
If this is null, calls
nextIsNull()
.
If the list element is a sampler, calls
nextIsASampler(Sampler)
,
otherwise calls
nextIsAController(Controller)
If any of the called methods throws NextIsNullException, returns null,
otherwise the value obtained above is returned.
- next in interface Controller
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().
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).
nextIsNull
protected Sampler nextIsNull()
throws NextIsNullException
Called by next() when getCurrentElement() returns null.
Reinitialises the controller.
- null (always, for this class)
reInitialize
protected void reInitialize()
Resets the controller:
- resetCurrent() (i.e. current=0)
- increment iteration count
- sets first=true
- recoverRunningVersion() to set the controller back to the initial state
removeCurrentElement
protected void removeCurrentElement()
resetCurrent
protected void resetCurrent()
resetIterCount
protected void resetIterCount()
setDone
protected void setDone(boolean done)
setFirst
public void setFirst(boolean b)