// connector server is bound to
MBeanServerConnection connection = connector.getMBeanServerConnection();
// Call the server side as if it is a local MBeanServer
ObjectName delegateName = ObjectName.getInstance("JMImplementation:type=MBeanServerDelegate");
Object proxy = MBeanServerInvocationHandler.newProxyInstance(connection, delegateName, MBeanServerDelegateMBean.class, true);
MBeanServerDelegateMBean delegate = (MBeanServerDelegateMBean) proxy;
// The magic of JDK 1.3 dynamic proxy and JSR 160:
// delegate.getImplementationVendor() is actually a remote JMX call,
// but it looks like a local, old-style, java call.
LOGGER.info("{} is cool !", delegate.getImplementationVendor());
ObjectName objName = context.createObjectName(context);
proxy = MBeanServerInvocationHandler.newProxyInstance(connection, objName, LifeCycleMBean.class, true);
LifeCycleMBean mc = (LifeCycleMBean) proxy;