Apache JMeter

org.apache.jmeter.threads
Class JMeterContext

java.lang.Object
  extended by org.apache.jmeter.threads.JMeterContext

public class JMeterContext
extends Object

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
 void cleanAfterSample()
          Clean cached data after sample
 void clear()
           
 Sampler getCurrentSampler()
           
 StandardJMeterEngine getEngine()
           
 SampleResult getPreviousResult()
           
 Sampler getPreviousSampler()
          Returns the previousSampler.
 Map<String,Object> getSamplerContext()
          Sampler context is cleaned up as soon as Post-Processor have ended
 JMeterThread getThread()
           
 AbstractThreadGroup getThreadGroup()
           
 int getThreadNum()
          Returns the threadNum.
 JMeterVariables getVariables()
          Gives access to the JMeter variables for the current thread.
 boolean isReinitializingSubControllers()
           
 boolean isRestartNextLoop()
          a restart of the loop was required ?
 boolean isSamplingStarted()
           
 void setCurrentSampler(Sampler sampler)
           
 void setEngine(StandardJMeterEngine engine)
           
 boolean setIsReinitializingSubControllers()
          Set flag indicating listeners should not be notified since reinit of sub controllers is being done.
 void setPreviousResult(SampleResult result)
           
 void setRestartNextLoop(boolean restartNextLoop)
          if set to true a restart of the loop will occurs
 void setSamplingStarted(boolean b)
           
 void setThread(JMeterThread thread)
           
 void setThreadGroup(AbstractThreadGroup threadgrp)
           
 void setThreadNum(int threadNum)
          Sets the threadNum.
 void setVariables(JMeterVariables vars)
           
 void unsetIsReinitializingSubControllers()
          Reset flag indicating listeners should not be notified since reinit of sub controllers is being done.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

clear

public void clear()

getVariables

public JMeterVariables getVariables()
Gives access to the JMeter variables for the current thread.

Returns:
a pointer to the JMeter variables.

setVariables

public void setVariables(JMeterVariables vars)

getPreviousResult

public SampleResult getPreviousResult()

setPreviousResult

public void setPreviousResult(SampleResult result)

getCurrentSampler

public Sampler getCurrentSampler()

setCurrentSampler

public void setCurrentSampler(Sampler sampler)

getPreviousSampler

public Sampler 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

public JMeterThread getThread()

setThread

public void setThread(JMeterThread thread)

getThreadGroup

public AbstractThreadGroup getThreadGroup()

setThreadGroup

public void setThreadGroup(AbstractThreadGroup threadgrp)

getEngine

public StandardJMeterEngine getEngine()

setEngine

public void setEngine(StandardJMeterEngine engine)

isSamplingStarted

public boolean isSamplingStarted()

setSamplingStarted

public void setSamplingStarted(boolean b)

unsetIsReinitializingSubControllers

public void unsetIsReinitializingSubControllers()
Reset flag indicating listeners should not be notified since reinit of sub controllers is being done. See bug 50032


setIsReinitializingSubControllers

public boolean setIsReinitializingSubControllers()
Set flag indicating listeners should not be notified since reinit of sub controllers is being done. See bug 50032

Returns:
true if it is the first one to set

isReinitializingSubControllers

public boolean isReinitializingSubControllers()
Returns:
true if within reinit of Sub Controllers

setRestartNextLoop

public void setRestartNextLoop(boolean restartNextLoop)
if set to true a restart of the loop will occurs

Parameters:
restartNextLoop -

isRestartNextLoop

public boolean isRestartNextLoop()
a restart of the loop was required ?

Returns:
the restartNextLoop

cleanAfterSample

public void cleanAfterSample()
Clean cached data after sample


getSamplerContext

public 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

Apache JMeter

Copyright © 1998-2013 Apache Software Foundation. All Rights Reserved.