Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.jboss.resource.connectionmanager
Class JBossManagedConnectionPool

    java.lang.Object
      org.jboss.mx.util.JBossNotificationBroadcasterSupport
          org.jboss.system.ServiceMBeanSupport
              org.jboss.resource.connectionmanager.JBossManagedConnectionPool

All Implemented Interfaces:
  EventListener, JBossManagedConnectionPoolMBean, javax.management.MBeanRegistration, javax.management.NotificationBroadcaster, javax.management.NotificationEmitter, javax.management.NotificationListener, org.jboss.system.Service, org.jboss.system.ServiceMBean

public class JBossManagedConnectionPool
extends org.jboss.system.ServiceMBeanSupport
implements JBossManagedConnectionPoolMBean, javax.management.NotificationListener

The JBossManagedConnectionPool mbean configures and supplies pooling of JBossConnectionEventListeners to the BaseConnectionManager2 mbean.

It may be replaced by any mbean with a readable ManagedConnectionPool attribute of type ManagedConnectionPool. Normal pooling parameters are supplied, and the criteria to distinguish ManagedConnections is set in the Criteria attribute.

Version:
  $Revision: 1.31 $
Author:
  David Jencks, Adrian Brock

Nested Class Summary
`static class` | `JBossManagedConnectionPool.BasePool` The base pool implementation
`static class` | `JBossManagedConnectionPool.OnePool` One pool
`static class` | `JBossManagedConnectionPool.PoolByCri` Pool by connection request information
`static class` | `JBossManagedConnectionPool.PoolBySubject` Pool by subject
`static class` | `JBossManagedConnectionPool.PoolBySubjectAndCri` Pooling by subject and connection request information

Field Summary

Fields inherited from class org.jboss.system.ServiceMBeanSupport
`log, server, SERVICE_CONTROLLER_SIG, serviceName`

Fields inherited from interface org.jboss.resource.connectionmanager.JBossManagedConnectionPoolMBean
`OBJECT_NAME`

Fields inherited from interface org.jboss.system.ServiceMBean
`CREATE_EVENT, CREATED, DESTROY_EVENT, DESTROYED, FAILED, REGISTERED, START_EVENT, STARTED, STARTING, states, STOP_EVENT, STOPPED, STOPPING, UNREGISTERED`

Constructor Summary
`JBossManagedConnectionPool()` Default managed JBossManagedConnectionPool constructor for mbeans.

Method Summary
`void` | `flush()` The `flush` method puts all currently checked out connections on a list to be destroyed when returned and disposes of all current pooled connections.
`long` | `getAvailableConnectionCount()` Get number of available free connections
`int` | `getBlockingTimeoutMillis()` The BlockingTimeoutMillis attribute indicates the maximum time to block while waiting for a connection before throwing an exception.
`int` | `getConnectionCount()` Retrieve the connection count.
`int` | `getConnectionCreatedCount()` Retrieve the connection created count.
`int` | `getConnectionDestroyedCount()` Retrieve the destrooyed count.
`String` | `getCriteria()` The Criteria attribute indicates if Subject (from security domain) or app supplied parameters (such as from getConnection(user, pw)) are used to distinguish connections in the pool.
`long` | `getIdleTimeout()` Get the IdleTimeout value.
`long` | `getIdleTimeoutMinutes()` The IdleTimeoutMinutes attribute indicates the maximum time a connection may be idle before being closed.
`long` | `getInUseConnectionCount()` Get number of connections currently in use
`javax.management.ObjectName` | `getManagedConnectionFactoryName()` ManagedConnectionFactoryName holds the ObjectName of the mbean that represents the ManagedConnectionFactory.
`ManagedConnectionPool` | `getManagedConnectionPool()` ManagedConnectionPool is a read only attribute returning the pool set up by this mbean.
`long` | `getMaxConnectionsInUseCount()`
`int` | `getMaxSize()` The MaxSize attribute indicates the maximum number of connections for a pool.
`int` | `getMinSize()` The MinSize attribute indicates the minimum number of connections this pool should hold.
`String` | `getName()`
`boolean` | `getNoTxSeparatePools()` Separate pools for transactional use
`void` | `handleNotification(javax.management.Notification notification, Object handback)`
`void` | `setBlockingTimeoutMillis(int newBlockingTimeout)` Set the BlockingTimeout value.
`void` | `setCriteria(String newCriteria)` Set the Criteria value.
`void` | `setIdleTimeout(long newIdleTimeout)` Set the IdleTimeout value.
`void` | `setIdleTimeoutMinutes(long newIdleTimeoutMinutes)` Set the IdleTimeoutMinutes value.
`void` | `setManagedConnectionFactoryName(javax.management.ObjectName newManagedConnectionFactoryName)` Set the ManagedConnectionFactoryName value.
`void` | `setMaxSize(int newMaxSize)` Set the MaxSize value.
`void` | `setMinSize(int newMinSize)` Set the MinSize value.
`void` | `setNoTxSeparatePools(boolean value)`
`protected void` | `startService()`
`protected void` | `stopService()`

