org.smallmind.quorum.pool.connection.jmx
Class ConnectionPoolMonitor

java.lang.Object
  extended by javax.management.NotificationBroadcasterSupport
      extended by org.smallmind.quorum.pool.connection.jmx.ConnectionPoolMonitor
All Implemented Interfaces:
EventListener, MBeanRegistration, NotificationBroadcaster, NotificationEmitter, ConnectionPoolSurface, ConnectionPoolEventListener, ConnectionPoolMonitorMXBean

public class ConnectionPoolMonitor
extends NotificationBroadcasterSupport
implements ConnectionPoolMonitorMXBean, MBeanRegistration, ConnectionPoolEventListener


Constructor Summary
ConnectionPoolMonitor(ConnectionPool connectionPool, String registryName)
           
ConnectionPoolMonitor(ConnectionPool connectionPool, String hostName, String registryName)
           
 
Method Summary
 long getAcquireWaitTimeMillis()
           
 long getConnectionTimeoutMillis()
           
 int getFreeSize()
           
 int getInitialPoolSize()
           
 int getMaxIdleTimeSeconds()
           
 int getMaxLeaseTimeSeconds()
           
 int getMaxPoolSize()
           
 int getMinPoolSize()
           
 String getPoolName()
           
 int getPoolSize()
           
 int getProcessingSize()
           
 int getUnreturnedConnectionTimeoutSeconds()
           
 boolean isExistentiallyAware()
           
 boolean isReportLeaseTimeNanos()
           
 boolean isTestOnAcquire()
           
 boolean isTestOnConnect()
           
 void postDeregister()
           
 void postRegister(Boolean success)
           
 void preDeregister()
           
 ObjectName preRegister(MBeanServer mBeanServer, ObjectName objectName)
           
 void reportConnectionErrorOccurred(ErrorReportingConnectionPoolEvent event)
           
 void reportConnectionLeaseTime(LeaseTimeReportingConnectionPoolEvent event)
           
 void setAcquireWaitTimeMillis(long acquireWaitTimeMillis)
           
 void setConnectionTimeoutMillis(long connectionTimeoutMillis)
           
 void setExistentiallyAware(boolean existentiallyAware)
           
 void setMaxIdleTimeSeconds(int maxIdleTimeSeconds)
           
 void setMaxLeaseTimeSeconds(int leaseTimeSeconds)
           
 void setMaxPoolSize(int maxPoolSize)
           
 void setMinPoolSize(int minPoolSize)
           
 void setReportLeaseTimeNanos(boolean reportLeaseTimeNanos)
           
 void setTestOnAcquire(boolean testOnAcquire)
           
 void setTestOnConnect(boolean testOnConnect)
           
 void setUnreturnedConnectionTimeoutSeconds(int unreturnedConnectionTimeoutSeconds)
           
 void shutdown()
           
 void startup()
           
 
Methods inherited from class javax.management.NotificationBroadcasterSupport
addNotificationListener, getNotificationInfo, handleNotification, removeNotificationListener, removeNotificationListener, sendNotification
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ConnectionPoolMonitor

public ConnectionPoolMonitor(ConnectionPool connectionPool,
                             String registryName)
                      throws UnknownHostException,
                             NoSuchMethodException,
                             MalformedURLException,
                             RemoteException,
                             NamingException
Throws:
UnknownHostException
NoSuchMethodException
MalformedURLException
RemoteException
NamingException

ConnectionPoolMonitor

public ConnectionPoolMonitor(ConnectionPool connectionPool,
                             String hostName,
                             String registryName)
                      throws UnknownHostException,
                             NoSuchMethodException,
                             MalformedURLException,
                             RemoteException,
                             NamingException
Throws:
UnknownHostException
NoSuchMethodException
MalformedURLException
RemoteException
NamingException
Method Detail

preRegister

public ObjectName preRegister(MBeanServer mBeanServer,
                              ObjectName objectName)
                       throws UnknownHostException,
                              NoSuchMethodException,
                              MalformedURLException,
                              RemoteException,
                              NamingException
Specified by:
preRegister in interface MBeanRegistration
Throws:
UnknownHostException
NoSuchMethodException
MalformedURLException
RemoteException
NamingException

postRegister

public void postRegister(Boolean success)
Specified by:
postRegister in interface MBeanRegistration

preDeregister

public void preDeregister()
                   throws MalformedURLException,
                          NotBoundException,
                          RemoteException
Specified by:
preDeregister in interface MBeanRegistration
Throws:
MalformedURLException
NotBoundException
RemoteException

postDeregister

public void postDeregister()
Specified by:
postDeregister in interface MBeanRegistration

reportConnectionErrorOccurred

public void reportConnectionErrorOccurred(ErrorReportingConnectionPoolEvent event)
Specified by:
reportConnectionErrorOccurred in interface ConnectionPoolEventListener

reportConnectionLeaseTime

