org.logicalcobwebs.proxool.admin.jmx
Class ProxoolJMXHelper

java.lang.Object
  extended by org.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)

Field Summary
private static Log LOG
           
 
Constructor Summary
private ProxoolJMXHelper()
           
 
Method Summary
private static java.lang.String[] getAgentIds(java.util.Properties poolPropeties)
           
static javax.management.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
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LOG

private static final Log LOG
Constructor Detail

ProxoolJMXHelper

private ProxoolJMXHelper()
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 javax.management.ObjectName getObjectName(java.lang.String alias)
                                                 throws javax.management.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.

getAgentIds

private static java.lang.String[] getAgentIds(java.util.Properties poolPropeties)

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.