org.logicalcobwebs.proxool.admin.jmx

Class ConnectionPoolMBean

Implemented Interfaces:
DynamicMBean, MBeanRegistration, NotificationBroadcaster, ConfigurationListenerIF, ProxoolListenerIF

public class ConnectionPoolMBean
extends java.lang.Object
implements DynamicMBean, MBeanRegistration, NotificationBroadcaster, ProxoolListenerIF, ConfigurationListenerIF

JMX DynamicMBean adapter for a Proxool connection pool.
See the configuration documentation to learn how to activate a pool for JMX. No programming is necessary to do this.

Attributes

Operations

Notifications

Version:
$Revision: 1.16 $, $Date: 2007/06/19 11:33:36 $
Authors:
Christian Nedregaard (christian_nedregaard@email.com)
$Author: billhorsman $ (current maintainer)
Since:
Proxool 0.8

Field Summary

static String
NOTIFICATION_TYPE_DEFINITION_UPDATED
Notification type emitted when the pool definition is updated.

Constructor Summary

ConnectionPoolMBean(String alias, Properties poolProperties)

Method Summary

void
addNotificationListener(NotificationListener notificationListener, NotificationFilter notificationFilter, Object handBack)
void
definitionUpdated(ConnectionPoolDefinitionIF connectionPoolDefinition, Properties completeInfo, Properties changedInfo)
Update the attributes of this MBean and emit a NOTIFICATION_TYPE_DEFINITION_UPDATED event.
Object
getAttribute(String attributeName)
AttributeList
getAttributes(String[] attributeNames)
MBeanInfo
getMBeanInfo()
MBeanNotificationInfo[]
getNotificationInfo()
Object
invoke(String operationName, params[] , signature[] )
void
onRegistration(ConnectionPoolDefinitionIF connectionPoolDefinition, Properties completeInfo)
Not used.
void
onShutdown(String alias)
If the given alias equals this pools alias: Unregister this JMX bean.
void
postDeregister()
void
postRegister(Boolean success)
void
preDeregister()
ObjectName
preRegister(MBeanServer mBeanServer, ObjectName objectName)
void
removeNotificationListener(NotificationListener notificationListener)
void
setAttribute(Attribute attribute)
AttributeList
setAttributes(AttributeList attributes)

Field Details

NOTIFICATION_TYPE_DEFINITION_UPDATED

public static final String NOTIFICATION_TYPE_DEFINITION_UPDATED
Notification type emitted when the pool definition is updated.

Constructor Details

ConnectionPoolMBean

public ConnectionPoolMBean(String alias,
                           Properties poolProperties)
            throws ProxoolException

Method Details

addNotificationListener

public void addNotificationListener(NotificationListener notificationListener,
                                    NotificationFilter notificationFilter,
                                    Object handBack)
            throws IllegalArgumentException
See Also:
javax.management.NotificationBroadcaster.addNotificationListener(javax.management.NotificationListener, javax.management.NotificationFilter, java.lang.Object)

definitionUpdated

public void definitionUpdated(ConnectionPoolDefinitionIF connectionPoolDefinition,
                              Properties completeInfo,
                              Properties changedInfo)
Update the attributes of this MBean and emit a NOTIFICATION_TYPE_DEFINITION_UPDATED event.
Specified by:
definitionUpdated in interface ConfigurationListenerIF
See Also:
org.logicalcobwebs.proxool.ConfigurationListenerIF.definitionUpdated(org.logicalcobwebs.proxool.ConnectionPoolDefinitionIF, java.util.Properties, java.util.Properties)

getAttribute

public Object getAttribute(String attributeName)
            throws AttributeNotFoundException,
                   MBeanException,
                   ReflectionException
See Also:
javax.management.DynamicMBean.getAttribute(java.lang.String)

getAttributes

public AttributeList getAttributes(String[] attributeNames)
See Also:
javax.management.DynamicMBean.getAttributes(java.lang.String[])

getMBeanInfo

public MBeanInfo getMBeanInfo()
See Also:
javax.management.DynamicMBean.getMBeanInfo()

getNotificationInfo

public MBeanNotificationInfo[] getNotificationInfo()
See Also:
javax.management.NotificationBroadcaster.getNotificationInfo()

invoke

public Object invoke(String operationName,
                     params[] ,
                     signature[] )
            throws MBeanException,
                   ReflectionException
See Also:
javax.management.DynamicMBean.invoke(java.lang.String, java.lang.Object[], java.lang.String[])

onRegistration

public void onRegistration(ConnectionPoolDefinitionIF connectionPoolDefinition,
                           Properties completeInfo)
Not used.
Specified by:
onRegistration in interface ProxoolListenerIF
See Also:
org.logicalcobwebs.proxool.ProxoolListenerIF.onRegistration(org.logicalcobwebs.proxool.ConnectionPoolDefinitionIF, java.util.Properties)

onShutdown

public void onShutdown(String alias)
If the given alias equals this pools alias: Unregister this JMX bean.
Specified by:
onShutdown in interface ProxoolListenerIF
See Also:
org.logicalcobwebs.proxool.ProxoolListenerIF.onShutdown(java.lang.String)

postDeregister

public void postDeregister()
See Also:
javax.management.MBeanRegistration.postDeregister()

postRegister

public void postRegister(Boolean success)
See Also:
javax.management.MBeanRegistration.postRegister(java.lang.Boolean)

preDeregister

public void preDeregister()
            throws Exception
See Also:
javax.management.MBeanRegistration.preDeregister()

preRegister

public ObjectName preRegister(MBeanServer mBeanServer,
                              ObjectName objectName)
            throws Exception
See Also:
javax.management.MBeanRegistration.preRegister(javax.management.MBeanServer, javax.management.ObjectName)

removeNotificationListener

public void removeNotificationListener(NotificationListener notificationListener)
            throws ListenerNotFoundException
See Also:
javax.management.NotificationBroadcaster.removeNotificationListener(javax.management.NotificationListener)

setAttribute

public void setAttribute(Attribute attribute)
            throws AttributeNotFoundException,
                   InvalidAttributeValueException,
                   MBeanException,
                   ReflectionException
See Also:
javax.management.DynamicMBean.setAttribute(javax.management.Attribute)

setAttributes

public AttributeList setAttributes(AttributeList attributes)
See Also:
javax.management.DynamicMBean.setAttributes(javax.management.AttributeList)