public abstract class AbstractJavaSamplerClient extends Object implements JavaSamplerClient
See SleepTest
for an example of
how to extend this class.
While it may be necessary to make changes to the JavaSamplerClient interface from time to time (therefore requiring changes to any implementations of this interface), we intend to make this abstract class provide reasonable implementations of any new methods so that subclasses do not necessarily need to be updated for new versions. Therefore, when creating a new JavaSamplerClient implementation, developers are encouraged to subclass this abstract class rather than implementing the JavaSamplerClient interface directly. Implementing JavaSamplerClient directly will continue to be supported for cases where extending this class is not possible (for example, when the client class is already a subclass of some other class).
The runTest() method of JavaSamplerClient does not have a default implementation here, so subclasses must define at least this method. It may be useful to override other methods as well.
Constructor and Description |
---|
AbstractJavaSamplerClient() |
Modifier and Type | Method and Description |
---|---|
Arguments |
getDefaultParameters()
Provide a list of parameters which this test supports.
|
protected Logger |
getLogger()
Deprecated.
Will be removed in 3.3, use
getNewLogger() |
protected org.slf4j.Logger |
getNewLogger()
Get a Logger instance which can be used by subclasses to log information.
|
void |
setupTest(JavaSamplerContext context)
Do any initialization required by this client.
|
void |
teardownTest(JavaSamplerContext context)
Do any clean-up required by this test at the end of a test run.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
runTest
public void setupTest(JavaSamplerContext context)
JavaSamplerClient
setupTest
in interface JavaSamplerClient
context
- the context to run with. This provides access to
initialization parameters.public void teardownTest(JavaSamplerContext context)
JavaSamplerClient
teardownTest
in interface JavaSamplerClient
context
- the context to run with. This provides access to
initialization parameters.public Arguments getDefaultParameters()
JavaSamplerClient
getDefaultParameters
in interface JavaSamplerClient
@Deprecated protected Logger getLogger()
getNewLogger()
protected org.slf4j.Logger getNewLogger()
Logger
instance which can be used for loggingCopyright © 1998-2019 Apache Software Foundation. All Rights Reserved.