Package org.apache.jmeter.control
Class CriticalSectionController
-
- 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.testelement.TestStateListener,org.apache.jmeter.testelement.ThreadListener,org.apache.jmeter.threads.TestCompilerHelper
public class CriticalSectionController extends GenericController implements ThreadListener, TestStateListenerThis is a Critical Section Controller; it will execute the set of statements (samplers/controllers, etc) under named lock.
In a programming world - this is equivalent of :
In JMeter you may have :try { named_lock.lock(); statements .... } finally { named_lock.unlock(); }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 }- Since:
2.12
-
-
Field Summary
Fields Modifier and Type Field Description public transient JMeterContextthreadContextpublic transient StringthreadNamepublic final static TestElement.CompanionCompanionpublic final static StringNAMEpublic final static StringGUI_CLASSpublic final static StringENABLEDpublic final static StringTEST_CLASSpublic final static StringCOMMENTS
-
Constructor Summary
Constructors Constructor Description CriticalSectionController()constructor CriticalSectionController(String name)constructor
-
Method Summary
Modifier and Type Method Description voidsetLockName(String name)Condition Accessor - this is gonna be any string value StringgetLockName()Samplernext()voidthreadStarted()voidthreadFinished()voidtestStarted()voidtestStarted(String host)voidtestEnded()voidtestEnded(String host)-
Methods inherited from class org.apache.jmeter.testelement.AbstractTestElement
canRemove, clear, clearTestElementChildren, clone, equals, getComment, getName, getProperty, getPropertyAsBoolean, getPropertyAsDouble, getPropertyAsFloat, getPropertyAsInt, getPropertyAsLong, getPropertyAsString, getPropertyOrNull, getSearchableTokens, getThreadContext, getThreadName, hashCode, isEnabled, isRunningVersion, isTemporary, propertyIterator, recoverRunningVersion, removeProperty, setComment, setEnabled, setName, setProperty, setRunningVersion, setTemporary, setThreadContext, setThreadName, traverse -
Methods inherited from class org.apache.jmeter.control.GenericController
addIterationListener, addTestElement, addTestElementOnce, getProps, getSchema, initialize, isDone, removeIterationListener, setFirst, triggerEndOfLoop -
Methods inherited from class org.apache.jmeter.testelement.TestElement
get, get, get, get, get, get, get, get, get, getOrCreate, getOrCreate, getOrNull, getOrNull, getOrNull, getProps, getSchema, getString, removed, set -
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
Constructor Detail
-
CriticalSectionController
CriticalSectionController()
constructor
-
CriticalSectionController
CriticalSectionController(String name)
constructor- Parameters:
name- The name of this controller
-
-
Method Detail
-
setLockName
void setLockName(String name)
Condition Accessor - this is gonna be any string value
- Parameters:
name- The name of the lock for this controller
-
getLockName
String getLockName()
- Returns:
String lock name
-
next
Sampler next()
-
threadStarted
void threadStarted()
-
threadFinished
void threadFinished()
-
testStarted
void testStarted()
-
testStarted
void testStarted(String host)
-
testEnded
void testEnded()
-
-
-
-