org.apache.geronimo.connector.outbound
Class SinglePoolConnectionInterceptor

java.lang.Object
  extended by org.apache.geronimo.connector.outbound.AbstractSinglePoolConnectionInterceptor
      extended by org.apache.geronimo.connector.outbound.SinglePoolConnectionInterceptor
All Implemented Interfaces:
ConnectionInterceptor, PoolingAttributes

public class SinglePoolConnectionInterceptor
extends AbstractSinglePoolConnectionInterceptor

SinglePoolConnectionInterceptor chooses a single connection from the pool. If selectOneAssumeMatch is true, it simply returns the selected connection. THIS SHOULD BE USED ONLY IF MAXIMUM SPEED IS ESSENTIAL AND YOU HAVE THOROUGLY CHECKED THAT MATCHING WOULD SUCCEED ON THE SELECTED CONNECTION. (i.e., read the docs on your connector to find out how matching works) If selectOneAssumeMatch is false, it checks with the ManagedConnectionFactory that the selected connection does match before returning it: if not it throws an exception.

Version:
$Rev: 1058794 $ $Date: 2011-01-14 07:25:36 +0800 (Fri, 14 Jan 2011) $

Nested Class Summary
 
Nested classes/interfaces inherited from class org.apache.geronimo.connector.outbound.AbstractSinglePoolConnectionInterceptor
AbstractSinglePoolConnectionInterceptor.FillTask
 
Field Summary
 
Fields inherited from class org.apache.geronimo.connector.outbound.AbstractSinglePoolConnectionInterceptor
blockingTimeoutMilliseconds, connectionCount, destroyed, idleTimeoutMilliseconds, maxSize, minSize, next, permits, shrinkLater, timer
 
Constructor Summary
SinglePoolConnectionInterceptor(ConnectionInterceptor next, int maxSize, int minSize, int blockingTimeoutMilliseconds, int idleTimeoutMinutes, boolean selectOneAssumeMatch)
           
 
Method Summary
protected  void doAdd(ManagedConnectionInfo mci)
           
protected  boolean doRemove(ManagedConnectionInfo mci)
           
protected  void getExpiredManagedConnectionInfos(long threshold, java.util.List<ManagedConnectionInfo> killList)
           
 int getIdleConnectionCount()
           
protected  java.lang.Object getPool()
           
 void info(java.lang.StringBuilder s)
           
protected  void internalDestroy()
           
protected  void internalGetConnection(ConnectionInfo connectionInfo)
           
protected  void transferConnections(int maxSize, int shrinkNow)
           
 
Methods inherited from class org.apache.geronimo.connector.outbound.AbstractSinglePoolConnectionInterceptor
addToPool, destroy, getBlockingTimeoutMilliseconds, getConnection, getConnectionCount, getIdleTimeoutMinutes, getPartitionCount, getPartitionMaxSize, getPartitionMinSize, internalReturn, returnConnection, setBlockingTimeoutMilliseconds, setIdleTimeoutMinutes, setPartitionMaxSize, setPartitionMinSize
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SinglePoolConnectionInterceptor

public SinglePoolConnectionInterceptor(ConnectionInterceptor next,
                                       int maxSize,
                                       int minSize,
                                       int blockingTimeoutMilliseconds,
                                       int idleTimeoutMinutes,
                                       boolean selectOneAssumeMatch)
Method Detail

internalGetConnection

protected void internalGetConnection(ConnectionInfo connectionInfo)
                              throws javax.resource.ResourceException
Specified by:
internalGetConnection in class AbstractSinglePoolConnectionInterceptor
Throws:
javax.resource.ResourceException

internalDestroy

protected void internalDestroy()
Specified by:
internalDestroy in class AbstractSinglePoolConnectionInterceptor

getPool

protected java.lang.Object getPool()
Specified by:
getPool in class AbstractSinglePoolConnectionInterceptor

doAdd

protected void doAdd(ManagedConnectionInfo mci)
Specified by:
doAdd in class AbstractSinglePoolConnectionInterceptor

doRemove

protected boolean doRemove(ManagedConnectionInfo mci)
Specified by:
doRemove in class AbstractSinglePoolConnectionInterceptor
Parameters:
mci - managedConnectionInfo to remove from pool
Returns:
true if mci was not in pool already, false if mci was in pool already.

transferConnections

protected void transferConnections(int maxSize,
                                   int shrinkNow)
Specified by:
transferConnections in class AbstractSinglePoolConnectionInterceptor

getIdleConnectionCount

public int getIdleConnectionCount()
Specified by:
getIdleConnectionCount in interface PoolingAttributes
Specified by:
getIdleConnectionCount in class AbstractSinglePoolConnectionInterceptor

getExpiredManagedConnectionInfos

protected void getExpiredManagedConnectionInfos(long threshold,
                                                java.util.List<ManagedConnectionInfo> killList)
Specified by:
getExpiredManagedConnectionInfos in class AbstractSinglePoolConnectionInterceptor

info

public void info(java.lang.StringBuilder s)


Copyright © 2003-2011 The Apache Software Foundation. All Rights Reserved.