org.backsource.jmx
Class MBeanProxy

java.lang.Object
  extended byorg.backsource.jmx.MBeanProxy
All Implemented Interfaces:
java.lang.reflect.InvocationHandler, java.io.Serializable

public class MBeanProxy
extends java.lang.Object
implements java.lang.reflect.InvocationHandler, java.io.Serializable

A proxy and proxy factory to access MBean as normal classes. Server may be both local or remote.

Version:
$Revision: 1.1.1.1 $
Author:
Peter Antman
See Also:
Serialized Form

Constructor Summary
MBeanProxy(java.lang.String name)
          Create a proxy wich will invoke the MBean by ObjectName name.
MBeanProxy(java.lang.String name, java.lang.String jndiURL)
          Create a proxy wich will invoke the MBean by ObjectName name.
 
Method Summary
 java.lang.Object invoke(java.lang.Object proxy, java.lang.reflect.Method method, java.lang.Object[] args)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MBeanProxy

public MBeanProxy(java.lang.String name)
           throws javax.management.OperationsException,
                  javax.naming.NamingException
Create a proxy wich will invoke the MBean by ObjectName name.

This proxy may be used both locally (the invokation is done directly against the MBean server) or remotely.


MBeanProxy

public MBeanProxy(java.lang.String name,
                  java.lang.String jndiURL)
           throws javax.management.OperationsException,
                  javax.naming.NamingException
Create a proxy wich will invoke the MBean by ObjectName name.

if jndiURL is non null, the MBean server will be looked up with that url as its java.naming.provider.url. This means that the proxy will actually proxy an MBean in another mbean server.

Method Detail

invoke

public java.lang.Object invoke(java.lang.Object proxy,
                               java.lang.reflect.Method method,
                               java.lang.Object[] args)
                        throws java.lang.Exception
Specified by:
invoke in interface java.lang.reflect.InvocationHandler
Throws:
java.lang.Exception


Copyright © 2001-2004 Backsource. All Rights Reserved.