Script functions reference > Script functions in alphabetical order > J > JavaInvokeStaticMethod

JavaInvokeStaticMethod
Syntax
JavaInvokeStaticMethod(strClassName, strMethodName, [var_1, var_2, ...], [return_var]);
strClassName
strMethodName
var_1, var_2, ...
return_var
Optional StreamServe variable that will be set to the return value of the invoked Java method.
Prerequisites
The Java environment must be configured, i.e. the compiled Java class must be accessible. See Configuring Java parameters in the Control Center documentation for more information.
Description
This function directly invokes the specified static method of the specified Java class. The external Java method must be statically defined (it is not necessary to call JavaCreateObject). The JavaInvokeStaticMethod function can take zero or more variables as arguments and zero or one return varible. All the variables must be defined in StreamServe scrips. Explicit values, or return values from other functions can not be passed directly to the JavaInvokeStaticMethod function. The last variable is always the return value, it is therefore not possible to have an argument variable without having a return variable. All variable values are transferred to Java as java.lang.String values.
Returns
A number indicating whether the method was successfully invoked.
0
-1
Example
$iRetVal = JavaInvokeStaticMethod("streamserve.invokeexternaljava.StatusService", "initialize");
$iRetVal = JavaInvokeStaticMethod("streamserve.invokeexternaljava.StatusService", "getStatus", $retStatus);
$iRetVal = JavaInvokeStaticMethod("streamserve.invokeexternaljava.StatusService", "docProcessed", $job_id, $doc_id, $retStatus);
The corresponding Java methods for the above calls must be:
public static void initialize()
public static String getStatus()
public static String docProcessed(String job_id, String doc_id)
OpenText StreamServe 5.6 Updated: 2013-03-01