|
Apache JMeter | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.jmeter.protocol.java.sampler.JavaSamplerContext
public class JavaSamplerContext
JavaSamplerContext is used to provide context information to a JavaSamplerClient implementation. This currently consists of the initialization parameters which were specified in the GUI. Additional data may be accessible through JavaSamplerContext in the future.
Constructor Summary | |
---|---|
JavaSamplerContext(Arguments args)
Create a new JavaSampler with the specified initialization parameters. |
Method Summary | |
---|---|
boolean |
containsParameter(String name)
Determine whether or not a value has been specified for the parameter with this name. |
int |
getIntParameter(String name)
Get the value of a specified parameter as an integer. |
int |
getIntParameter(String name,
int defaultValue)
Get the value of a specified parameter as an integer, or return the specified default value if the value was not specified or is not an integer. |
long |
getLongParameter(String name)
Get the value of a specified parameter as a long. |
long |
getLongParameter(String name,
long defaultValue)
Get the value of a specified parameter as along, or return the specified default value if the value was not specified or is not a long. |
String |
getParameter(String name)
Get the value of a specific parameter as a String, or null if the value was not specified. |
String |
getParameter(String name,
String defaultValue)
Get the value of a specified parameter as a String, or return the specified default value if the value was not specified. |
Iterator<String> |
getParameterNamesIterator()
Get an iterator of the parameter names. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public JavaSamplerContext(Arguments args)
args
- the initialization parameters.Method Detail |
---|
public boolean containsParameter(String name)
name
- the name of the parameter to test
public Iterator<String> getParameterNamesIterator()
public String getParameter(String name)
name
- the name of the parameter whose value should be retrieved
public String getParameter(String name, String defaultValue)
name
- the name of the parameter whose value should be retrieveddefaultValue
- the default value to return if the value of this parameter was
not specified
public int getIntParameter(String name) throws NumberFormatException
name
- the name of the parameter whose value should be retrieved
NumberFormatException
- if the parameter is not specified or is not an integerInteger.decode(java.lang.String)
public int getIntParameter(String name, int defaultValue)
name
- the name of the parameter whose value should be retrieveddefaultValue
- the default value to return if the value of this parameter was
not specified
Integer.decode(java.lang.String)
public long getLongParameter(String name) throws NumberFormatException
name
- the name of the parameter whose value should be retrieved
NumberFormatException
- if the parameter is not specified or is not a longLong.decode(String)
public long getLongParameter(String name, long defaultValue)
name
- the name of the parameter whose value should be retrieveddefaultValue
- the default value to return if the value of this parameter was
not specified
Long.decode(String)
|
Apache JMeter | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |