org.logicalcobwebs.proxool.admin.jmx
Class ConnectionPoolMBean

java.lang.Object
  extended byorg.logicalcobwebs.proxool.admin.jmx.ConnectionPoolMBean
All Implemented Interfaces:
ConfigurationListenerIF, ProxoolListenerIF

public class ConnectionPoolMBean
extends java.lang.Object
implements 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

Since:
Proxool 0.8
Version:
$Revision: 1.14 $, $Date: 2003/10/20 07:37:07 $
Author:
Christian Nedregaard (christian_nedregaard@email.com), $Author: chr32 $ (current maintainer)

Field Summary
static java.lang.String NOTIFICATION_TYPE_DEFINITION_UPDATED
          Notification type emitted when the pool definition is updated.
 
Constructor Summary
ConnectionPoolMBean(java.lang.String alias, java.util.Properties poolProperties)
           
 
Method Summary
 void addNotificationListener(NotificationListener notificationListener, NotificationFilter notificationFilter, java.lang.Object handBack)
           
 void definitionUpdated(ConnectionPoolDefinitionIF connectionPoolDefinition, java.util.Properties completeInfo, java.util.Properties changedInfo)
          Update the attributes of this MBean and emit a NOTIFICATION_TYPE_DEFINITION_UPDATED event.
 java.lang.Object getAttribute(java.lang.String attributeName)
           
 AttributeList getAttributes(java.lang.String[] attributeNames)
           
 MBeanInfo getMBeanInfo()
           
 MBeanNotificationInfo[] getNotificationInfo()
           
 java.lang.Object invoke(java.lang.String operationName, java.lang.Object[] params, java.lang.String[] signature)
           
 void onRegistration(ConnectionPoolDefinitionIF connectionPoolDefinition, java.util.Properties completeInfo)
          Not used.
 void onShutdown(java.lang.String alias)
          If the given alias equals this pools alias: Unregister this JMX bean.
 void postDeregister()
           
 void postRegister(java.lang.Boolean success)
           
 void preDeregister()
           
 ObjectName preRegister(MBeanServer mBeanServer, ObjectName objectName)
           
 void removeNotificationListener(NotificationListener notificationListener)
           
 void setAttribute(Attribute attribute)
           
 AttributeList setAttributes(AttributeList attributes)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

NOTIFICATION_TYPE_DEFINITION_UPDATED

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

See Also:
Constant Field Values
Constructor Detail

ConnectionPoolMBean

public ConnectionPoolMBean(java.lang.String alias,
                           java.util.Properties poolProperties)
                    throws ProxoolException
Method Detail

getAttribute

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

setAttribute

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

getAttributes

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

setAttributes

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

invoke

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

getMBeanInfo

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

onRegistration

public void onRegistration(ConnectionPoolDefinitionIF connectionPoolDefinition,
                           java.util.Properties completeInfo)
Not used.

Specified by:
onRegistration in interface ProxoolListenerIF
Parameters:
connectionPoolDefinition - the new definition.
completeInfo - the properties that could be used to create this definition.
See Also:
ProxoolListenerIF.onRegistration(org.logicalcobwebs.proxool.ConnectionPoolDefinitionIF, java.util.Properties)

onShutdown

public void onShutdown(java.lang.String alias)
If the given alias equals this pools alias: Unregister this JMX bean.

Specified by:
onShutdown in interface ProxoolListenerIF
Parameters:
alias - the alias of the pool about to be shut down.
See Also:
ProxoolListenerIF.onShutdown(java.lang.String)

definitionUpdated

public void definitionUpdated(ConnectionPoolDefinitionIF connectionPoolDefinition,
                              java.util.Properties completeInfo,
                              java.util.Properties changedInfo)
Update the attributes of this MBean and emit a NOTIFICATION_TYPE_DEFINITION_UPDATED event.

Specified by:
definitionUpdated in interface ConfigurationListenerIF
Parameters:
connectionPoolDefinition - the new definition
completeInfo - the properties that could be used to create this definition
changedInfo - only the properties that have changed since the pool was registered, or this method was las called.
See Also:
ConfigurationListenerIF.definitionUpdated(org.logicalcobwebs.proxool.ConnectionPoolDefinitionIF, java.util.Properties, java.util.Properties)

addNotificationListener

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

removeNotificationListener

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

getNotificationInfo

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

preRegister

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

postRegister

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

preDeregister

public void preDeregister()
                   throws java.lang.Exception
Throws:
java.lang.Exception
See Also:
javax.management.MBeanRegistration#preDeregister()

postDeregister

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