public class CriticalSectionController extends GenericController implements ThreadListener, TestStateListener
In a programming world - this is equivalent of :
try { named_lock.lock(); statements .... } finally { named_lock.unlock(); }In JMeter you may have :
Thread-Group (set to loop a number of times or indefinitely, ... Samplers ... (e.g. Counter ) ... Other Controllers .... ... CriticalSectionController ( lock name like "foobar" ) ... statements to perform when lock acquired ... ... Other Controllers /Samplers }
current, subControllersAndSamplers
COMMENTS, ENABLED, GUI_CLASS, NAME, TEST_CLASS
Constructor and Description |
---|
CriticalSectionController()
constructor
|
CriticalSectionController(String name)
constructor
|
Modifier and Type | Method and Description |
---|---|
String |
getLockName() |
Sampler |
next()
Determines the next sampler to be processed.
|
protected void |
reInitialize()
Called after execution of last child of the controller We release lock
|
void |
setLockName(String name)
Condition Accessor - this is gonna be any string value
|
void |
testEnded()
Called once for all threads after the end of a test.
|
void |
testEnded(String host)
Called once for all threads after the end of a test.
|
void |
testStarted()
Called just before the start of the test from the main engine thread.
|
void |
testStarted(String host)
Called just before the start of the test from the main engine thread.
|
void |
threadFinished()
Called for each thread after all samples have been processed.
|
void |
threadStarted()
Called for each thread before starting sampling.
|
addIterationListener, addTestElement, addTestElementOnce, currentReturnedNull, fireIterationStart, fireIterEvents, getCurrentElement, getIterCount, getSubControllers, incrementCurrent, incrementIterCount, initialize, initializeSubControllers, isDone, isFirst, nextIsAController, nextIsASampler, nextIsNull, readResolve, removeCurrentElement, removeIterationListener, resetCurrent, resetIterCount, setCurrentElement, setDone, setFirst, triggerEndOfLoop
addPropertiesValues, addProperty, addProperty, canRemove, clear, clearTemporary, clearTestElementChildren, clone, emptyTemporary, equals, getComment, getName, getProperty, getPropertyAsBoolean, getPropertyAsBoolean, getPropertyAsDouble, getPropertyAsFloat, getPropertyAsInt, getPropertyAsInt, getPropertyAsLong, getPropertyAsLong, getPropertyAsString, getPropertyAsString, getSearchableTokens, getThreadContext, getThreadName, hashCode, isEnabled, isRunningVersion, isTemporary, logProperties, mergeIn, propertyIterator, recoverRunningVersion, removeProperty, setComment, setEnabled, setName, setProperty, setProperty, setProperty, setProperty, setProperty, setProperty, setProperty, setProperty, setProperty, setRunningVersion, setTemporary, setThreadContext, setThreadName, traverse, traverseCollection, traverseMap, traverseProperty
finalize, getClass, notify, notifyAll, toString, wait, wait, wait
canRemove, clear, clearTestElementChildren, clone, getComment, getName, getProperty, getPropertyAsBoolean, getPropertyAsBoolean, getPropertyAsDouble, getPropertyAsFloat, getPropertyAsInt, getPropertyAsInt, getPropertyAsLong, getPropertyAsLong, getPropertyAsString, getPropertyAsString, getThreadContext, getThreadName, isEnabled, isRunningVersion, isTemporary, propertyIterator, recoverRunningVersion, removed, removeProperty, setComment, setEnabled, setName, setProperty, setProperty, setProperty, setProperty, setProperty, setProperty, setProperty, setProperty, setProperty, setRunningVersion, setTemporary, setThreadContext, setThreadName, traverse
public CriticalSectionController()
public CriticalSectionController(String name)
name
- The name of this controllerpublic void setLockName(String name)
name
- The name of the lock for this controllerpublic String getLockName()
public Sampler next()
GenericController
Determines the next sampler to be processed.
If GenericController.isDone()
is true
, returns null.
Gets the list element using current pointer.
If this is null
, calls GenericController.nextIsNull()
.
If the list element is a Sampler
, calls GenericController.nextIsASampler(Sampler)
,
otherwise calls GenericController.nextIsAController(Controller)
If any of the called methods throws NextIsNullException
, returns null
,
otherwise the value obtained above is returned.
next
in interface Controller
next
in class GenericController
null
Controller.next()
protected void reInitialize()
reInitialize
in class GenericController
GenericController.reInitialize()
public void threadStarted()
ThreadListener
threadStarted
in interface ThreadListener
public void threadFinished()
ThreadListener
threadFinished
in interface ThreadListener
public void testStarted()
TestStateListener
Called just before the start of the test from the main engine thread. This is before the test elements are cloned. Note that not all the test variables will have been set up at this point.
N.B. testStarted() and testEnded() are called from different threads.
testStarted
in interface TestStateListener
StandardJMeterEngine.run()
public void testStarted(String host)
TestStateListener
Called just before the start of the test from the main engine thread. This is before the test elements are cloned. Note that not all the test variables will have been set up at this point.
N.B. testStarted() and testEnded() are called from different threads.
testStarted
in interface TestStateListener
host
- name of hostStandardJMeterEngine.run()
public void testEnded()
TestStateListener
Called once for all threads after the end of a test. This will use the same element instances as at the start of the test.
N.B. testStarted() and testEnded() are called from different threads.
testEnded
in interface TestStateListener
StandardJMeterEngine.stopTest()
public void testEnded(String host)
TestStateListener
Called once for all threads after the end of a test. This will use the same element instances as at the start of the test.
N.B. testStarted() and testEnded() are called from different threads.
testEnded
in interface TestStateListener
host
- name of hostStandardJMeterEngine.stopTest()
Copyright © 1998-2019 Apache Software Foundation. All Rights Reserved.