net.dataforte.cassandra.pool.jmx
Class ConnectionPoolMBean

java.lang.Object
  extended by javax.management.NotificationBroadcasterSupport
      extended by net.dataforte.cassandra.pool.jmx.ConnectionPoolMBean
All Implemented Interfaces:
DynamicMBean, NotificationBroadcaster, NotificationEmitter

public class ConnectionPoolMBean
extends NotificationBroadcasterSupport
implements DynamicMBean


Field Summary
protected  ConcurrentLinkedQueue<NotificationListener> listeners
          Listeners that are local and interested in our notifications, no need for JMX
static String NOTIFY_ABANDON
           
static String NOTIFY_CONNECT
           
static String NOTIFY_INIT
           
protected  ConnectionPool pool
          the connection pool
protected  AtomicInteger sequence
          sequence for JMX notifications
static String SUSPECT_ABANDONED_NOTIFICATION
           
 
Constructor Summary
ConnectionPoolMBean(ConnectionPool pool)
           
 
Method Summary
 void addListener(NotificationListener list)
           
 void checkAbandoned()
           
 void checkIdle()
           
 Object getAttribute(String attribute)
           
 AttributeList getAttributes(String[] attributes)
           
static MBeanNotificationInfo[] getDefaultNotificationInfo()
           
 MBeanInfo getMBeanInfo()
           
 MBeanNotificationInfo[] getNotificationInfo()
           
 ConnectionPool getPool()
           
 PoolConfiguration getPoolProperties()
           
 Object invoke(String actionName, Object[] params, String[] signature)
           
 boolean notify(String type, String message)
          Return true if the notification was sent successfully, false otherwise.
 boolean removeListener(NotificationListener list)
           
 void setAttribute(Attribute attribute)
           
 AttributeList setAttributes(AttributeList attributes)
           
 void testIdle()
           
 
Methods inherited from class javax.management.NotificationBroadcasterSupport
addNotificationListener, handleNotification, removeNotificationListener, removeNotificationListener, sendNotification
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

pool

protected ConnectionPool pool
the connection pool


sequence

protected AtomicInteger sequence
sequence for JMX notifications


listeners

protected ConcurrentLinkedQueue<NotificationListener> listeners
Listeners that are local and interested in our notifications, no need for JMX


NOTIFY_INIT

public static final String NOTIFY_INIT
See Also:
Constant Field Values

NOTIFY_CONNECT

public static final String NOTIFY_CONNECT
See Also:
Constant Field Values

NOTIFY_ABANDON

public static final String NOTIFY_ABANDON
See Also:
Constant Field Values

SUSPECT_ABANDONED_NOTIFICATION

public static final String SUSPECT_ABANDONED_NOTIFICATION
See Also:
Constant Field Values
Constructor Detail

ConnectionPoolMBean

public ConnectionPoolMBean(ConnectionPool pool)
Method Detail

getPool

public ConnectionPool getPool()

getPoolProperties

public PoolConfiguration getPoolProperties()

invoke

public Object invoke(String actionName,
                     Object[] params,
                     String[] signature)
              throws MBeanException,
                     ReflectionException
Specified by:
invoke in interface DynamicMBean
Throws:
MBeanException
ReflectionException

getMBeanInfo

public MBeanInfo getMBeanInfo()
Specified by:
getMBeanInfo in interface DynamicMBean

setAttribute

public void setAttribute(Attribute attribute)
                  throws AttributeNotFoundException,
                         InvalidAttributeValueException,
                         MBeanException
Specified by:
setAttribute in interface DynamicMBean
Throws:
AttributeNotFoundException
InvalidAttributeValueException
MBeanException

setAttributes

public AttributeList setAttributes(AttributeList attributes)
Specified by:
setAttributes in interface DynamicMBean

getAttribute

public Object getAttribute(String attribute)
                    throws AttributeNotFoundException,
                           MBeanException
Specified by:
getAttribute in interface DynamicMBean
Throws:
AttributeNotFoundException
MBeanException

getAttributes

public AttributeList getAttributes(String[] attributes)
Specified by:
getAttributes in interface DynamicMBean

getNotificationInfo

public MBeanNotificationInfo[] getNotificationInfo()
Specified by:
getNotificationInfo in interface NotificationBroadcaster
Overrides:
getNotificationInfo in class NotificationBroadcasterSupport

getDefaultNotificationInfo

public static MBeanNotificationInfo[] getDefaultNotificationInfo()

notify

public boolean notify(String type,
                      String message)
Return true if the notification was sent successfully, false otherwise.

Parameters:
type -
message -
Returns:
true if the notification succeeded

addListener

public void addListener(NotificationListener list)

removeListener

public boolean removeListener(NotificationListener list)

checkIdle

public void checkIdle()

checkAbandoned

public void checkAbandoned()

testIdle

public void testIdle()


Copyright © 2011. All Rights Reserved.