InitialContext ctx = new InitialContext();
//Get hold of the MBean server invoker
RMIAdaptor server = (RMIAdaptor)ctx.lookup("jmx/invoker/RMIAdaptor");
//Set attribute on singleton ServiceOne via remote interface
ServiceOneRemote serviceOne = (ServiceOneRemote) ctx.lookup("serviceOne/remote");
serviceOne.setAttribute(100);
//Create object name for ServiceOne
ObjectName service1 = new ObjectName("tutorial:service=serviceOne");
//Get attribute of singleton ServiceOne via JMX
int attr1 = (Integer)server.getAttribute(service1, "Attribute");