KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > jmeter > functions > Function


1 // $Header: /home/cvs/jakarta-jmeter/src/core/org/apache/jmeter/functions/Function.java,v 1.5 2004/02/14 03:34:29 sebb Exp $
2
/*
3  * Copyright 2001-2004 The Apache Software Foundation.
4  *
5  * Licensed under the Apache License, Version 2.0 (the "License");
6  * you may not use this file except in compliance with the License.
7  * You may obtain a copy of the License at
8  *
9  * http://www.apache.org/licenses/LICENSE-2.0
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  *
17 */

18
19 package org.apache.jmeter.functions;
20
21 import java.util.Collection JavaDoc;
22 import java.util.List JavaDoc;
23
24 import org.apache.jmeter.samplers.SampleResult;
25 import org.apache.jmeter.samplers.Sampler;
26
27 /**
28  * @author mstover
29  * @version $Revision: 1.5 $
30  */

31 public interface Function
32 {
33     /**
34      * Given the previous SampleResult and the current Sampler, return
35      * a string to use as a replacement value for the function call.
36      * Assume "setParameter" was previously called.
37      *
38      * This method must be threadsafe - multiple threads will be using
39      * the same object.
40      */

41     public String JavaDoc execute(SampleResult previousResult, Sampler currentSampler)
42         throws InvalidVariableException;
43
44     /**
45      * A collection of the parameters used to configure your function. Each
46      * parameter is a CompoundFunction and can be resolved by calling the
47      * execute() method of the CompoundFunction (which should be done at
48      * execution.)
49      *
50      * @param parameters
51      * @throws InvalidVariableException
52      */

53     public void setParameters(Collection JavaDoc parameters)
54         throws InvalidVariableException;
55
56     /**
57      * Return the name of your function. Convention is to prepend "__"
58      * to the name (ie "__regexFunction")
59      */

60     public String JavaDoc getReferenceKey();
61
62     /**
63      * Return a list of strings briefly describing each parameter
64      * your function takes. Please use JMeterUtils.getResString(resource_name)
65      * to grab a resource string. Otherwise, your help text will be
66      * difficult to internationalize. Add your strings to all
67      * org.apache.jmeter.resources.*.properties files. Do not worry
68      * about translating - that's someone else's responsibility.
69      *
70      * This list is not optional. If you don't wish to write help, you
71      * must at least return a List containing the correct number of
72      * blank strings, one for each argument.
73      */

74     public List JavaDoc getArgumentDesc();
75 }
76
Popular Tags