@Override public String toString() { try { ConnectionPoolDefinitionIF poolDef = ProxoolFacade.getConnectionPoolDefinition("openfire"); SnapshotIF poolStats = ProxoolFacade.getSnapshot("openfire", true); return poolDef.getMinimumConnectionCount() + "," + poolDef.getMaximumConnectionCount() + "," + poolStats.getAvailableConnectionCount() + "," + poolStats.getActiveConnectionCount(); } catch (ProxoolException e) { return "Default Connection Provider"; } }
public static void resetDBCheck() { String threshold = TroubleshootingBootstrapper.DB_CHECK_THRESHOLD; String pollTime = TroubleshootingBootstrapper.DB_CHECK_POLL_TIME; if (dbCheckerScheduledFuture != null) { dbCheckerScheduledFuture.cancel(true); } List<DBPoolInfo> dbPools = new ArrayList<DBPoolInfo>(); String[] aliases = ProxoolFacade.getAliases(); if (aliases != null) { for (String alias : aliases) { DBPoolInfo info = null; if (threshold.endsWith("%")) { info = new DBPoolInfo( alias, Double.parseDouble(threshold.substring(0, threshold.length() - 1))); } else { info = new DBPoolInfo(alias, Integer.parseInt(threshold)); } dbPools.add(info); } } DBChecker dbChecker = new DBChecker(dbPools, Eucalyptus.class, Long.parseLong(pollTime)); dbCheckerScheduledFuture = DBResourceCheck.start(dbChecker); }
public void destroy() { ProxoolFacade.shutdown(); }