|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.sun.slamd.scripting.engine.Variable
com.sun.slamd.scripting.general.ScriptVariable
This class defines a set of methods that may be called during script execution to perform various tasks. These methods are:
java.text.SimpleDateFormat class.
| Field Summary | |
static char[] |
ALPHABET
The set of characters that will be used to generate random string values. |
static java.lang.String |
DEBUG_MESSAGE_METHOD_NAME
The name of the method that can be used to write debug messages to the client's debug writer. |
static int |
DEBUG_MESSAGE_METHOD_NUMBER
The method number for the "debugMessage" method. |
static java.lang.String |
EXIT_METHOD_NAME
The name of the method that will be used to stop execution of the script. |
static int |
EXIT_METHOD_NUMBER
The method number for the "exit" method. |
static java.lang.String |
EXIT_WITH_ERROR_METHOD_NAME
The name of the method that will be used to stop execution of the script and indicate that an error occurred. |
static int |
EXIT_WITH_ERROR_METHOD_NUMBER
The method number for the "exitWithError" method. |
static int |
GET_SCRIPT_ARGUMENT_1_METHOD_NUMBER
The method number for the first "getScriptArgument" method. |
static int |
GET_SCRIPT_ARGUMENT_2_METHOD_NUMBER
The method number for the second "getScriptArgument" method. |
static java.lang.String |
GET_SCRIPT_ARGUMENT_METHOD_NAME
The name of the method that will be used to get argument information provided at the time the job was scheduled. |
static java.lang.String |
GET_SCRIPT_BOOLEAN_ARGUMENT_METHOD_NAME
The name of the method that will be used to get the boolean value of an argument provided at the time the job was scheduled. |
static int |
GET_SCRIPT_BOOLEAN_ARGUMENT_METHOD_NUMBER
The method number for the "getScriptBooleanArgument" method. |
static java.lang.String |
GET_SCRIPT_INT_ARGUMENT_METHOD_NAME
The name of the method that will be used to get the integer value of an argument provided at the time the job was scheduled. |
static int |
GET_SCRIPT_INT_ARGUMENT_METHOD_NUMBER
The method number for the "getScriptIntArgument" method. |
static java.lang.String |
LOG_MESSAGE_METHOD_NAME
The name of the method that will be used to write messages to the SLAMD log. |
static int |
LOG_MESSAGE_METHOD_NUMBER
The method number for the "logMessage" method. |
static java.lang.String |
RANDOM_INT_METHOD_NAME
The name of the method that will be used to generate a random integer value. |
static int |
RANDOM_INT_METHOD_NUMBER
The method number for the "randomInt" method. |
static int |
RANDOM_STRING_1_METHOD_NUMBER
The method number for the first "randomString" method. |
static int |
RANDOM_STRING_2_METHOD_NUMBER
The method number for the second "randomString" method. |
static java.lang.String |
RANDOM_STRING_METHOD_NAME
The name of the method that will be used to generate a random string value. |
static Method[] |
SCRIPT_VARIABLE_METHODS
The set of methods associated with script variables. |
static java.lang.String |
SHOULD_NOT_STOP_METHOD_NAME
The name of the method that will be used to determine whether the script has not yet been requested to stop runing. |
static int |
SHOULD_NOT_STOP_METHOD_NUMBER
The method number for the "shouldNotStop" method. |
static java.lang.String |
SHOULD_STOP_METHOD_NAME
The name of the method that will be used to determine whether the script should stop running. |
static int |
SHOULD_STOP_METHOD_NUMBER
The method number for the "shouldStop" method. |
static java.lang.String |
SLEEP_METHOD_NAME
The name of the method that will be used to pause execution of the script. |
static int |
SLEEP_METHOD_NUMBER
The method number for the "sleep" method. |
static int |
TIMESTAMP_1_METHOD_NUMBER
The method number for the first "timestamp" method. |
static int |
TIMESTAMP_2_METHOD_NUMBER
The method number for the second "timestamp" method. |
static java.lang.String |
TIMESTAMP_METHOD_NAME
The name of the method that will be used to generate a timestamp. |
| Constructor Summary | |
ScriptVariable()
Creates a new variable with no name, to be used only when creating a variable with Class.newInstance(), and only when
setName() is called after that to set the name. |
|
| Method Summary | |
void |
assign(Argument argument)
Assigns the value of the provided argument to this variable. |
Variable |
executeMethod(int lineNumber,
int methodNumber,
Argument[] arguments)
Executes the specified method, using the provided variables as arguments to the method, and makes the return value available to the caller. |
int |
getMethodNumber(java.lang.String methodName,
java.lang.String[] argumentTypes)
Retrieves the method number for the method that has the specified name and argument types, or -1 if there is no such method. |
Method[] |
getMethods()
Retrieves a list of all methods defined for this variable. |
java.lang.String |
getReturnTypeForMethod(java.lang.String methodName,
java.lang.String[] argumentTypes)
Retrieves the return type for the method with the specified name and argument types. |
java.lang.String |
getValueAsString()
Retrieves a string representation of the value of this argument. |
java.lang.String |
getVariableTypeName()
Retrieves the name of the variable type for this variable. |
boolean |
hasMethod(java.lang.String methodName)
Indicates whether this variable type has a method with the specified name. |
void |
setJobThread(JobClass jobThread)
Associates this instance of the script variable with the job thread that is running it. |
void |
setParser(ScriptParser parser)
Associates this instance of the script variable with the script parser in which it is defined. |
| Methods inherited from class com.sun.slamd.scripting.engine.Variable |
getArgumentAsString, getArgumentType, getArgumentValue, getName, getStatTrackers, isValidIdentifier, setName, startStatTrackers, stopStatTrackers |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
public static final char[] ALPHABET
public static final java.lang.String DEBUG_MESSAGE_METHOD_NAME
public static final int DEBUG_MESSAGE_METHOD_NUMBER
public static final java.lang.String EXIT_METHOD_NAME
public static final int EXIT_METHOD_NUMBER
public static final java.lang.String EXIT_WITH_ERROR_METHOD_NAME
public static final int EXIT_WITH_ERROR_METHOD_NUMBER
public static final java.lang.String GET_SCRIPT_ARGUMENT_METHOD_NAME
public static final int GET_SCRIPT_ARGUMENT_1_METHOD_NUMBER
public static final int GET_SCRIPT_ARGUMENT_2_METHOD_NUMBER
public static final java.lang.String GET_SCRIPT_BOOLEAN_ARGUMENT_METHOD_NAME
public static final int GET_SCRIPT_BOOLEAN_ARGUMENT_METHOD_NUMBER
public static final java.lang.String GET_SCRIPT_INT_ARGUMENT_METHOD_NAME
public static final int GET_SCRIPT_INT_ARGUMENT_METHOD_NUMBER
public static final java.lang.String LOG_MESSAGE_METHOD_NAME
public static final int LOG_MESSAGE_METHOD_NUMBER
public static final java.lang.String RANDOM_INT_METHOD_NAME
public static final int RANDOM_INT_METHOD_NUMBER
public static final java.lang.String RANDOM_STRING_METHOD_NAME
public static final int RANDOM_STRING_1_METHOD_NUMBER
public static final int RANDOM_STRING_2_METHOD_NUMBER
public static final java.lang.String SHOULD_NOT_STOP_METHOD_NAME
public static final int SHOULD_NOT_STOP_METHOD_NUMBER
public static final java.lang.String SHOULD_STOP_METHOD_NAME
public static final int SHOULD_STOP_METHOD_NUMBER
public static final java.lang.String SLEEP_METHOD_NAME
public static final int SLEEP_METHOD_NUMBER
public static final java.lang.String TIMESTAMP_METHOD_NAME
public static final int TIMESTAMP_1_METHOD_NUMBER
public static final int TIMESTAMP_2_METHOD_NUMBER
public static final Method[] SCRIPT_VARIABLE_METHODS
| Constructor Detail |
public ScriptVariable()
throws ScriptException
Class.newInstance(), and only when
setName() is called after that to set the name.
ScriptException - If a problem occurs while initializing the new
variable.| Method Detail |
public void setJobThread(JobClass jobThread)
jobThread - THe job thread that is running this script.public void setParser(ScriptParser parser)
parser - The script parser with which this script variable is being
used.public java.lang.String getVariableTypeName()
getVariableTypeName in class Variablepublic Method[] getMethods()
getMethods in class Variablepublic boolean hasMethod(java.lang.String methodName)
hasMethod in class VariablemethodName - The name of the method.
true if this variable has a method with the specified
name, or false if it does not.
public int getMethodNumber(java.lang.String methodName,
java.lang.String[] argumentTypes)
getMethodNumber in class VariablemethodName - The name of the method.argumentTypes - The list of argument types for the method.
public java.lang.String getReturnTypeForMethod(java.lang.String methodName,
java.lang.String[] argumentTypes)
getReturnTypeForMethod in class VariablemethodName - The name of the method.argumentTypes - The set of argument types for the method.
null if there is
no such method defined.
public Variable executeMethod(int lineNumber,
int methodNumber,
Argument[] arguments)
throws ScriptException
executeMethod in class VariablelineNumber - The line number of the script in which the method
call occurs.methodNumber - The method number of the method to execute.arguments - The set of arguments to use for the method.
null if it
does not return a value.
ScriptException - If the specified method does not exist, or if a
problem occurs while attempting to execute it.
public void assign(Argument argument)
throws ScriptException
assign in class Variableargument - The argument whose value should be assigned to this
variable.
ScriptException - If a problem occurs while performing the
assignment.public java.lang.String getValueAsString()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||