org.oddjob.jmx
Class ClientBase

java.lang.Object
  extended by org.oddjob.framework.BaseComponent
      extended by org.oddjob.framework.SimpleService
          extended by org.oddjob.jmx.ClientBase
All Implemented Interfaces:
Runnable, ArooaContextAware, ArooaSessionAware, PropertyChangeNotifier, Iconic, LogEnabled, Resetable, Stateful, Stoppable
Direct Known Subclasses:
JMXClientJob, JMXServiceJob

public abstract class ClientBase
extends SimpleService

Shared implementation for JMX clients.

Author:
rob

Nested Class Summary
protected static class ClientBase.WhyStop
           
 
Field Summary
 
Fields inherited from class org.oddjob.framework.SimpleService
stateHandler
 
Fields inherited from class org.oddjob.framework.BaseComponent
iconHelper
 
Constructor Summary
ClientBase()
          Construct a new instance.
 
Method Summary
protected abstract  void doStart(MBeanServerConnection mbsc, ScheduledExecutorService notificationProcessor)
          Overridden by subclasses to provide a specific startup.
protected  void doStop(ClientBase.WhyStop why, Exception cause)
           
 String getConnection()
          Get the JMX service URL.
 Map<String,?> getEnvironment()
           
 long getHeartbeat()
           
protected  void onStart()
           
protected  void onStop()
          Allow sub classes to do something on stop.
protected abstract  void onStop(ClientBase.WhyStop why)
           
 void setConnection(String lookup)
          Set naming service url.
 void setEnvironment(Map<String,?> environment)
           
 void setHeartbeat(long heartbeat)
           
 
Methods inherited from class org.oddjob.framework.SimpleService
fireDestroyedState, getName, getStateChanger, hardReset, logger, loggerName, onDestroy, run, setName, softReset, stateHandler, stop, toString
 
Methods inherited from class org.oddjob.framework.BaseComponent
addIconListener, addPropertyChangeListener, addStateListener, configure, destroy, firePropertyChange, getArooaSession, iconForId, initialise, lastStateEvent, onConfigured, onInitialised, removeIconListener, removePropertyChangeListener, removeStateListener, save, save, setArooaContext, setArooaSession
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.oddjob.Stateful
addStateListener, lastStateEvent, removeStateListener
 

Constructor Detail

ClientBase

public ClientBase()
Construct a new instance.

Method Detail

onStart

protected void onStart()
                throws Exception
Specified by:
onStart in class SimpleService
Throws:
Exception

doStart

protected abstract void doStart(MBeanServerConnection mbsc,
                                ScheduledExecutorService notificationProcessor)
                         throws Exception
Overridden by subclasses to provide a specific startup.

Parameters:
mbsc -
notificationProcessor -
Throws:
Exception

onStop

protected void onStop()
               throws FailedToStopException
Description copied from class: SimpleService
Allow sub classes to do something on stop.

Overrides:
onStop in class SimpleService
Throws:
FailedToStopException

doStop

protected void doStop(ClientBase.WhyStop why,
                      Exception cause)

onStop

protected abstract void onStop(ClientBase.WhyStop why)

setConnection

public void setConnection(String lookup)
Set naming service url.

Parameters:
connection - The name of the remote node in the naming service.

getConnection

public String getConnection()
Get the JMX service URL.

Returns:
The name of the remote node in the naming service.

getEnvironment

public Map<String,?> getEnvironment()

setEnvironment

public void setEnvironment(Map<String,?> environment)

getHeartbeat

public long getHeartbeat()

setHeartbeat

public void setHeartbeat(long heartbeat)