jmx:client

Description

Connect to an Oddjob jmx:server. This job allows remote jobs to be monitored and controlled from a local Oddjob.

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 NOT COMPLETE.

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. be accessed using the path freds-pc/freds-job.

Please note that the none namespaced version of this element is deprecated and will be removed in the next version.

Properties

NameDescriptionRequired
name A name, can be any text. No.
url The JMX service URL. Yes.
heartbeat The heart beat interval, in milliseconds. Not, defaults to 5 seconds.
environment The environment. Typically username/password credentials. No.
maxLoggerLines The maximum number of log lines to retrieve for any component. No.
maxConsoleLines The maximum number of console lines to retrieve for any component. No.
logPollingInterval The number of milliseconds between polling for new log events. Defaults to 5. No.

Example

To create a connection to a remote server.

 <jmx:client xmlns:jmx="http://rgordon.co.uk/oddjob/jmx"
            id="freds-pc"
            name="Connection to Freds PC" 
            url="service:jmx:rmi:///jndi/rmi://pcfred/public-jobs"/>
 

Connect, run a remote job, and disconnect.

 <sequential xmlns:jmx="http://rgordon.co.uk/oddjob/jmx">
  <jobs>
   <jmx:client id="freds-pc" 
                  name="Connection to Fred's PC" 
                  url="service:jmx:rmi:///jndi/rmi://pcfred/public-jobs" />
   <run name="Run Fred's Job" 
           job="${freds-pc/freds-job}" />
   <stop name="Disconnect" 
            job="${freds-pc} /gt;
  </jobs>
 <sequential>
 

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 xmlns:jmx="http://rgordon.co.uk/oddjob/jmx"
             url="service:jmx:rmi:///jndi/rmi://localhost/my-oddjob" >
  <environment>
   <jmx:client-credentials username="username"
                           password="password" />
  </environment>
 </jmx:client>
 


(c) Rob Gordon 2005 - 2009