org.logicalcobwebs.proxool.admin.jmx

Class ProxoolJMXHelper


public class ProxoolJMXHelper
extends java.lang.Object

Utilities for Proxool JMX instrumentation.
Version:
$Revision: 1.7 $, $Date: 2006/01/18 14:39:56 $
Authors:
Christian Nedregaard (christian_nedregaard@email.com)
$Author: billhorsman $ (current maintainer)
Since:
Proxool 0.8

Method Summary

static ObjectName
getObjectName(String alias)
Get the prefered JMX object name for a Proxool pool.
static String
getValidIdentifier(String propertyName)
Generate a valid JMX identifier attribute name from a Proxool property name.
static void
registerPool(String alias, Properties poolPropeties)
Create and register a ConnectionPoolMBean to the given agents.
static void
unregisterPool(String alias, Properties poolPropeties)
Unregister a ConnectionPoolMBean from the given agents.

Method Details

getObjectName

public static ObjectName getObjectName(String alias)
            throws MalformedObjectNameException
Get the prefered JMX object name for a Proxool pool.
Parameters:
alias - the alias of the pool.
Returns:
the generated object name.

getValidIdentifier

public static String getValidIdentifier(String propertyName)
Generate a valid JMX identifier attribute name from a Proxool property name. This basically involves changing all occurences of -<char> to <uppercase char>.
driver-properties will for instance become driverProperties.
Parameters:
propertyName - the name to be converted.
Returns:
the converted attribute name.

registerPool

public static void registerPool(String alias,
                                Properties poolPropeties)
            throws ProxoolException
Create and register a ConnectionPoolMBean to the given agents. Will log errors instead of throwing exceptions if one or more of the registrations fails.
Parameters:
poolPropeties - the complete pool properties.
Throws:
ProxoolException - if the pool can not be found.

unregisterPool

public static void unregisterPool(String alias,
                                  Properties poolPropeties)
Unregister a ConnectionPoolMBean from the given agents. Will log errors instead of throwing exceptions if one or more of the unregistrations fails.
Parameters:
poolPropeties - the complete pool properties.