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.
The class is not thread-safe - it is only intended for use within a single thread.
- 
Nested Class SummaryNested Classes
- 
Method SummaryModifier and TypeMethodDescriptionvoidClean cached data after sample Internally called by JMeter, never call it directlyvoidclear()Internally called by JMeter, never call it directlyReturns the previousSampler.Sampler context is cleaned up as soon as Post-Processor have endedintGives access to the JMeter variables for the current thread.booleanbooleanDeprecated.booleanbooleanDeprecated.voidsetCurrentSampler(Sampler sampler) Internally called by JMeter, never call it directlyvoidsetEngine(StandardJMeterEngine engine) Internally called by JMeter, never call it directlyvoidsetPreviousResult(SampleResult result) Internally called by JMeter, never call it directlyvoidsetRecording(boolean recording) Internally called by JMeter, never call it directlyvoidsetRestartNextLoop(boolean restartNextLoop) Deprecated.voidsetSamplingStarted(boolean b) Internally called by JMeter, never call it directlyvoidsetStartNextThreadLoop(boolean restartNextLoop) Deprecated.voidsetTestLogicalAction(JMeterContext.TestLogicalAction actionOnExecution) voidsetThread(JMeterThread thread) Internally called by JMeter, never call it directlyvoidsetThreadGroup(AbstractThreadGroup threadgrp) Internally called by JMeter, never call it directlyvoidsetThreadNum(int threadNum) Internally called by JMeter, never call it directlyvoidsetVariables(JMeterVariables vars) Internally called by JMeter, never call it directly
- 
Method Details- 
clearpublic void clear()Internally called by JMeter, never call it directly
- 
getVariablesGives access to the JMeter variables for the current thread.- Returns:
- a pointer to the JMeter variables.
 
- 
getProperties- Returns:
- a pointer to the JMeter Properties.
 
- 
setVariablesInternally called by JMeter, never call it directly- Parameters:
- vars- JMeterVariables
 
- 
getPreviousResult
- 
setPreviousResultInternally called by JMeter, never call it directly- Parameters:
- result- SampleResult
 
- 
getCurrentSampler
- 
setCurrentSamplerInternally called by JMeter, never call it directly- Parameters:
- sampler- Sampler
 
- 
getPreviousSamplerReturns the previousSampler.- Returns:
- Sampler
 
- 
getThreadNumpublic int getThreadNum()- Returns:
- the threadNum starting from zero (0)
 
- 
setThreadNumpublic void setThreadNum(int threadNum) Internally called by JMeter, never call it directly- Parameters:
- threadNum- number of threads
 
- 
getThread
- 
setThreadInternally called by JMeter, never call it directly- Parameters:
- thread- to use
 
- 
getThreadGroup
- 
setThreadGroupInternally called by JMeter, never call it directly- Parameters:
- threadgrp- ThreadGroup to use
 
- 
getEngine
- 
setEngineInternally called by JMeter, never call it directly- Parameters:
- engine- to use
 
- 
isSamplingStartedpublic boolean isSamplingStarted()
- 
setSamplingStartedpublic void setSamplingStarted(boolean b) Internally called by JMeter, never call it directly- Parameters:
- b- flag whether sampling has started
 
- 
setTestLogicalAction- Parameters:
- actionOnExecution- action to take for next iteration of current loop in which this component is present
 
- 
getTestLogicalAction- Returns:
- TestLogicalAction to start next iteration of current loop in which this component is present
 
- 
setStartNextThreadLoopDeprecated.- Parameters:
- restartNextLoop- if set to- truea restart of the loop will occur
 
- 
isStartNextThreadLoopDeprecated.- Returns:
- truewhen current loop iteration of Thread Group will be interrupted and JMeter will go to next iteration of the Thread Group loop
 
- 
setRestartNextLoopDeprecated.if set totruecurrent loop iteration will be interrupted and JMeter will go to next iteration- Parameters:
- restartNextLoop- flag whether to restart
 
- 
isRestartNextLoopDeprecated.- Returns:
- flag whether restart is set
 
- 
cleanAfterSamplepublic void cleanAfterSample()Clean cached data after sample Internally called by JMeter, never call it directly
- 
getSamplerContextSampler context is cleaned up as soon as Post-Processor have ended- Returns:
- Context to use within PostProcessors to cache data
 
- 
setRecordingpublic void setRecording(boolean recording) Internally called by JMeter, never call it directly- Parameters:
- recording- flag whether recording should be done
 
- 
isRecordingpublic boolean isRecording()
 
- 
isStartNextThreadLoop()