@Test public void testCloseAll() throws Exception { Hashtable attributes = new Hashtable(); String[] buffer = {"", ""}; attributes.put("jmx.remote.credentials", (String[]) buffer); JMXMonConnectionPool testSubject; testSubject = createTestSubject(); testSubject.getConnection(jmxUrlOk, null); testSubject.getConnection(jmxUrlOk2, attributes); testSubject.getConnection(jmxUrlOk3, null); testSubject.getConnection(jmxUrlOk4, attributes); testSubject.getConnection(jmxUrlOk, null); testSubject.getConnection(jmxUrlOk, attributes); testSubject.getConnection(jmxUrlOk, null); testSubject.getConnection(jmxUrlOk, attributes); testSubject.notifyConnectionDirty("test"); testSubject.notifyConnectionDirty("test2"); testSubject.closeAll(); }
public void closeAll() { for (Object connection : pool.values()) { JMXMonConnection jmxcon = (JMXMonConnection)connection; if (jmxcon.connector != null) { try { jmxcon.connector.close(); log.debug("jmx connector is closed"); } catch (Exception ex) { log.debug("Can't close jmx connector, but continue"); } } else { log.debug("jmxConnector == null, don't try to close connection"); } jmxcon.connector = null; jmxcon = null; } pool.clear(); }
JMXMonConnectionPool { public void closeAll() { for (Object connection : pool.values()) { JMXMonConnection jmxcon = (JMXMonConnection)connection; if (jmxcon.connector != null) { try { jmxcon.connector.close(); log.debug("jmx connector is closed"); } catch (Exception ex) { log.debug("Can't close jmx connector, but continue"); } } else { log.debug("jmxConnector == null, don't try to close connection"); } jmxcon.connector = null; jmxcon = null; } pool.clear(); } }
JMXMonConnectionPool { public void closeAll() { for (Object connection : pool.values()) { JMXMonConnection jmxcon = (JMXMonConnection)connection; if (jmxcon.connector != null) { try { jmxcon.connector.close(); log.debug("jmx connector is closed"); } catch (Exception ex) { log.debug("Can't close jmx connector, but continue"); } } else { log.debug("jmxConnector == null, don't try to close connection"); } jmxcon.connector = null; jmxcon = null; } pool.clear(); } JMXMonConnectionPool(); }
JMXMonConnectionPool { public void closeAll() { for (Object connection : pool.values()) { JMXMonConnection jmxcon = (JMXMonConnection)connection; if (jmxcon.connector != null) { try { jmxcon.connector.close(); log.debug("jmx connector is closed"); } catch (Exception ex) { log.debug("Can't close jmx connector, but continue"); } } else { log.debug("jmxConnector == null, don't try to close connection"); } jmxcon.connector = null; jmxcon = null; } pool.clear(); } JMXMonConnectionPool(); MBeanServerConnection getConnection(String jmxUrl, Hashtable attributes); MBeanServerConnection getConnection(String jmxUrl, Hashtable attributes, boolean wait); void closeAll(); void notifyConnectionDirty(String url); }
JMXMonConnectionPool { public void closeAll() { for (Object connection : pool.values()) { JMXMonConnection jmxcon = (JMXMonConnection)connection; if (jmxcon.connector != null) { try { jmxcon.connector.close(); log.debug("jmx connector is closed"); } catch (Exception ex) { log.debug("Can't close jmx connector, but continue"); } } else { log.debug("jmxConnector == null, don't try to close connection"); } jmxcon.connector = null; jmxcon = null; } pool.clear(); } JMXMonConnectionPool(); MBeanServerConnection getConnection(String jmxUrl, Hashtable attributes); MBeanServerConnection getConnection(String jmxUrl, Hashtable attributes, boolean wait); void closeAll(); void notifyConnectionDirty(String url);  }