This job will run until it is manually stopped or until the remote server is stopped. If this job is stopped it's state will be COMPLETE, if the server stops this job's state will be INCOMPLETE.
To access and control jobs on a server from within a configuration file this
client job must have an id. If the client has an id of 'freds-pc'
and the job on the server has an id of 'freds-job'. The job on
the server can be accessed from the client using the expression
${freds-pc/freds-job}.
| environment | The environment. |
| heartbeat | The heart beat interval, in milliseconds. |
| logPollingInterval | The number of milliseconds between polling for new log events. |
| maxConsoleLines | The maximum number of console lines to retrieve for any component. |
| maxLoggerLines | The maximum number of log lines to retrieve for any component. |
| name | A name, can be any text. |
| url | The JMX service URL. |
| Example 1 | To create a connection to a remote server. |
| Example 2 | Connect, run a remote job, and disconnect. |
| Example 3 | Connect using a username and password to a secure server. |
| Example 4 | A local job triggers when a server job runs. |
| Configured By | ELEMENT |
| Access | READ_WRITE |
| Required | No. |
The environment. Typically username/password credentials.
| Configured By | ATTRIBUTE |
| Access | READ_WRITE |
| Required | Not, defaults to 5 seconds. |
The heart beat interval, in milliseconds.
| Configured By | ATTRIBUTE |
| Access | READ_WRITE |
| Required | No. |
The number of milliseconds between polling for new log events. Defaults to 5.
| Configured By | ATTRIBUTE |
| Access | READ_WRITE |
| Required | No. |
The maximum number of console lines to retrieve for any component.
| Configured By | ATTRIBUTE |
| Access | READ_WRITE |
| Required | No. |
The maximum number of log lines to retrieve for any component.
| Configured By | ATTRIBUTE |
| Access | READ_WRITE |
| Required | No. |
A name, can be any text.
| Configured By | ATTRIBUTE |
| Access | READ_WRITE |
| Required | No. If not provided the client connects to the Platform MBean Server but this is really only useful for testing. |
The JMX service URL.
To create a connection to a remote server.
<jmx:client id="freds-pc" name="Connection to Freds PC" url="service:jmx:rmi:///jndi/rmi://${hosts.freds-pc}/freds-oddjob-server" xmlns:jmx="http://rgordon.co.uk/oddjob/jmx"/>
Connect, run a remote job, and disconnect.
<oddjob>
<job>
<sequential>
<jobs>
<jmx:client id="freds-pc" name="Oddjob Client" url="service:jmx:rmi:///jndi/rmi://${hosts.freds-pc}/freds-oddjob-server" xmlns:jmx="http://rgordon.co.uk/oddjob/jmx"/>
<run job="${freds-pc/server-jobs/greeting}"/>
<stop job="${freds-pc}"/>
</jobs>
</sequential>
</job>
</oddjob>
The run job starts the server job but doesn't wait for it to complete.
We would need to add a wait job for that.
Connect using a username and password to a secure server.
<jmx:client url="service:jmx:rmi:///jndi/rmi://localhost/my-oddjob" xmlns:jmx="http://rgordon.co.uk/oddjob/jmx">
<environment>
<jmx:client-credentials username="username" password="password"/>
</environment>
</jmx:client>
A local job triggers when a server job runs.
<oddjob>
<job>
<sequential>
<jobs>
<jmx:client id="freds-pc" name="Oddjob Client" url="service:jmx:rmi:///jndi/rmi://${hosts.freds-pc}/freds-oddjob-server" xmlns:jmx="http://rgordon.co.uk/oddjob/jmx"/>
<scheduling:trigger on="${freds-pc/server-jobs/greeting}" xmlns:scheduling="http://rgordon.co.uk/oddjob/scheduling">
<job>
<sequential>
<jobs>
<echo id="local-job">Server Job Ran!</echo>
<stop job="${freds-pc}"/>
</jobs>
</sequential>
</job>
</scheduling:trigger>
</jobs>
</sequential>
</job>
</oddjob>