public static void main(String[] args) {
		try{
			//Instantiate the MBean server
			echo(">>>Create the MBean server");
			MBeanServer mbs = MBeanServerFactory.createMBeanServer();
			waitForEnterPressed();
			
			//Get default domain
			echo(">>>Get the MBean server's default domain");
			String domain = mbs.getDefaultDomain();
			echo("Default domain:" + domain);
			waitForEnterPressed();
			
			//create and register SimpleStandard MBean
			String mbeanClassName = "SimpleStandard";
			String mbeanObjectNameStr =
					domain + ":type=" + mbeanClassName + ",name=1";
			ObjectName mbeanObjectName = 
					createSimpleMBean(mbs, mbeanClassName, mbeanObjectNameStr);
			waitForEnterPressed();
			
			//Get and display the management infomation exposed by the
			//SimpleStandard MBean
			printMBeanInfo(mbs, mbeanObjectName,mbeanClassName);
			waitForEnterPressed();
			
			//Manage the SimpleStandard MBean
			manageSimpleMBean(mbs, mbeanObjectName, mbeanClassName);
			waitForEnterPressed();
			
			//Create and register the SimpleDynamic MBean
			mbeanClassName = "SimpleDynamic";
			mbeanObjectNameStr = 
					domain + ":type=" + mbeanClassName + ",name=1";
			mbeanObjectName = 
					createSimpleMBean(mbs, mbeanClassName, mbeanObjectNameStr);
			waitForEnterPressed();
			
			//Get and display the management infomation exposed by the
			//SimpleStandard MBean
			printMBeanInfo(mbs, mbeanObjectName,mbeanClassName);
			waitForEnterPressed();
			
			//Manage the SimpleStandard MBean
			manageSimpleMBean(mbs, mbeanObjectName, mbeanClassName);
			waitForEnterPressed();
			
			//Create the RMI connector server
			echo("Create an RMI connector server");
			JMXServiceURL url = new JMXServiceURL(
					"service:jmx:rmi:///jndi/rmi://localhost:9999/server");
			JMXConnectorServer cs = 
					JMXConnectorServerFactory.newJMXConnectorServer(url, null, mbs);
			//Start the RMI connector server
			echo("Start the RMI connector server");
			cs.start();
			echo("\nThe RMI connector server successfully started");
			echo("and is ready to handle incoming connections");
		    echo("\nStart the client on a different window and");
		    echo("press <Enter> once the client has finished");
			waitForEnterPressed();
			
			//Stop the RMI connector server
			echo("Stop the RMI connector server");
			cs.stop();
			echo("Bye!");
		}catch(Exception e){
			e.printStackTrace();
		}

	}