org.apache.jmeter.threads

Class JMeterThread

Implemented Interfaces:
Runnable, Interruptible

public class JMeterThread
extends Object
implements Runnable, Interruptible

The JMeter interface to the sampling process, allowing JMeter to see the timing, add listeners for sampling events and to stop the sampling process.

Field Summary

static String
LAST_SAMPLE_OK
static String
PACKAGE_OBJECT

Constructor Summary

JMeterThread(HashTree test, JMeterThreadMonitor monitor, ListenerNotifier note)

Method Summary

long
getEndTime()
Get the end time value.
long
getStartTime()
Get the start time value.
String
getThreadName()
int
getThreadNum()
Returns the threadNum.
boolean
interrupt()
void
run()
void
setEndTime(long etime)
Set the EndTime for this Thread.
void
setEngine(StandardJMeterEngine engine)
Save the engine instance for access to the stop methods
void
setInitialContext(JMeterContext context)
void
setInitialDelay(int delay)
void
setOnErrorStopTest(boolean b)
Should Test stop on sampler error?
void
setOnErrorStopTestNow(boolean b)
Should Test stop abruptly on sampler error?
void
setOnErrorStopThread(boolean b)
Should Thread stop on Sampler error?
void
setScheduled(boolean sche)
Enable the scheduler for this JMeterThread.
void
setStartTime(long stime)
Set the StartTime for this Thread.
void
setThreadGroup(ThreadGroup group)
void
setThreadName(String threadName)
void
setThreadNum(int threadNum)
Sets the threadNum.
void
stop()

Field Details

LAST_SAMPLE_OK

public static final String LAST_SAMPLE_OK

PACKAGE_OBJECT

public static final String PACKAGE_OBJECT

Constructor Details

JMeterThread

public JMeterThread(HashTree test,
                    JMeterThreadMonitor monitor,
                    ListenerNotifier note)

Method Details

getEndTime

public long getEndTime()
Get the end time value.
Returns:
the end time value.

getStartTime

public long getStartTime()
Get the start time value.
Returns:
the start time value.

getThreadName

public String getThreadName()

getThreadNum

public int getThreadNum()
Returns the threadNum.

interrupt

public boolean interrupt()
Specified by:
interrupt in interface Interruptible

run

public void run()

setEndTime

public void setEndTime(long etime)
Set the EndTime for this Thread.
Parameters:
etime - the EndTime value.

setEngine

public void setEngine(StandardJMeterEngine engine)
Save the engine instance for access to the stop methods
Parameters:
engine -

setInitialContext

public void setInitialContext(JMeterContext context)

setInitialDelay

public void setInitialDelay(int delay)

setOnErrorStopTest

public void setOnErrorStopTest(boolean b)
Should Test stop on sampler error?
Parameters:
b - - true or false

setOnErrorStopTestNow

public void setOnErrorStopTestNow(boolean b)
Should Test stop abruptly on sampler error?
Parameters:
b - - true or false

setOnErrorStopThread

public void setOnErrorStopThread(boolean b)
Should Thread stop on Sampler error?
Parameters:
b - - true or false

setScheduled

public void setScheduled(boolean sche)
Enable the scheduler for this JMeterThread.

setStartTime

public void setStartTime(long stime)
Set the StartTime for this Thread.
Parameters:
stime - the StartTime value.

setThreadGroup

public void setThreadGroup(ThreadGroup group)

setThreadName

public void setThreadName(String threadName)

setThreadNum

public void setThreadNum(int threadNum)
Sets the threadNum.
Parameters:
threadNum - the threadNum to set

stop

public void stop()

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