org.ejtools.jmx
Class MBeanServerProxy

java.lang.Object
  |
  +--org.ejtools.jmx.MBeanServerProxy
All Implemented Interfaces:
java.lang.reflect.InvocationHandler

public class MBeanServerProxy
extends java.lang.Object
implements java.lang.reflect.InvocationHandler

A proxy for object that provides MBeanServer fonctionnality

Version:
$Revision: 1.8 $
Author:
Laurent Etiemble

Field Summary
protected  java.lang.Class clazz
          The class to search the method on
protected  java.lang.Object object
          The real object
 
Constructor Summary
MBeanServerProxy(java.lang.Object object, java.lang.Class clazz)
          Constructor for MBeanServerProxy.
 
Method Summary
static javax.management.MBeanServer createMBeanProxy(java.lang.Object object)
          Factory method to create a proxy
static javax.management.MBeanServer createMBeanProxy(java.lang.Object object, java.lang.Class clazz)
          Factory method to create a proxy
 java.lang.Object invoke(java.lang.Object obj, java.lang.reflect.Method method, java.lang.Object[] args)
          Invocation method.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

clazz

protected java.lang.Class clazz
The class to search the method on


object

protected java.lang.Object object
The real object

Constructor Detail

MBeanServerProxy

public MBeanServerProxy(java.lang.Object object,
                        java.lang.Class clazz)
Constructor for MBeanServerProxy.

Parameters:
object - Real object to proxy
clazz - Class of the proxied object
Method Detail

invoke

public java.lang.Object invoke(java.lang.Object obj,
                               java.lang.reflect.Method method,
                               java.lang.Object[] args)
                        throws java.lang.Throwable
Invocation method. Delegates the method call to the real object.

Specified by:
invoke in interface java.lang.reflect.InvocationHandler
Parameters:
method - Method called
args - Method arguments
obj - The method on which the invocation was made
Returns:
The return value of the method
Throws:
java.lang.Throwable - In case of Exception

createMBeanProxy

public static javax.management.MBeanServer createMBeanProxy(java.lang.Object object)
Factory method to create a proxy

Parameters:
object - Real object to proxy
Returns:
The proxy created

createMBeanProxy

public static javax.management.MBeanServer createMBeanProxy(java.lang.Object object,
                                                            java.lang.Class clazz)
Factory method to create a proxy

Parameters:
object - Real object to proxy
clazz - Class of the proxied object
Returns:
The proxy created


Copyright © 2002-2003 EJTools Org.. All Rights Reserved.