|
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)
A collection of the parameters used to configure your function. |
| 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 FunctionInvalidVariableExceptionFunction.execute(SampleResult, Sampler)
public String execute()
throws InvalidVariableException
InvalidVariableException
public abstract void setParameters(Collection<CompoundVariable> parameters)
throws InvalidVariableException
Function
setParameters in interface FunctionInvalidVariableException
Note: This is always called even if no parameters are provided
(versions of JMeter after 2.3.1)public abstract String getReferenceKey()
Function
getReferenceKey in interface FunctionFunction.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 incorrect
protected void checkParameterCount(Collection<CompoundVariable> parameters,
int count)
throws InvalidVariableException
parameters - collection of parameterscount - number of parameters expected
InvalidVariableException - if the number of parameters is incorrect
protected 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 | ||||||||