|
Apache JMeter | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.jmeter.functions.AbstractFunction
public abstract class AbstractFunction
Provides common methods for all functions
Constructor Summary | |
---|---|
AbstractFunction()
|
Method Summary | |
---|---|
protected void |
checkMinParameterCount(Collection<CompoundVariable> parameters,
int minimum)
Utility method to check parameter counts. |
protected void |
checkParameterCount(Collection<CompoundVariable> parameters,
int count)
Utility method to check parameter counts. |
protected void |
checkParameterCount(Collection<CompoundVariable> parameters,
int min,
int max)
Utility method to check parameter counts. |
String |
execute()
|
abstract String |
execute(SampleResult previousResult,
Sampler currentSampler)
N.B. execute() should be synchronized if function is operating with non-thread-safe objects (e.g. operates with files). |
abstract String |
getReferenceKey()
Return the name of your function. |
protected JMeterVariables |
getVariables()
Gives access to the JMeter variables for the current thread. |
abstract void |
setParameters(Collection<CompoundVariable> parameters)
Note: This is always called even if no parameters are provided (versions of JMeter after 2.3.1) |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface org.apache.jmeter.functions.Function |
---|
getArgumentDesc |
Constructor Detail |
---|
public AbstractFunction()
Method Detail |
---|
public abstract String execute(SampleResult previousResult, Sampler currentSampler) throws InvalidVariableException
N.B. execute() should be synchronized if function is operating with non-thread-safe objects (e.g. operates with files).
JMeter ensures setParameters() happens-before execute(): setParameters is executed in main thread, and worker threads are started after that.
execute
in interface Function
previousResult
- The previous SampleResult
currentSampler
- The current Sampler
InvalidVariableException
- - when the variables for the function call can't be evaluatedFunction.execute(SampleResult, Sampler)
public String execute() throws InvalidVariableException
InvalidVariableException
public abstract void setParameters(Collection<CompoundVariable> parameters) throws InvalidVariableException
setParameters
in interface Function
parameters
- The parameters for the function call
InvalidVariableException
- - when the variables for the function call can't be evaluatedFunction.setParameters(Collection)
public abstract String getReferenceKey()
Function
getReferenceKey
in interface Function
Function.getReferenceKey()
protected JMeterVariables getVariables()
protected void checkParameterCount(Collection<CompoundVariable> parameters, int min, int max) throws InvalidVariableException
parameters
- collection of parametersmin
- minimum number of parameters allowedmax
- maximum number of parameters allowed
InvalidVariableException
- if the number of parameters is incorrectprotected void checkParameterCount(Collection<CompoundVariable> parameters, int count) throws InvalidVariableException
parameters
- collection of parameterscount
- number of parameters expected
InvalidVariableException
- if the number of parameters is incorrectprotected void checkMinParameterCount(Collection<CompoundVariable> parameters, int minimum) throws InvalidVariableException
parameters
- collection of parametersminimum
- number of parameters expected
InvalidVariableException
- if the number of parameters is incorrect
|
Apache JMeter | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |