Class JMeterContext
-
- All Implemented Interfaces:
public class 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.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public enum
JMeterContext.TestLogicalAction
-
Field Summary
Fields Modifier and Type Field Description public JMeterVariables
variables
public SampleResult
previousResult
public Sampler
currentSampler
public Sampler
previousSampler
public StandardJMeterEngine
engine
public JMeterThread
thread
public AbstractThreadGroup
threadGroup
public int
threadNum
public JMeterContext.TestLogicalAction
testLogicalAction
-
Method Summary
Modifier and Type Method Description JMeterVariables
getVariables()
Gives access to the JMeter variables for the current thread. void
setVariables(JMeterVariables vars)
Internally called by JMeter, never call it directly SampleResult
getPreviousResult()
void
setPreviousResult(SampleResult result)
Internally called by JMeter, never call it directly Sampler
getCurrentSampler()
void
setCurrentSampler(Sampler sampler)
Internally called by JMeter, never call it directly Sampler
getPreviousSampler()
Returns the previousSampler. StandardJMeterEngine
getEngine()
void
setEngine(StandardJMeterEngine engine)
Internally called by JMeter, never call it directly JMeterThread
getThread()
void
setThread(JMeterThread thread)
Internally called by JMeter, never call it directly AbstractThreadGroup
getThreadGroup()
void
setThreadGroup(AbstractThreadGroup threadgrp)
Internally called by JMeter, never call it directly int
getThreadNum()
void
setThreadNum(int threadNum)
Internally called by JMeter, never call it directly JMeterContext.TestLogicalAction
getTestLogicalAction()
void
setTestLogicalAction(JMeterContext.TestLogicalAction actionOnExecution)
void
clear()
Internally called by JMeter, never call it directly Properties
getProperties()
boolean
isSamplingStarted()
void
setStartNextThreadLoop(boolean restartNextLoop)
boolean
isStartNextThreadLoop()
void
setRestartNextLoop(boolean restartNextLoop)
if set to true
current loop iteration will be interrupted and JMeter will go to next iterationboolean
isRestartNextLoop()
void
cleanAfterSample()
Clean cached data after sample Internally called by JMeter, never call it directly Map<String, Object>
getSamplerContext()
Sampler context is cleaned up as soon as Post-Processor have ended boolean
isRecording()
void
setSamplingStarted(boolean b)
Internally called by JMeter, never call it directly void
setRecording(boolean recording)
Internally called by JMeter, never call it directly -
-
Method Detail
-
getVariables
JMeterVariables getVariables()
Gives access to the JMeter variables for the current thread.
- Returns:
a pointer to the JMeter variables.
-
setVariables
void setVariables(JMeterVariables vars)
Internally called by JMeter, never call it directly
- Parameters:
vars
- JMeterVariables
-
getPreviousResult
SampleResult getPreviousResult()
-
setPreviousResult
void setPreviousResult(SampleResult result)
Internally called by JMeter, never call it directly
- Parameters:
result
- SampleResult
-
getCurrentSampler
Sampler getCurrentSampler()
-
setCurrentSampler
void setCurrentSampler(Sampler sampler)
Internally called by JMeter, never call it directly
- Parameters:
sampler
- Sampler
-
getPreviousSampler
Sampler getPreviousSampler()
Returns the previousSampler.
- Returns:
Sampler
-
getEngine
StandardJMeterEngine getEngine()
-
setEngine
void setEngine(StandardJMeterEngine engine)
Internally called by JMeter, never call it directly
- Parameters:
engine
- to use
-
getThread
JMeterThread getThread()
-
setThread
void setThread(JMeterThread thread)
Internally called by JMeter, never call it directly
- Parameters:
thread
- to use
-
getThreadGroup
AbstractThreadGroup getThreadGroup()
-
setThreadGroup
void setThreadGroup(AbstractThreadGroup threadgrp)
Internally called by JMeter, never call it directly
- Parameters:
threadgrp
- ThreadGroup to use
-
getThreadNum
int getThreadNum()
- Returns:
the threadNum starting from zero (0)
-
setThreadNum
void setThreadNum(int threadNum)
Internally called by JMeter, never call it directly
- Parameters:
threadNum
- number of threads
-
getTestLogicalAction
JMeterContext.TestLogicalAction getTestLogicalAction()
- Returns:
TestLogicalAction to start next iteration of current loop in which this component is present
-
setTestLogicalAction
void setTestLogicalAction(JMeterContext.TestLogicalAction actionOnExecution)
- Parameters:
actionOnExecution
- action to take for next iteration of current loop in which this component is present
-
clear
void clear()
Internally called by JMeter, never call it directly
-
getProperties
Properties getProperties()
- Returns:
a pointer to the JMeter Properties.
-
isSamplingStarted
boolean isSamplingStarted()
-
setStartNextThreadLoop
@Deprecated() void setStartNextThreadLoop(boolean restartNextLoop)
- Parameters:
restartNextLoop
- if set totrue
a restart of the loop will occur
-
isStartNextThreadLoop
@Deprecated() boolean isStartNextThreadLoop()
- Returns:
true
when current loop iteration of Thread Group will be interrupted and JMeter will go to next iteration of the Thread Group loop
-
setRestartNextLoop
@Deprecated() void setRestartNextLoop(boolean restartNextLoop)
if set to
true
current loop iteration will be interrupted and JMeter will go to next iteration- Parameters:
restartNextLoop
- flag whether to restart
-
isRestartNextLoop
@Deprecated() boolean isRestartNextLoop()
- Returns:
flag whether restart is set
-
cleanAfterSample
void cleanAfterSample()
Clean cached data after sample Internally called by JMeter, never call it directly
-
getSamplerContext
Map<String, Object> getSamplerContext()
Sampler context is cleaned up as soon as Post-Processor have ended
- Returns:
Context to use within PostProcessors to cache data
-
isRecording
boolean isRecording()
-
setSamplingStarted
void setSamplingStarted(boolean b)
Internally called by JMeter, never call it directly
- Parameters:
b
- flag whether sampling has started
-
setRecording
void setRecording(boolean recording)
Internally called by JMeter, never call it directly
- Parameters:
recording
- flag whether recording should be done
-
-
-
-