/** * Try to get a connection to the specified jmx url * @param jmxUrl the jmx url * @param attributes jmx connection attributes * @param wait if true wait the current thread until the end of the connection attempt * @return a jmx connection */ public MBeanServerConnection getConnection(String jmxUrl, Hashtable attributes, boolean wait) { JMXMonConnection connection = (JMXMonConnection)pool.get(jmxUrl); if (connection == null) { connection = new JMXMonConnection(jmxUrl); pool.put(jmxUrl, connection); } return connection.connect(attributes, wait); }
/** * Allow external class to notify the pool that the connection identified by the provided * jmx url is closed/in error * @param url the jmx url */ public void notifyConnectionDirty(String url) { JMXMonConnection connection = (JMXMonConnection)pool.get(url); if (connection != null){ connection.setNewActiveConnection(null, null); } }
/** * Check if a connection already exists if true it will return the * existing connection else it will attempt a new connection * @param attributes jmx connection attributes * @param wait if true wait the current thread until the end of the connection attempt * @return a jmx connection or null */ protected MBeanServerConnection connect(Hashtable attributes, boolean wait) { if (connection != null){ log.debug("Reused the same connection for url = " + jmxUrl); return connection; } if (!connectionAttemptFlag) tryConnect(attributes, wait); return connection; }
/** * Check if a connection already exists if true it will return the * existing connection else it will attempt a new connection * @param attributes jmx connection attributes * @param wait if true wait the current thread until the end of the connection attempt * @return a jmx connection or null */ protected MBeanServerConnection connect(Hashtable attributes, boolean wait) { if (connection != null){ log.debug("Reused the same connection for url = " + jmxUrl); return connection; } if (!connectionAttemptFlag) tryConnect(attributes, wait); return connection; }
/** * Try to get a connection to the specified jmx url * @param jmxUrl the jmx url * @param attributes jmx connection attributes * @param wait if true wait the current thread until the end of the connection attempt * @return a jmx connection */ public MBeanServerConnection getConnection(String jmxUrl, Hashtable attributes, boolean wait) { JMXMonConnection connection = (JMXMonConnection)pool.get(jmxUrl); if (connection == null) { connection = new JMXMonConnection(jmxUrl); pool.put(jmxUrl, connection); } return connection.connect(attributes, wait); }
/** * Allow external class to notify the pool that the connection identified by the provided * jmx url is closed/in error * @param url the jmx url */ public void notifyConnectionDirty(String url) { JMXMonConnection connection = (JMXMonConnection)pool.get(url); if (connection != null){ connection.setNewActiveConnection(null, null); } }