Methods inherited from class org.jboss.system.ServiceMBeanSupport
`create, createService, destroy, destroyService, getLog, getNextNotificationSequenceNumber, getObjectName, getServer, getServiceName, getState, getStateString, jbossInternalCreate, jbossInternalDescription, jbossInternalDestroy, jbossInternalLifecycle, jbossInternalStart, jbossInternalStop, postDeregister, postRegister, preDeregister, preRegister, start, stop`

Methods inherited from class org.jboss.mx.util.JBossNotificationBroadcasterSupport
`addNotificationListener, getNotificationInfo, handleNotification, removeNotificationListener, removeNotificationListener, sendNotification`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Methods inherited from interface org.jboss.system.ServiceMBean
`getState, getStateString, jbossInternalLifecycle`

Methods inherited from interface org.jboss.system.Service
`create, destroy, start, stop`

Constructor Detail

### JBossManagedConnectionPool

    public JBossManagedConnectionPool()

  Default managed JBossManagedConnectionPool constructor for mbeans.

Method Detail

### getManagedConnectionPool

    public ManagedConnectionPool getManagedConnectionPool()

  ManagedConnectionPool is a read only attribute returning the pool set up by this mbean.

  Specified by:
    `getManagedConnectionPool` in interface `JBossManagedConnectionPoolMBean`
  Returns:
    the ManagedConnectionPool implementing the pool configured by this mbean.

### getManagedConnectionFactoryName

    public javax.management.ObjectName getManagedConnectionFactoryName()

  ManagedConnectionFactoryName holds the ObjectName of the mbean that represents the ManagedConnectionFactory. Normally this can be an embedded mbean in a depends element rather than a separate mbean reference.

  Specified by:
    `getManagedConnectionFactoryName` in interface `JBossManagedConnectionPoolMBean`
  Returns:
    the ManagedConnectionFactoryName value.

### setManagedConnectionFactoryName

    public void setManagedConnectionFactoryName(javax.management.ObjectName newManagedConnectionFactoryName)

  Set the ManagedConnectionFactoryName value.

  Specified by:
    `setManagedConnectionFactoryName` in interface `JBossManagedConnectionPoolMBean`
  Parameters:
    `newManagedConnectionFactoryName` - The new ManagedConnectionFactoryName value.

### getAvailableConnectionCount

    public long getAvailableConnectionCount()

  Get number of available free connections

  Specified by:
    `getAvailableConnectionCount` in interface `JBossManagedConnectionPoolMBean`
  Returns:
    number of available connections

### getMaxConnectionsInUseCount

    public long getMaxConnectionsInUseCount()

  Specified by:
    `getMaxConnectionsInUseCount` in interface `JBossManagedConnectionPoolMBean`
  Returns:
    max number of connections ever used

### getInUseConnectionCount

    public long getInUseConnectionCount()

  Get number of connections currently in use

  Specified by:
    `getInUseConnectionCount` in interface `JBossManagedConnectionPoolMBean`
  Returns:
    number of connections currently in use

### getMinSize

    public int getMinSize()

  The MinSize attribute indicates the minimum number of connections this pool should hold. These are not created until a Subject is known from a request for a connection. MinSize connections will be created for each sub-pool.

  Specified by:
    `getMinSize` in interface `JBossManagedConnectionPoolMBean`
  Returns:
    the MinSize value.

### setMinSize

    public void setMinSize(int newMinSize)

  Set the MinSize value.

  Specified by:
    `setMinSize` in interface `JBossManagedConnectionPoolMBean`
  Parameters:
    `newMinSize` - The new MinSize value.

### getMaxSize

    public int getMaxSize()

  The MaxSize attribute indicates the maximum number of connections for a pool. No more than MaxSize connections will be created in each sub-pool.

  Specified by:
    `getMaxSize` in interface `JBossManagedConnectionPoolMBean`
  Returns:
    the MaxSize value.

### setMaxSize

    public void setMaxSize(int newMaxSize)

  Set the MaxSize value.

  Specified by:
    `setMaxSize` in interface `JBossManagedConnectionPoolMBean`
  Parameters:
    `newMaxSize` - The new MaxSize value.

