}
public static void invokeXMBean(InitialContext ctx, RMIAdaptor server) throws Exception
{
System.out.println("invoking XMBean (configured through deployment descriptor)...");
XMBeanServiceRemote xmbeanRemote = (XMBeanServiceRemote) ctx.lookup("XMBeanService/remote");
xmbeanRemote.remoteBusinessMethodToSetAttribute(50);
System.out.println("Set the attribute value to 50");
System.out.println("Invoking XMBean through JMX");
ObjectName service = new ObjectName(XMBeanService.OBJECT_NAME);
//Get attribute of singleton XMBeanService via JMX