/* */
/* 102 */ System.setProperty("jboss.identity", String.valueOf(System.currentTimeMillis()));
/* */
/* 104 */ MBeanServer server = MBeanServerFactory.createMBeanServer();
/* */
/* 106 */ NetworkRegistry registry = NetworkRegistry.getInstance();
/* 107 */ server.registerMBean(registry, new ObjectName("remoting:type=NetworkRegistry"));
/* */
/* 109 */ InvokerLocator locator = new InvokerLocator("socket://localhost");
/* */
/* 116 */ Connector connector = new Connector();
/* 117 */ connector.setInvokerLocator(locator.getLocatorURI());
/* 118 */ ObjectName obj = new ObjectName("jboss.remoting:type=Connector,transport=" + locator.getProtocol());
/* 119 */ server.registerMBean(connector, obj);
/* */
/* 121 */ connector.start();
/* */
/* 123 */ Detector detector = null;
/* 124 */ ObjectName objName = null;
/* */
/* 126 */ if (this.type.equals("multicast"))
/* */ {
/* 128 */ MulticastDetector mdet = new MulticastDetector();
/* 129 */ mdet.setPort(this.port);
/* 130 */ detector = mdet;
/* 131 */ objName = new ObjectName("remoting:type=Detector,transport=multicast");
/* */ }
/* 133 */ else if (this.type.equals("jndi"))
/* */ {
/* 135 */ JNDIDetector jdet = new JNDIDetector();
/* 136 */ jdet.setPort(this.port);
/* 137 */ jdet.setHost(this.host);
/* 138 */ jdet.setContextFactory(this.contextFactory);
/* 139 */ jdet.setURLPackage(this.urlPackage);
/* 140 */ detector = jdet;
/* 141 */ objName = new ObjectName("remoting:type=Detector,transport=jndi");
/* */ }
/* */
/* 144 */ server.registerMBean(detector, objName);
/* 145 */ detector.start();
/* 146 */ System.err.println("Starting Detector");
/* */ while (true)
/* */ {
/* 150 */ Thread.currentThread(); Thread.sleep(3000L);
/* 151 */ NetworkInstance[] instances = registry.getServers();
/* 152 */ for (int x = 0; x < instances.length; x++)
/* */ {
/* 154 */ log.debug(instances[x]);
/* */ }
/* */