mmbean.setManagedResource(resource, "ObjectReference");
mmbean.setModelMBeanInfo(resource.getMBeanInfo());
server.registerMBean(mmbean, oname);
MyInterface mbean = (MyInterface)MBeanProxy.get(
MyInterface.class, oname, server
);
ProxyContext ctx = (ProxyContext)mbean;
ctx.setExceptionHandler(new DefaultExceptionHandler());
try
{
mbean.setAttributeName2("some name");
}
catch (IllegalArgumentException e)
{
// expected