org.logicalcobwebs.proxool.admin.jmx
Class ProxoolJMXHelper

java.lang.Object
  extended byorg.logicalcobwebs.proxool.admin.jmx.ProxoolJMXHelper

public class ProxoolJMXHelper
extends java.lang.Object

Utilities for Proxool JMX instrumentation.

Since:
Proxool 0.8
Version:
$Revision: 1.6 $, $Date: 2003/05/06 23:15:56 $
Author:
Christian Nedregaard (christian_nedregaard@email.com), $Author: chr32 $ (current maintainer)

Method Summary
static ObjectName getObjectName(java.lang.String alias)
          Get the prefered JMX object name for a Proxool pool.
static java.lang.String getValidIdentifier(java.lang.String propertyName)
          Generate a valid JMX identifier attribute name from a Proxool property name.
static void registerPool(java.lang.String alias, java.util.Properties poolPropeties)
          Create and register a ConnectionPoolMBean to the given agents.
static void unregisterPool(java.lang.String alias, java.util.Properties poolPropeties)
          Unregister a ConnectionPoolMBean from the given agents.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

registerPool

public static void registerPool(java.lang.String alias,
                                java.util.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(java.lang.String alias,
                                  java.util.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.

getObjectName

public static ObjectName getObjectName(java.lang.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.
Throws:
javax.management.MalformedObjectNameException - if the creation of the object name fails.
MalformedObjectNameException

getValidIdentifier

public static java.lang.String getValidIdentifier(java.lang.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.