org.oddjob.jmx.client
Class ClientSessionImpl

java.lang.Object
  extended by org.oddjob.jmx.client.ClientSessionImpl
All Implemented Interfaces:
ClientSession, ObjectNames

public class ClientSessionImpl
extends Object
implements ClientSession

Simple implementation of a ClientSession

Author:
rob

Constructor Summary
ClientSessionImpl(MBeanServerConnection serverConnection, ScheduledExecutorService notificationProcessor, ArooaSession arooaSession, org.apache.log4j.Logger logger)
          Constructor.
 
Method Summary
 Object create(ObjectName objectName)
          Create or find a previously created proxy for the JMX object name.
 void destroy(Object proxy)
          Destroy a client side proxy.
 void destroyAll()
          Destroy all proxies on the client side.
 ArooaSession getArooaSession()
          Get the ArooaSession the client was created with.
 ScheduledExecutorService getNotificationProcessor()
           
 MBeanServerConnection getServerConnection()
           
 org.apache.log4j.Logger logger()
          The Client JOb Logger, visible in explorer.
 ObjectName nameFor(Object proxy)
          Get the object name for the give component object.
 Object objectFor(ObjectName name)
          Get the client side component for the given object name.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ClientSessionImpl

public ClientSessionImpl(MBeanServerConnection serverConnection,
                         ScheduledExecutorService notificationProcessor,
                         ArooaSession arooaSession,
                         org.apache.log4j.Logger logger)
Constructor.

Parameters:
serverConnection - The server connection.
notificationProcessor - The notification processor.
arooaSession - The local session.
logger - The logger.
Method Detail

create

public Object create(ObjectName objectName)
Description copied from interface: ClientSession
Create or find a previously created proxy for the JMX object name.

Specified by:
create in interface ClientSession
Parameters:
objectName - The JMX object name.
Returns:
The proxy. Never null.

nameFor

public ObjectName nameFor(Object proxy)
Description copied from interface: ObjectNames
Get the object name for the give component object.

Specified by:
nameFor in interface ObjectNames
Parameters:
proxy - The proxy.
Returns:
The name.

objectFor

public Object objectFor(ObjectName name)
Description copied from interface: ObjectNames
Get the client side component for the given object name.

Specified by:
objectFor in interface ObjectNames
Parameters:
name - The object name.
Returns:
The proxy. Null if none exsists for the given name.

destroy

public void destroy(Object proxy)
Description copied from interface: ClientSession
Destroy a client side proxy. Allows handlers to free resources.

Specified by:
destroy in interface ClientSession

getArooaSession

public ArooaSession getArooaSession()
Description copied from interface: ClientSession
Get the ArooaSession the client was created with.

Specified by:
getArooaSession in interface ClientSession
Returns:

logger

public org.apache.log4j.Logger logger()
Description copied from interface: ClientSession
The Client JOb Logger, visible in explorer.

Specified by:
logger in interface ClientSession
Returns:

getServerConnection

public MBeanServerConnection getServerConnection()

getNotificationProcessor

public ScheduledExecutorService getNotificationProcessor()

destroyAll

public void destroyAll()
Description copied from interface: ClientSession
Destroy all proxies on the client side.

Specified by:
destroyAll in interface ClientSession