{
MBeanServer server = MBeanServerFactory.createMBeanServer();
ObjectName oname = new ObjectName("test:test=test");
RequiredModelMBean rmm = new RequiredModelMBean();
ResourceOverride resource = new ResourceOverride();
rmm.setManagedResource(resource, "ObjectReference");
rmm.setModelMBeanInfo(resource.getMBeanInfo());
server.registerMBean(rmm, oname);
MyInterface mbean = (MyInterface)MBeanProxy.get(
MyInterface.class, oname, server