Package org.apache.jmeter.threads
Class JMeterContext
java.lang.Object
org.apache.jmeter.threads.JMeterContext
Holds context for a thread.
Generated by JMeterContextService.
The class is not thread-safe - it is only intended for use within a single thread.
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Clean cached data after samplevoid
clear()
Returns the previousSampler.Sampler context is cleaned up as soon as Post-Processor have endedint
Returns the threadNum.Gives access to the JMeter variables for the current thread.boolean
a restart of the loop was required ?boolean
void
setCurrentSampler
(Sampler sampler) void
setEngine
(StandardJMeterEngine engine) void
setPreviousResult
(SampleResult result) void
setRestartNextLoop
(boolean restartNextLoop) if set totrue
a restart of the loop will occursvoid
setSamplingStarted
(boolean b) void
setThread
(JMeterThread thread) void
setThreadGroup
(AbstractThreadGroup threadgrp) void
setThreadNum
(int threadNum) Sets the threadNum.void
setVariables
(JMeterVariables vars)
-
Method Details
-
clear
public void clear() -
getVariables
Gives access to the JMeter variables for the current thread.- Returns:
- a pointer to the JMeter variables.
-
setVariables
-
getPreviousResult
-
setPreviousResult
-
getCurrentSampler
-
setCurrentSampler
-
getPreviousSampler
Returns the previousSampler.- Returns:
- Sampler
-
getThreadNum
public int getThreadNum()Returns the threadNum.- Returns:
- int
-
setThreadNum
public void setThreadNum(int threadNum) Sets the threadNum.- Parameters:
threadNum
- the threadNum to set
-
getThread
-
setThread
-
getThreadGroup
-
setThreadGroup
-
getEngine
-
setEngine
-
isSamplingStarted
public boolean isSamplingStarted() -
setSamplingStarted
public void setSamplingStarted(boolean b) -
setRestartNextLoop
public void setRestartNextLoop(boolean restartNextLoop) if set totrue
a restart of the loop will occurs- Parameters:
restartNextLoop
- flag whether restart will occur
-
isRestartNextLoop
public boolean isRestartNextLoop()a restart of the loop was required ?- Returns:
- the restartNextLoop
-
cleanAfterSample
public void cleanAfterSample()Clean cached data after sample -
getSamplerContext
Sampler context is cleaned up as soon as Post-Processor have ended- Returns:
- Context to use within PostProcessors to cache data
-