public void reportConnectionLeaseTime(LeaseTimeReportingConnectionPoolEvent event)
Specified by:
reportConnectionLeaseTime in interface ConnectionPoolEventListener

getPoolName

public String getPoolName()
Specified by:
getPoolName in interface ConnectionPoolSurface

startup

public void startup()
             throws ConnectionPoolException
Specified by:
startup in interface ConnectionPoolSurface
Throws:
ConnectionPoolException

shutdown

public void shutdown()
              throws ConnectionPoolException
Specified by:
shutdown in interface ConnectionPoolSurface
Throws:
ConnectionPoolException

isTestOnConnect

public boolean isTestOnConnect()
Specified by:
isTestOnConnect in interface ConnectionPoolSurface

setTestOnConnect

public void setTestOnConnect(boolean testOnConnect)
Specified by:
setTestOnConnect in interface ConnectionPoolSurface

isTestOnAcquire

public boolean isTestOnAcquire()
Specified by:
isTestOnAcquire in interface ConnectionPoolSurface

setTestOnAcquire

public void setTestOnAcquire(boolean testOnAcquire)
Specified by:
setTestOnAcquire in interface ConnectionPoolSurface

isReportLeaseTimeNanos

public boolean isReportLeaseTimeNanos()
Specified by:
isReportLeaseTimeNanos in interface ConnectionPoolSurface

setReportLeaseTimeNanos

public void setReportLeaseTimeNanos(boolean reportLeaseTimeNanos)
Specified by:
setReportLeaseTimeNanos in interface ConnectionPoolSurface

isExistentiallyAware

public boolean isExistentiallyAware()
Specified by:
isExistentiallyAware in interface ConnectionPoolSurface

setExistentiallyAware

public void setExistentiallyAware(boolean existentiallyAware)
Specified by:
setExistentiallyAware in interface ConnectionPoolSurface

getConnectionTimeoutMillis

public long getConnectionTimeoutMillis()
Specified by:
getConnectionTimeoutMillis in interface ConnectionPoolSurface

setConnectionTimeoutMillis

public void setConnectionTimeoutMillis(long connectionTimeoutMillis)
Specified by:
setConnectionTimeoutMillis in interface ConnectionPoolSurface

getInitialPoolSize

public int getInitialPoolSize()
Specified by:
getInitialPoolSize in interface ConnectionPoolSurface

getMinPoolSize

public int getMinPoolSize()
Specified by:
getMinPoolSize in interface ConnectionPoolSurface

setMinPoolSize

public void setMinPoolSize(int minPoolSize)
Specified by:
setMinPoolSize in interface ConnectionPoolSurface

getMaxPoolSize

public int getMaxPoolSize()
Specified by:
getMaxPoolSize in interface ConnectionPoolSurface

setMaxPoolSize

public void setMaxPoolSize(int maxPoolSize)
Specified by:
setMaxPoolSize in interface ConnectionPoolSurface

getAcquireWaitTimeMillis

public long getAcquireWaitTimeMillis()
Specified by:
getAcquireWaitTimeMillis in interface ConnectionPoolSurface

setAcquireWaitTimeMillis

public void setAcquireWaitTimeMillis(long acquireWaitTimeMillis)
Specified by:
setAcquireWaitTimeMillis in interface ConnectionPoolSurface

getMaxLeaseTimeSeconds

public int getMaxLeaseTimeSeconds()
Specified by:
getMaxLeaseTimeSeconds in interface ConnectionPoolSurface

setMaxLeaseTimeSeconds

public void setMaxLeaseTimeSeconds(int leaseTimeSeconds)
Specified by:
setMaxLeaseTimeSeconds in interface ConnectionPoolSurface

getMaxIdleTimeSeconds

public int getMaxIdleTimeSeconds()
Specified by:
getMaxIdleTimeSeconds in interface ConnectionPoolSurface

setMaxIdleTimeSeconds

public void setMaxIdleTimeSeconds(int maxIdleTimeSeconds)
Specified by:
setMaxIdleTimeSeconds in interface ConnectionPoolSurface

getUnreturnedConnectionTimeoutSeconds

public int getUnreturnedConnectionTimeoutSeconds()
Specified by:
getUnreturnedConnectionTimeoutSeconds in interface ConnectionPoolSurface

setUnreturnedConnectionTimeoutSeconds

public void setUnreturnedConnectionTimeoutSeconds(int unreturnedConnectionTimeoutSeconds)
Specified by:
setUnreturnedConnectionTimeoutSeconds in interface ConnectionPoolSurface

getPoolSize

public int getPoolSize()
Specified by:
getPoolSize in interface ConnectionPoolSurface

getFreeSize

public int getFreeSize()
Specified by:
getFreeSize in interface ConnectionPoolSurface

getProcessingSize

public int getProcessingSize()
Specified by:
getProcessingSize in interface ConnectionPoolSurface


Copyright © 2011. All Rights Reserved.