Class CriticalSectionController
- All Implemented Interfaces:
- Serializable,- Cloneable,- Controller,- Searchable,- org.apache.jmeter.testelement.TestElement,- TestStateListener,- ThreadListener,- TestCompilerHelper
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 }
 - Since:
- 2.12
- See Also:
- 
Nested Class SummaryNested classes/interfaces inherited from interface org.apache.jmeter.testelement.TestElementorg.apache.jmeter.testelement.TestElement.Companion
- 
Field SummaryFields inherited from class org.apache.jmeter.control.GenericControllercurrent, subControllersAndSamplersFields inherited from interface org.apache.jmeter.testelement.TestElementCOMMENTS, Companion, ENABLED, GUI_CLASS, NAME, TEST_CLASS
- 
Constructor SummaryConstructorsConstructorDescriptionconstructorconstructor
- 
Method SummaryModifier and TypeMethodDescriptionnext()Determines the next sampler to be processed.protected voidCalled after execution of last child of the controller We release lockvoidsetLockName(String name) Condition Accessor - this is gonna be any string valuevoidCalled once for all threads after the end of a test.voidCalled once for all threads after the end of a test.voidCalled just before the start of the test from the main engine thread.voidtestStarted(String host) Called just before the start of the test from the main engine thread.voidCalled for each thread after all samples have been processed.voidCalled for each thread before starting sampling.Methods inherited from class org.apache.jmeter.control.GenericControlleraddIterationListener, addTestElement, addTestElementOnce, currentReturnedNull, fireIterationStart, fireIterEvents, getCurrentElement, getIterCount, getProps, getSchema, getSubControllers, incrementCurrent, incrementIterCount, initialize, initializeSubControllers, isDone, isFirst, nextIsAController, nextIsASampler, nextIsNull, readResolve, removeCurrentElement, removeIterationListener, resetCurrent, resetIterCount, setCurrentElement, setDone, setFirst, triggerEndOfLoopMethods inherited from class org.apache.jmeter.testelement.AbstractTestElementaddPropertiesValues, addProperty, addProperty, canRemove, clear, clearTemporary, clearTestElementChildren, clone, emptyTemporary, equals, getComment, getName, getProperty, getPropertyAsBoolean, getPropertyAsBoolean, getPropertyAsDouble, getPropertyAsFloat, getPropertyAsInt, getPropertyAsInt, getPropertyAsLong, getPropertyAsLong, getPropertyAsString, getPropertyAsString, getPropertyOrNull, 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, traversePropertyMethods inherited from class java.lang.Objectfinalize, getClass, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.jmeter.testelement.TestElementcanRemove, clear, clearTestElementChildren, clone, get, get, get, get, get, get, get, get, get, getComment, getName, getOrCreate, getOrCreate, getOrNull, getOrNull, getOrNull, getProperty, getPropertyAsBoolean, getPropertyAsBoolean, getPropertyAsDouble, getPropertyAsFloat, getPropertyAsInt, getPropertyAsInt, getPropertyAsLong, getPropertyAsLong, getPropertyAsString, getPropertyAsString, getPropertyOrNull, getPropertyOrNull, getString, getThreadContext, getThreadName, isEnabled, isRunningVersion, isTemporary, propertyIterator, recoverRunningVersion, removed, removeProperty, removeProperty, set, set, set, set, set, set, set, set, set, setComment, setEnabled, setName, setProperty, setProperty, setProperty, setProperty, setProperty, setProperty, setProperty, setProperty, setProperty, setRunningVersion, setTemporary, setThreadContext, setThreadName, traverse
- 
Constructor Details- 
CriticalSectionControllerpublic CriticalSectionController()constructor
- 
CriticalSectionControllerconstructor- Parameters:
- name- The name of this controller
 
 
- 
- 
Method Details- 
setLockNameCondition Accessor - this is gonna be any string value- Parameters:
- name- The name of the lock for this controller
 
- 
getLockName- Returns:
- String lock name
 
- 
nextDescription copied from class:GenericControllerDetermines the next sampler to be processed. If GenericController.isDone()istrue, returns null.Gets the list element using current pointer. If this is null, callsGenericController.nextIsNull().If the list element is a Sampler, callsGenericController.nextIsASampler(Sampler), otherwise callsGenericController.nextIsAController(Controller)If any of the called methods throws NextIsNullException, returnsnull, otherwise the value obtained above is returned.- Specified by:
- nextin interface- Controller
- Overrides:
- nextin class- GenericController
- Returns:
- the next sampler or null
- See Also:
 
- 
reInitializeprotected void reInitialize()Called after execution of last child of the controller We release lock- Overrides:
- reInitializein class- GenericController
- See Also:
 
- 
threadStartedpublic void threadStarted()Description copied from interface:ThreadListenerCalled for each thread before starting sampling. WARNING: this is called before any Config test elements are processed, so any properties they define will not have been merged in yet. See org.apache.jmeter.threads.JMeterThread#threadStarted()- Specified by:
- threadStartedin interface- ThreadListener
 
- 
threadFinishedpublic void threadFinished()Description copied from interface:ThreadListenerCalled for each thread after all samples have been processed. See org.apache.jmeter.threads.JMeterThread#threadFinished(org.apache.jmeter.engine.event.LoopIterationListener)- Specified by:
- threadFinishedin interface- ThreadListener
 
- 
testStartedpublic void testStarted()Description copied from interface:TestStateListenerCalled 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. - Specified by:
- testStartedin interface- TestStateListener
- See Also:
 
- 
testStartedDescription copied from interface:TestStateListenerCalled 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. - Specified by:
- testStartedin interface- TestStateListener
- Parameters:
- host- name of host
- See Also:
 
- 
testEndedpublic void testEnded()Description copied from interface:TestStateListenerCalled 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. - Specified by:
- testEndedin interface- TestStateListener
- See Also:
 
- 
testEndedDescription copied from interface:TestStateListenerCalled 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. - Specified by:
- testEndedin interface- TestStateListener
- Parameters:
- host- name of host
- See Also:
 
 
-