Package org.logicalcobwebs.proxool

Examples of org.logicalcobwebs.proxool.ConnectionPoolDefinitionIF


    }

    @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";
        }
View Full Code Here


        Properties newInfo = new Properties();
        newInfo.setProperty(ProxoolConstants.PROTOTYPE_COUNT_PROPERTY, "3");
        ProxoolFacade.updateConnectionPool(url, newInfo);

        final ConnectionPoolDefinitionIF cpd = ProxoolFacade.getConnectionPoolDefinition(alias);
        assertNotNull("definition is null", cpd);
        assertEquals("prototypeCount", 3, cpd.getPrototypeCount());

    }
View Full Code Here

        info.setProperty(ProxoolConstants.STATISTICS_LOG_LEVEL_PROPERTY, ProxoolConstants.STATISTICS_LOG_LEVEL_DEBUG);

        // Register pool
        ProxoolFacade.registerConnectionPool(url, info);

        ConnectionPoolDefinitionIF cpd = ProxoolFacade.getConnectionPoolDefinition(alias);
        Admin admin = new Admin(cpd);

        final int loops = 100000;
        long start = System.currentTimeMillis();
        for (int i = 0; i < loops; i++) {
View Full Code Here

     * Will log errors instead of throwing exceptions if one or more of the registrations fails.
     * @param poolPropeties the complete pool properties.
     * @throws org.logicalcobwebs.proxool.ProxoolException if the pool can not be found.
     */
    public static void registerPool(String alias, Properties poolPropeties) throws ProxoolException {
        ConnectionPoolDefinitionIF connectionPoolDefinition =
                ProxoolFacade.getConnectionPoolDefinition(alias);
        String[] agentIds = getAgentIds(poolPropeties);
        ArrayList servers = null;
        for (int i = 0; i < agentIds.length; i++) {
            servers = MBeanServerFactory.findMBeanServer(agentIds[i]);
            if (servers == null || servers.size() < 1) {
                LOG.error("Could not register pool " + connectionPoolDefinition.getAlias() + " for JMX instrumentation"
                        + " because lookup of MBeanServer using agent id " + agentIds[i] + " failed.");
            } else {
                MBeanServer mBeanServer = (MBeanServer) servers.get(0);
                ConnectionPoolMBean poolMBean = new ConnectionPoolMBean(alias, poolPropeties);

                try {
                    mBeanServer.registerMBean(poolMBean, getObjectName(connectionPoolDefinition.getAlias()));
                    LOG.info("Registered JMX MBean for pool " + connectionPoolDefinition.getAlias() + " in agent " + agentIds[i]);
                } catch (Exception e) {
                    LOG.error("Registration of JMX MBean for pool " + connectionPoolDefinition.getAlias()
                            + "in agent " + agentIds[i] + " failed.", e);
                }
            }
        }
    }
View Full Code Here

TOP

Related Classes of org.logicalcobwebs.proxool.ConnectionPoolDefinitionIF

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.