public abstract class AgentThread extends Thread
Modifier and Type | Class and Description |
---|---|
static class |
AgentThread.RunState
The various run states for an
AgentThread . |
Thread.State, Thread.UncaughtExceptionHandler
Modifier and Type | Field and Description |
---|---|
static long |
TIME_NOT_SET
Constant value for specifying that the time is not set.
|
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
Constructor and Description |
---|
AgentThread() |
Modifier and Type | Method and Description |
---|---|
static AgentThread |
getInstance(String type,
String agentId,
int id,
Class<?> driverClass,
Timer timer,
AgentImpl agent)
Factory method for instantiating the right type of AgentThread.
|
Metrics |
getResult()
Return results of this thread.
|
AgentThread.RunState |
getThreadState()
Obtains the state of the current thread.
|
void |
run()
Entry point for starting the thread.
|
void |
stopExecution()
Triggers stopping and exiting of this thread.
|
void |
waitThreadState(AgentThread.RunState state)
Waits for a given state of the thread to arrive.
|
activeCount, checkAccess, clone, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yield
public static final long TIME_NOT_SET
public static AgentThread getInstance(String type, String agentId, int id, Class<?> driverClass, Timer timer, AgentImpl agent)
type
- The type of this agentagentId
- The display id of this agentid
- The id of this agentdriverClass
- The driver classtimer
- The timer object referenceagent
- The agent calling this threadpublic final void run()
public AgentThread.RunState getThreadState()
public void waitThreadState(AgentThread.RunState state)
state
- The state to wait for.public Metrics getResult()
public void stopExecution()