org.apache.geronimo.connector.outbound
Class AbstractSinglePoolConnectionInterceptor

java.lang.Object
  extended byorg.apache.geronimo.connector.outbound.AbstractSinglePoolConnectionInterceptor
All Implemented Interfaces:
ConnectionInterceptor, PoolingAttributes
Direct Known Subclasses:
SinglePoolConnectionInterceptor, SinglePoolMatchAllConnectionInterceptor

public abstract class AbstractSinglePoolConnectionInterceptor
extends java.lang.Object
implements ConnectionInterceptor, PoolingAttributes

Version:
$Rev: $ $Date: $

Nested Class Summary
protected  class AbstractSinglePoolConnectionInterceptor.FillTask
           
private  class AbstractSinglePoolConnectionInterceptor.IdleReleaser
           
 
Field Summary
protected  int blockingTimeoutMilliseconds
           
protected  int connectionCount
           
private  AbstractSinglePoolConnectionInterceptor.IdleReleaser idleReleaser
           
private  long idleTimeoutMilliseconds
           
protected static Log log
           
protected  int minSize
           
protected  ConnectionInterceptor next
           
protected  EDU.oswego.cs.dl.util.concurrent.FIFOSemaphore permits
           
private  EDU.oswego.cs.dl.util.concurrent.ReadWriteLock resizeLock
           
protected  int shrinkLater
           
protected  java.util.Timer timer
           
 
Constructor Summary
AbstractSinglePoolConnectionInterceptor(ConnectionInterceptor next, int maxSize, int minSize, int blockingTimeoutMilliseconds, int idleTimeoutMinutes)
           
 
Method Summary
protected abstract  boolean addToPool(ManagedConnectionInfo mci)
           
 int getBlockingTimeoutMilliseconds()
           
 void getConnection(ConnectionInfo connectionInfo)
           
 int getConnectionCount()
           
protected abstract  void getExpiredManagedConnectionInfos(long threshold, java.util.ArrayList killList)
           
abstract  int getIdleConnectionCount()
           
 int getIdleTimeoutMinutes()
           
 int getPartitionCount()
           
abstract  int getPartitionMaxSize()
           
 int getPartitionMinSize()
           
protected abstract  void internalGetConnection(ConnectionInfo connectionInfo)
           
protected abstract  boolean internalReturn(ConnectionInfo connectionInfo, ConnectionReturnAction connectionReturnAction)
           
 void returnConnection(ConnectionInfo connectionInfo, ConnectionReturnAction connectionReturnAction)
           
 void setBlockingTimeoutMilliseconds(int blockingTimeoutMilliseconds)
           
 void setIdleTimeoutMinutes(int idleTimeoutMinutes)
           
 void setPartitionMaxSize(int maxSize)
           
 void setPartitionMinSize(int minSize)
           
protected abstract  void transferConnections(int maxSize, int shrinkNow)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

log

protected static Log log

next

protected final ConnectionInterceptor next

resizeLock

private final EDU.oswego.cs.dl.util.concurrent.ReadWriteLock resizeLock

permits

protected EDU.oswego.cs.dl.util.concurrent.FIFOSemaphore permits

blockingTimeoutMilliseconds

protected int blockingTimeoutMilliseconds

connectionCount

protected int connectionCount

idleTimeoutMilliseconds

private long idleTimeoutMilliseconds

idleReleaser

private AbstractSinglePoolConnectionInterceptor.IdleReleaser idleReleaser

timer

protected java.util.Timer timer

minSize

protected int minSize

shrinkLater

protected int shrinkLater
Constructor Detail

AbstractSinglePoolConnectionInterceptor

public AbstractSinglePoolConnectionInterceptor(ConnectionInterceptor next,
                                               int maxSize,
                                               int minSize,
                                               int blockingTimeoutMilliseconds,
                                               int idleTimeoutMinutes)
Method Detail

getConnection

public void getConnection(ConnectionInfo connectionInfo)
                   throws javax.resource.ResourceException
Specified by:
getConnection in interface ConnectionInterceptor
Throws:
javax.resource.ResourceException

internalGetConnection

protected abstract void internalGetConnection(ConnectionInfo connectionInfo)
                                       throws javax.resource.ResourceException
Throws:
javax.resource.ResourceException

returnConnection

public void returnConnection(ConnectionInfo connectionInfo,
                             ConnectionReturnAction connectionReturnAction)
Specified by:
returnConnection in interface ConnectionInterceptor

internalReturn

protected abstract boolean internalReturn(ConnectionInfo connectionInfo,
                                          ConnectionReturnAction connectionReturnAction)

getPartitionCount

public int getPartitionCount()
Specified by:
getPartitionCount in interface PoolingAttributes

getPartitionMaxSize

public abstract int getPartitionMaxSize()
Specified by:
getPartitionMaxSize in interface PoolingAttributes

setPartitionMaxSize

public void setPartitionMaxSize(int maxSize)
                         throws java.lang.InterruptedException
Specified by:
setPartitionMaxSize in interface PoolingAttributes
Throws:
java.lang.InterruptedException

transferConnections

protected abstract void transferConnections(int maxSize,
                                            int shrinkNow)

getIdleConnectionCount

public abstract int getIdleConnectionCount()
Specified by:
getIdleConnectionCount in interface PoolingAttributes

getConnectionCount

public int getConnectionCount()
Specified by:
getConnectionCount in interface PoolingAttributes

getPartitionMinSize

public int getPartitionMinSize()
Specified by:
getPartitionMinSize in interface PoolingAttributes

setPartitionMinSize

public void setPartitionMinSize(int minSize)
Specified by:
setPartitionMinSize in interface PoolingAttributes

getBlockingTimeoutMilliseconds

public int getBlockingTimeoutMilliseconds()
Specified by:
getBlockingTimeoutMilliseconds in interface PoolingAttributes

setBlockingTimeoutMilliseconds

public void setBlockingTimeoutMilliseconds(int blockingTimeoutMilliseconds)
Specified by:
setBlockingTimeoutMilliseconds in interface PoolingAttributes

getIdleTimeoutMinutes

public int getIdleTimeoutMinutes()
Specified by:
getIdleTimeoutMinutes in interface PoolingAttributes

setIdleTimeoutMinutes

public void setIdleTimeoutMinutes(int idleTimeoutMinutes)
Specified by:
setIdleTimeoutMinutes in interface PoolingAttributes

getExpiredManagedConnectionInfos

protected abstract void getExpiredManagedConnectionInfos(long threshold,
                                                         java.util.ArrayList killList)

addToPool

protected abstract boolean addToPool(ManagedConnectionInfo mci)


Copyright © 2005 Apache Software Foundation. All Rights Reserved.