### getBlockingTimeoutMillis

    public int getBlockingTimeoutMillis()

  The BlockingTimeoutMillis attribute indicates the maximum time to block while waiting for a connection before throwing an exception. Note that this blocks only while waiting for a permit for a connection, and will never throw an exception if creating a new connection takes an inordinately long time.

  Specified by:
    `getBlockingTimeoutMillis` in interface `JBossManagedConnectionPoolMBean`
  Returns:
    the BlockingTimeout value.

### setBlockingTimeoutMillis

    public void setBlockingTimeoutMillis(int newBlockingTimeout)

  Set the BlockingTimeout value.

  Specified by:
    `setBlockingTimeoutMillis` in interface `JBossManagedConnectionPoolMBean`
  Parameters:
    `newBlockingTimeout` - The new BlockingTimeout value.

### getIdleTimeoutMinutes

    public long getIdleTimeoutMinutes()

  The IdleTimeoutMinutes attribute indicates the maximum time a connection may be idle before being closed. The actual maximum time depends also on the IdleRemover scan time, which is 1/2 the smallest IdleTimeout of any pool.

  Specified by:
    `getIdleTimeoutMinutes` in interface `JBossManagedConnectionPoolMBean`
  Returns:
    the IdleTimeoutMinutes value.

### setIdleTimeoutMinutes

    public void setIdleTimeoutMinutes(long newIdleTimeoutMinutes)

  Set the IdleTimeoutMinutes value.

  Specified by:
    `setIdleTimeoutMinutes` in interface `JBossManagedConnectionPoolMBean`
  Parameters:
    `newIdleTimeoutMinutes` - The new IdleTimeoutMinutes value.

### getIdleTimeout

    public long getIdleTimeout()

  Get the IdleTimeout value.

  Returns:
    the IdleTimeout value.

### setIdleTimeout

    public void setIdleTimeout(long newIdleTimeout)

  Set the IdleTimeout value.

  Parameters:
    `newIdleTimeout` - The new IdleTimeout value.

### getCriteria

    public String getCriteria()

  The Criteria attribute indicates if Subject (from security domain) or app supplied parameters (such as from getConnection(user, pw)) are used to distinguish connections in the pool. Choices are ByContainerAndApplication (use both), ByContainer (use Subject), ByApplication (use app supplied params only), ByNothing (all connections are equivalent, usually if adapter supports reauthentication)

  Specified by:
    `getCriteria` in interface `JBossManagedConnectionPoolMBean`
  Returns:
    the Criteria value.

### setCriteria

    public void setCriteria(String newCriteria)

  Set the Criteria value.

  Specified by:
    `setCriteria` in interface `JBossManagedConnectionPoolMBean`
  Parameters:
    `newCriteria` - The new Criteria value.

### getNoTxSeparatePools

    public boolean getNoTxSeparatePools()

  Separate pools for transactional use

  Specified by:
    `getNoTxSeparatePools` in interface `JBossManagedConnectionPoolMBean`
  Returns:
    true when connections should have different pools for transactional and non-transaction use.

### setNoTxSeparatePools

    public void setNoTxSeparatePools(boolean value)

  Specified by:
    `setNoTxSeparatePools` in interface `JBossManagedConnectionPoolMBean`

### flush

    public void flush()

  The `flush` method puts all currently checked out connections on a list to be destroyed when returned and disposes of all current pooled connections.

  Specified by:
    `flush` in interface `JBossManagedConnectionPoolMBean`

### getConnectionCount

    public int getConnectionCount()

  Retrieve the connection count.

  Specified by:
    `getConnectionCount` in interface `JBossManagedConnectionPoolMBean`
  Returns:
    the connection count

### getConnectionCreatedCount

    public int getConnectionCreatedCount()

  Retrieve the connection created count.

  Specified by:
    `getConnectionCreatedCount` in interface `JBossManagedConnectionPoolMBean`
  Returns:
    the connection created count

### getConnectionDestroyedCount

    public int getConnectionDestroyedCount()

  Retrieve the destrooyed count.

  Specified by:
    `getConnectionDestroyedCount` in interface `JBossManagedConnectionPoolMBean`
  Returns:
    the destroyed count

### getName

    public String getName()

  Specified by:
    `getName` in interface `org.jboss.system.ServiceMBean`

### startService

    protected void startService()
                         throws Exception

  Throws:
    `Exception`

### stopService

    protected void stopService()
                        throws Exception

  Throws:
    `Exception`

### handleNotification

    public void handleNotification(javax.management.Notification notification,
                                   Object handback)

  Specified by:
    `handleNotification` in interface `javax.management.NotificationListener`

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2002 JBoss Group, LLC. All Rights Reserved.