|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectjava.lang.Thread
com.sun.slamd.job.JobClass
com.sun.slamd.scripting.BSFJobClass
public class BSFJobClass
This class implements a SLAMD job that executes a Script file to generate load. It implements the standard SLAMD job methods and adds three new methods to allow the job to be referenced from the Script file.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class java.lang.Thread |
|---|
java.lang.Thread.State, java.lang.Thread.UncaughtExceptionHandler |
| Field Summary | |
|---|---|
static java.lang.String |
ENGINE_CLASS_PARAMETER_NAME
The name of the job parameter that defines the script file to use. |
static java.lang.String |
FILE_PATH_PARAMETER_NAME
The name of the job parameter that defines the script file to use. |
static java.lang.String |
NUMBER_OF_CLIENTS_PARAMETER_NAME
The name of the job parameter that defines the number of clients running this job. |
static java.lang.String |
SCRIPT_ARGUMENTS_PARAMETER_NAME
The name of the job parameter that allows the user to pass arguments to the script. |
static java.lang.String |
SCRIPT_EXTENSION_PARAMETER_NAME
The name of the job parameter that defines the script file to use. |
static java.lang.String |
SCRIPT_LANGUAGE_PARAMETER_NAME
The name of the job parameter that defines the script file to use. |
| Fields inherited from class java.lang.Thread |
|---|
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY |
| Constructor Summary | |
|---|---|
BSFJobClass()
Creates a new instance of this job thread. |
|
| Method Summary | |
|---|---|
void |
destroy()
Provides a means for destroying this job thread if it does not respond to a graceful shutdown request. |
java.lang.String |
getArgument(java.lang.String argName)
Retrieves the value from a specified job argument |
java.lang.String |
getArgument(java.lang.String argName,
java.lang.String defaultValue)
Retrieves the value from a specified job argument |
java.lang.String |
getJobCategoryName()
Retrieves the name of the category in which this job class exists. |
java.lang.String |
getJobDescription()
Retrieves a description of the job performed by this job thread. |
java.lang.String |
getJobName()
Retrieves the name of the job performed by this job thread. |
ParameterList |
getParameterStubs()
Retrieves a list of parameter "stubs" that should be used to indicate which parameters should be passed to the initialize method. |
StatTracker[] |
getStatTrackers()
Retrieves the stat trackers that are maintained for this job thread. |
StatTracker[] |
getStatTrackerStubs(java.lang.String clientID,
java.lang.String threadID,
int collectionInterval)
Retrieves the set of stat trackers that will be maintained by this job class. |
void |
initializeClient(java.lang.String clientID,
ParameterList parameters)
Performs initialization for this job on each client immediately before each thread is created to actually run the job. |
void |
initializeThread(java.lang.String clientID,
java.lang.String threadID,
int collectionInterval,
ParameterList parameters)
Initializes this job thread to be used to actually run the job on the client. |
StatTracker |
initializeTracker(StatTracker theTracker,
java.lang.String displayName)
Initializes a StatTracker created in the Script file. |
void |
runJob()
The method that does all the real work for this job. |
void |
validateJobInfo(int numClients,
int threadsPerClient,
int threadStartupDelay,
java.util.Date startTime,
java.util.Date stopTime,
int duration,
int collectionInterval,
ParameterList parameters)
Provides a means of validating the information used to schedule the job, including the scheduling information and list of parameters. |
| Methods inherited from class java.lang.Thread |
|---|
activeCount, checkAccess, countStackFrames, currentThread, 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 |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final java.lang.String SCRIPT_LANGUAGE_PARAMETER_NAME
public static final java.lang.String SCRIPT_EXTENSION_PARAMETER_NAME
public static final java.lang.String ENGINE_CLASS_PARAMETER_NAME
public static final java.lang.String FILE_PATH_PARAMETER_NAME
public static final java.lang.String SCRIPT_ARGUMENTS_PARAMETER_NAME
public static final java.lang.String NUMBER_OF_CLIENTS_PARAMETER_NAME
| Constructor Detail |
|---|
public BSFJobClass()
| Method Detail |
|---|
public void destroy()
destroy in class JobClasspublic java.lang.String getJobName()
getJobName in class JobClasspublic java.lang.String getJobDescription()
getJobDescription in class JobClasspublic java.lang.String getJobCategoryName()
getJobCategoryName in class JobClasspublic ParameterList getParameterStubs()
getParameterStubs in class JobClass
public StatTracker[] getStatTrackerStubs(java.lang.String clientID,
java.lang.String threadID,
int collectionInterval)
getStatTrackerStubs in class JobClassclientID - The client ID that should be used for the
returned stat trackers.threadID - The thread ID that should be used for the
returned stat trackers.collectionInterval - The collection interval that should be used for
the returned stat trackers.
public StatTracker[] getStatTrackers()
getStatTrackers in class JobClass
public void validateJobInfo(int numClients,
int threadsPerClient,
int threadStartupDelay,
java.util.Date startTime,
java.util.Date stopTime,
int duration,
int collectionInterval,
ParameterList parameters)
throws InvalidValueException
validateJobInfo in class JobClassnumClients - The number of clients that should be used to
run the job.threadsPerClient - The number of threads that should be created on
each client to run the job.threadStartupDelay - The delay in milliseconds that should be used
when starting the client threads.startTime - The time that the job should start running.stopTime - The time that the job should stop running.duration - The maximum length of time in seconds that the
job should be allowed to run.collectionInterval - The collection interval that should be used
when gathering statistics for the job.parameters - The set of parameters provided to this job that
can be used to customize its behavior.
InvalidValueException - If the provided information is not
appropriate for running this job.
public void initializeClient(java.lang.String clientID,
ParameterList parameters)
throws UnableToRunException
initializeClient in class JobClassclientID - The ID assigned to the client running this job.parameters - The set of parameters provided to this job that can be
used to customize its behavior.
UnableToRunException - If the client initialization could not be
completed successfully and the job is unable
to run.
public void initializeThread(java.lang.String clientID,
java.lang.String threadID,
int collectionInterval,
ParameterList parameters)
throws UnableToRunException
initializeThread in class JobClassclientID - The client ID for this job thread.threadID - The thread ID for this job thread.collectionInterval - The length of time in seconds to use as the
statistics collection interval.parameters - The set of parameters provided to this job that
can be used to customize its behavior.
UnableToRunException - If the thread initialization could not be
completed successfully and the job is unable
to run.public void runJob()
initialize method.
runJob in class JobClass
public StatTracker initializeTracker(StatTracker theTracker,
java.lang.String displayName)
theTracker - The StatTracker class.displayName - The StatTracker's display name.
public java.lang.String getArgument(java.lang.String argName,
java.lang.String defaultValue)
argName - The name of the argument to retrieve.defaultValue - The default value if one is not in the Hashtable.
public java.lang.String getArgument(java.lang.String argName)
argName - The name of the argument to retrieve.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||