org.jmx4odp.j4oNet
Class ProxyManager

java.lang.Object
  extended by org.jmx4odp.j4oNet.ProxyManager

public class ProxyManager
extends java.lang.Object

This class returns an Object that acts as a proxy to MBeans. Is uses the data in the JSO to determine how to connect to the MBean, whether it is local or remote.

Author:
Lucas McGregor

Constructor Summary
ProxyManager()
          Creates new ProxyManager
 
Method Summary
 JmxServiceObj createInstance(java.lang.String name, java.lang.Object proxy)
          Given a String to create a valid ObjectName and a valid proxy, it will create a new MBean on the MBean server and return a JSO with the new ObjectInstance
 JmxServiceObj getJmxServiceObj(java.lang.Object proxy)
          Given a proxy object, it will return the JmxServiceObject used to make that proxy.
 java.lang.Object getProxy(JmxServiceObj jso)
          If jso.getClassName() is not null, it will use it + "MBean" as the interface class, else it will use the jso.getObjectInstance()).getClassName() + "MBean" to determine the interface for the MBean.
 java.lang.Object getProxy(JmxServiceObj jso, java.lang.Class interfaceClass)
          This method will get use the interfaceClass argument to define the proxy class that is generated.
 java.lang.Object getProxy(JmxServiceObj jso, java.lang.Class[] interfaces)
          This method will get use the multiple Class objects in the interfaces array to define the proxy class that is generated.
 void unregisterMBean(java.lang.Object proxy)
          This call will unregister the MBean represented by a proxy
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ProxyManager

public ProxyManager()
Creates new ProxyManager

Method Detail

getProxy

public java.lang.Object getProxy(JmxServiceObj jso)
                          throws java.lang.Exception
If jso.getClassName() is not null, it will use it + "MBean" as the interface class, else it will use the jso.getObjectInstance()).getClassName() + "MBean" to determine the interface for the MBean. If the jso does not have and ObjectInstance set, this method will call the ProxyInvocationHandler.getObjectInstance to connect to the MBeanServer and determine the ObjectInstace from the ObjectName. This means that the ObjectName and enough data to connect must be set in the jso.

Throws:
java.lang.Exception

getProxy

public java.lang.Object getProxy(JmxServiceObj jso,
                                 java.lang.Class interfaceClass)
                          throws java.lang.Exception
This method will get use the interfaceClass argument to define the proxy class that is generated.

Throws:
java.lang.Exception

getProxy

public java.lang.Object getProxy(JmxServiceObj jso,
                                 java.lang.Class[] interfaces)
                          throws java.lang.Exception
This method will get use the multiple Class objects in the interfaces array to define the proxy class that is generated.

Throws:
java.lang.Exception

createInstance

public JmxServiceObj createInstance(java.lang.String name,
                                    java.lang.Object proxy)
                             throws java.lang.Exception
Given a String to create a valid ObjectName and a valid proxy, it will create a new MBean on the MBean server and return a JSO with the new ObjectInstance

Throws:
java.lang.Exception

unregisterMBean

public void unregisterMBean(java.lang.Object proxy)
                     throws java.lang.Exception
This call will unregister the MBean represented by a proxy

Throws:
java.lang.Exception

getJmxServiceObj

public JmxServiceObj getJmxServiceObj(java.lang.Object proxy)
Given a proxy object, it will return the JmxServiceObject used to make that proxy.