Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

org.apache.geronimo.connector.outbound
Class SinglePoolConnectionInterceptor  view SinglePoolConnectionInterceptor download SinglePoolConnectionInterceptor.java

java.lang.Object
  extended byorg.apache.geronimo.connector.outbound.AbstractSinglePoolConnectionInterceptor
      extended byorg.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: 154616 $ $Date: 2005-02-20 18:49:58 -0800 (Sun, 20 Feb 2005) $

Nested Class Summary
(package private) static class SinglePoolConnectionInterceptor.PoolDeque
           
 
Nested classes inherited from class org.apache.geronimo.connector.outbound.AbstractSinglePoolConnectionInterceptor
AbstractSinglePoolConnectionInterceptor.FillTask
 
Field Summary
private  SinglePoolConnectionInterceptor.PoolDeque pool
           
private  boolean selectOneAssumeMatch
           
 
Fields inherited from class org.apache.geronimo.connector.outbound.AbstractSinglePoolConnectionInterceptor
blockingTimeoutMilliseconds, connectionCount, log, minSize, next, permits, shrinkLater, timer
 
Constructor Summary
SinglePoolConnectionInterceptor(ConnectionInterceptor next, int maxSize, int minSize, int blockingTimeoutMilliseconds, int idleTimeoutMinutes, boolean selectOneAssumeMatch)
           
 
Method Summary
protected  boolean addToPool(ManagedConnectionInfo mci)
           
protected  void getExpiredManagedConnectionInfos(long threshold, java.util.ArrayList killList)
           
 int getIdleConnectionCount()
           
 int getPartitionMaxSize()
           
protected  void internalGetConnection(ConnectionInfo connectionInfo)
           
protected  boolean internalReturn(ConnectionInfo connectionInfo, ConnectionReturnAction connectionReturnAction)
           
protected  void transferConnections(int maxSize, int shrinkNow)
           
 
Methods inherited from class org.apache.geronimo.connector.outbound.AbstractSinglePoolConnectionInterceptor
getBlockingTimeoutMilliseconds, getConnection, getConnectionCount, getIdleTimeoutMinutes, getPartitionCount, getPartitionMinSize, returnConnection, setBlockingTimeoutMilliseconds, setIdleTimeoutMinutes, setPartitionMaxSize, setPartitionMinSize
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

selectOneAssumeMatch

private boolean selectOneAssumeMatch

pool

private SinglePoolConnectionInterceptor.PoolDeque pool
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

internalReturn

protected boolean internalReturn(ConnectionInfo connectionInfo,
                                 ConnectionReturnAction connectionReturnAction)
Specified by:
internalReturn in class AbstractSinglePoolConnectionInterceptor

getPartitionMaxSize

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

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.ArrayList killList)
Specified by:
getExpiredManagedConnectionInfos in class AbstractSinglePoolConnectionInterceptor

addToPool

protected boolean addToPool(ManagedConnectionInfo mci)
Specified by:
addToPool in class AbstractSinglePoolConnectionInterceptor