FileDocCategorySizeDatePackage
MXBeanProxy.javaAPI DocJava SE 6 API4708Tue Jun 10 00:22:02 BST 2008com.sun.jmx.mbeanserver

MXBeanProxy

public class MXBeanProxy extends Object

Helper class for an {@link InvocationHandler} that forwards methods from an MXBean interface to a named MXBean in an MBean Server and handles translation between the arbitrary Java types in the interface and the Open Types used by the MXBean.

since
1.6

Fields Summary
private final Map
handlerMap
Constructors Summary
public MXBeanProxy(Class mxbeanInterface)


	if (mxbeanInterface == null)
	    throw new IllegalArgumentException("Null parameter");

	final MBeanAnalyzer<ConvertingMethod> analyzer;
        try {
            analyzer =
                MXBeanIntrospector.getInstance().getAnalyzer(mxbeanInterface);
        } catch (NotCompliantMBeanException e) {
            throw new IllegalArgumentException(e);
        }
	analyzer.visit(new Visitor());
    
Methods Summary
public java.lang.Objectinvoke(javax.management.MBeanServerConnection mbsc, javax.management.ObjectName name, java.lang.reflect.Method method, java.lang.Object[] args)


	Handler handler = handlerMap.get(method);
	ConvertingMethod cm = handler.getConvertingMethod();
        MXBeanLookup lookup = MXBeanLookup.lookupFor(mbsc);
        Object[] openArgs = cm.toOpenParameters(lookup, args);
        Object result = handler.invoke(mbsc, name, openArgs);
        return cm.fromOpenReturnValue(lookup, result);