|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.sun.slamd.client.ClientSideJob
public class ClientSideJob
This class defines a "client-side" job. It is a representation of a job that is held by the client, having no knowledge of anything on the server side). All methods implemented in this class operate on the local version of the job only and have no direct impact on the execution of the job that may be occurring concurrently on other clients.
| Constructor Summary | |
|---|---|
ClientSideJob(ClientMessageWriter messageWriter,
java.lang.String classPath,
java.lang.String jobClass,
int threadsPerClient,
int duration,
int collectionInterval,
ParameterList parameters,
boolean useCustomClassLoader,
boolean enableRealTimeStats,
RealTimeStatReporter statReporter)
Creates a new client-side job that is only to be used as a standalone job (i.e., to run without a server). |
|
ClientSideJob(Client client,
java.lang.String jobID,
java.lang.String jobClass,
int threadsPerClient,
java.util.Date startTime,
java.util.Date stopTime,
int clientNumber,
int duration,
int collectionInterval,
int threadStartupDelay,
ParameterList parameters,
boolean useCustomClassLoader,
boolean enableRealTimeStats,
RealTimeStatReporter statReporter)
Creates a new client-side job with the provided information. |
|
| Method Summary | |
|---|---|
boolean |
enableRealTimeStats()
Indicates whether this job should collect statistical data in real time. |
void |
forcefullyStop(int stopReason)
Attempts to forcefully stop execution of the job by interrupting the thread. |
int |
getActiveThreadCount()
Retrieves the number of threads that are currently active. |
int |
getActualDuration()
Retrieves the total length of time in seconds that the job was running. |
long |
getActualStartTime()
Retrieves the time at which this job actually started running. |
long |
getActualStopTime()
Retrieves the time at which this job actually stopped running. |
int |
getCollectionInterval()
Retrieves the length of time in seconds that should be used as the statistics collection interval. |
int |
getDuration()
Retrieves the maximum length of time in seconds that this job should be allowed to run. |
java.lang.String |
getJobClass()
Retrieves the name of the Java class that should be invoked to run this job. |
java.lang.String |
getJobID()
Retrieves the job ID for this job. |
int |
getJobState()
Retrieves the state of this job. |
java.lang.String[] |
getLogMessages()
Retrieves an array containing all of the messages that have been logged for this job. |
ParameterList |
getParameters()
Retrieves the list of job-specific parameters associated with this job. |
long |
getScheduledStartTime()
Retrieves the time at which this job has been scheduled to start. |
java.util.Date |
getStartTime()
Retrieves the time at which this job should start running. |
RealTimeStatReporter |
getStatReporter()
Retrieves the stat reporter that should be used to report real-time statistical data. |
StatTracker[] |
getStatTrackers(boolean aggregateThreadData)
Retrieves the stat tracker information for this job. |
java.util.Date |
getStopTime()
Retrieves the time at which this job should stop running. |
int |
getThreadsPerClient()
Retrieves the number of threads that should be started on each client running this job. |
boolean |
isDone()
Indicates whether this job has been completed or is otherwise stopped for some reason. |
void |
logMessage(java.lang.String threadID,
java.lang.String message)
Writes a new message from the specified thread into the list of messages to log. |
void |
setJobState(int jobState)
Specifies the job state to use for this job. |
int |
start()
Attempts to start processing on the job. |
int |
startAndWait()
Starts processing on the job and waits until that processing is complete. |
int |
stop(int stopReason)
Attempts to stop processing on the job. |
int |
stopAndWait(int stopReason)
Attempts to stop processing on the job and will not return until the job state indicates that it is no longer running. |
void |
threadDone(JobClass jobThread)
Indicates that the specified thread is no longer running. |
void |
writeVerbose(java.lang.String message)
Writes the provided message to the client message writer using the verbose setting (so the message will not be displayed if the client is not operating in verbose mode). |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public ClientSideJob(Client client,
java.lang.String jobID,
java.lang.String jobClass,
int threadsPerClient,
java.util.Date startTime,
java.util.Date stopTime,
int clientNumber,
int duration,
int collectionInterval,
int threadStartupDelay,
ParameterList parameters,
boolean useCustomClassLoader,
boolean enableRealTimeStats,
RealTimeStatReporter statReporter)
client - The client with which this job is associated.jobID - The job ID for this job.jobClass - The name of the Java class that should be
executed to run this job.threadsPerClient - The number of threads that should be used to
run this job.startTime - The time at which this job is supposed to
start.stopTime - The time at which this job is supposed to
stop.clientNumber - The client number associated with this job.duration - The maximum length of time in seconds that
this job should run.collectionInterval - The length of time in seconds that should be
used for the statistics collection interval.threadStartupDelay - The delay in milliseconds that should be used
when creating the individual client threads.parameters - The list of job-specific parameters that
control how this job should operate.useCustomClassLoader - Indicates whether the custom job class loader
should be used to load job classes.enableRealTimeStats - Indicates whether this job should report
statistics in real-time.statReporter - The stat reporter that should be used to
report real-time statistics.
public ClientSideJob(ClientMessageWriter messageWriter,
java.lang.String classPath,
java.lang.String jobClass,
int threadsPerClient,
int duration,
int collectionInterval,
ParameterList parameters,
boolean useCustomClassLoader,
boolean enableRealTimeStats,
RealTimeStatReporter statReporter)
messageWriter - The message writer that will be used to write
messages regarding the progress of job
execution.classPath - The directory on the filesystem in which job
class files may be found.jobClass - The name of the Java class that should be
used to run this job.threadsPerClient - The number of threads to use to run the job.duration - The maximum length of time in seconds that
the job should be allowed to run.collectionInterval - The length of time in seconds that should be
used for the statistics collection interval.parameters - The list of job-specific parameters that
control how this job should operate.useCustomClassLoader - Indicates whether the custom job class loader
should be used to load job classes.enableRealTimeStats - Indicates whether this job should report
statistics in real-time.statReporter - The stat reporter that should be used to
report real-time statistics.| Method Detail |
|---|
public java.lang.String getJobID()
public java.lang.String getJobClass()
public int getThreadsPerClient()
public java.util.Date getStartTime()
public long getScheduledStartTime()
public long getActualStartTime()
public java.util.Date getStopTime()
public long getActualStopTime()
public int getDuration()
public int getActualDuration()
public int getCollectionInterval()
public boolean enableRealTimeStats()
true if the client should collect statistical data in
real time, or false if not.public RealTimeStatReporter getStatReporter()
null if no reporting should be
done.public ParameterList getParameters()
public int startAndWait()
public int start()
public int stop(int stopReason)
stopReason - The reason that the job is to be stopped.
public int stopAndWait(int stopReason)
stopReason - The reason that the job is to be stopped.
public final void forcefullyStop(int stopReason)
stopReason - The stop reason that should be used for the job.public int getJobState()
public void setJobState(int jobState)
jobState - The job state to use for this job.public int getActiveThreadCount()
public StatTracker[] getStatTrackers(boolean aggregateThreadData)
aggregateThreadData - Indicates whether the data collected by each
thread should be aggregated before returning
the results.
public java.lang.String[] getLogMessages()
public void writeVerbose(java.lang.String message)
message - The message to be written.
public void logMessage(java.lang.String threadID,
java.lang.String message)
threadID - The ID of the thread logging this message.message - The message to be logged.public void threadDone(JobClass jobThread)
jobThread - The job thread that has finished.public boolean isDone()
true if the job is done, or false if
not.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||