Apache JMeter
2.0.1.20050615

org.apache.jmeter.functions
Class AbstractFunction

java.lang.Object
  extended byorg.apache.jmeter.functions.AbstractFunction
All Implemented Interfaces:
Function
Direct Known Subclasses:
BeanShell, CSVRead, IntSum, IterationCounter, JavaScript, LogFunction, LogFunction2, MachineName, Property, Property2, Random, RegexFunction, SplitFunction, StringFromFile

public abstract class AbstractFunction
extends Object
implements Function

Version:
$Revision: 1.11 $ on $Date: 2004/03/02 00:07:51 $

Constructor Summary
AbstractFunction()
           
 
Method Summary
 String execute()
           
abstract  String execute(SampleResult previousResult, Sampler currentSampler)
          Given the previous SampleResult and the current Sampler, return a string to use as a replacement value for the function call.
abstract  String getReferenceKey()
          Return the name of your function.
protected  JMeterVariables getVariables()
          Provides a convenient way to parse the given argument string into a collection of individual arguments.
abstract  void setParameters(Collection 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

AbstractFunction

public AbstractFunction()
Method Detail

execute

public abstract String execute(SampleResult previousResult,
                               Sampler currentSampler)
                        throws InvalidVariableException
Description copied from interface: Function
Given the previous SampleResult and the current Sampler, return a string to use as a replacement value for the function call. Assume "setParameter" was previously called. This method must be threadsafe - multiple threads will be using the same object.

Specified by:
execute in interface Function
Throws:
InvalidVariableException
See Also:
Function.execute(SampleResult, Sampler)

execute

public String execute()
               throws InvalidVariableException
Throws:
InvalidVariableException

setParameters

public abstract void setParameters(Collection parameters)
                            throws InvalidVariableException
Description copied from interface: Function
A collection of the parameters used to configure your function. Each parameter is a CompoundFunction and can be resolved by calling the execute() method of the CompoundFunction (which should be done at execution.)

Specified by:
setParameters in interface Function
Parameters:
parameters -
Throws:
InvalidVariableException
See Also:
Function.setParameters(Collection)

getReferenceKey

public abstract String getReferenceKey()
Description copied from interface: Function
Return the name of your function. Convention is to prepend "__" to the name (ie "__regexFunction")

Specified by:
getReferenceKey in interface Function
See Also:
Function.getReferenceKey()

getVariables

protected JMeterVariables getVariables()
Provides a convenient way to parse the given argument string into a collection of individual arguments. Takes care of splitting the string based on commas, generates blank strings for values between adjacent commas, and decodes the string using URLDecoder.


Apache JMeter
2.0.1.20050615

Copyright © 1998-2005 Apache Software Foundation. All Rights Reserved.