This is a wrapper for invoke. The result of the
invocation is placed in the result
property.
Note that stopping this job will simply attempt to interrupt the thread invoking the method. The outcome of this will obviously vary.
function | The function/method to call. |
name | A name, can be any text. |
parameters | The values to use as arguments. |
result | |
source | The java object or script Invocable on which to invoke the method/function. |
Example 1 | Invoking a method on a bean. |
Example 2 | Examples elsewhere. |
Configured By | ATTRIBUTE |
Access | READ_WRITE |
Required | Yes. |
The function/method to call.
Configured By | ATTRIBUTE |
Access | READ_WRITE |
Required | No. |
A name, can be any text.
Configured By | ELEMENT |
Access | READ_WRITE |
Required | Must match the expected arguments. |
The values to use as arguments.
Access | READ_ONLY |
Configured By | ELEMENT |
Access | READ_WRITE |
Required | Yes. |
The java object or script Invocable on which to invoke the method/function.
Invoking a method on a bean.
<oddjob> <job> <sequential> <jobs> <invoke id="invoke-job" function="echo"> <source> <bean class="org.oddjob.script.EchoService"/> </source> <parameters> <value value="Hello"/> </parameters> </invoke> <echo id="echo">${invoke-job.result}</echo> </jobs> </sequential> </job> </oddjob>Where
EchoService
is:
java.io.IOException: No Resource found: org/oddjob/script/EchoService.java
Examples elsewhere. The jmx:service job has an example of invoking a JMX operation.