@Test public void testJMXRegistrationWithNetty() throws Exception { String originalServerCnxnFactory = System .getProperty(ServerCnxnFactory.ZOOKEEPER_SERVER_CNXN_FACTORY); System.setProperty(ServerCnxnFactory.ZOOKEEPER_SERVER_CNXN_FACTORY, NettyServerCnxnFactory.class.getName()); try { ClientBase.setupTestEnv(); File tmpDir_1 = ClientBase.createTmpDir(); ServerCnxnFactory server_1 = startServer(tmpDir_1); File tmpDir_2 = ClientBase.createTmpDir(); ServerCnxnFactory server_2 = startServer(tmpDir_2); server_1.shutdown(); server_2.shutdown(); deleteFile(tmpDir_1); deleteFile(tmpDir_2); } finally { if (originalServerCnxnFactory == null || originalServerCnxnFactory.isEmpty()) { System.clearProperty(ServerCnxnFactory.ZOOKEEPER_SERVER_CNXN_FACTORY); } else { System.setProperty( ServerCnxnFactory.ZOOKEEPER_SERVER_CNXN_FACTORY, originalServerCnxnFactory); } } }
protected void shutdown() { if (containerManager != null) { containerManager.stop(); } if (cnxnFactory != null) { cnxnFactory.shutdown(); } if (secureCnxnFactory != null) { secureCnxnFactory.shutdown(); } try { if (adminServer != null) { adminServer.shutdown(); } } catch (AdminServerException e) { LOG.warn("Problem stopping AdminServer", e); } }
ZooKeeperServerMain { protected void shutdown() { if (containerManager != null) { containerManager.stop(); } if (cnxnFactory != null) { cnxnFactory.shutdown(); } if (secureCnxnFactory != null) { secureCnxnFactory.shutdown(); } try { if (adminServer != null) { adminServer.shutdown(); } } catch (AdminServerException e) { LOG.warn("Problem stopping AdminServer", e); } } }
ZooKeeperServerMain { protected void shutdown() { if (containerManager != null) { containerManager.stop(); } if (cnxnFactory != null) { cnxnFactory.shutdown(); } if (secureCnxnFactory != null) { secureCnxnFactory.shutdown(); } try { if (adminServer != null) { adminServer.shutdown(); } } catch (AdminServerException e) { LOG.warn("Problem stopping AdminServer", e); } }  }
ZooKeeperServerMain { protected void shutdown() { if (containerManager != null) { containerManager.stop(); } if (cnxnFactory != null) { cnxnFactory.shutdown(); } if (secureCnxnFactory != null) { secureCnxnFactory.shutdown(); } try { if (adminServer != null) { adminServer.shutdown(); } } catch (AdminServerException e) { LOG.warn("Problem stopping AdminServer", e); } }  static void main(String[] args); void runFromConfig(ServerConfig config); }
ZooKeeperServerMain { protected void shutdown() { if (containerManager != null) { containerManager.stop(); } if (cnxnFactory != null) { cnxnFactory.shutdown(); } if (secureCnxnFactory != null) { secureCnxnFactory.shutdown(); } try { if (adminServer != null) { adminServer.shutdown(); } } catch (AdminServerException e) { LOG.warn("Problem stopping AdminServer", e); } }  static void main(String[] args); void runFromConfig(ServerConfig config);  }