public static void invokeService(InitialContext ctx, RMIAdaptor server) throws Exception
{
System.out.println("invoking remote business interface of ServiceOne...");
//Set attribute on singleton ServiceOne via remote interface
ServiceOneRemote serviceOne = (ServiceOneRemote) ctx.lookup("ServiceOne/remote");
serviceOne.setAttribute(100);
System.out.println("Set the attribute value through ServiceOneRemote to 100");
//Create object name for ServiceOne
ObjectName service1 = new ObjectName(ServiceOne.OBJECT_NAME);
//Get attribute of singleton ServiceOne via JMX