org.apache.geronimo.connector.outbound
Class AbstractSinglePoolConnectionInterceptor
java.lang.Object
org.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: 1058794 $ $Date: 2011-01-14 07:25:36 +0800 (Fri, 14 Jan 2011) $
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
log
protected static org.slf4j.Logger log
next
protected final ConnectionInterceptor next
permits
protected java.util.concurrent.Semaphore permits
blockingTimeoutMilliseconds
protected int blockingTimeoutMilliseconds
connectionCount
protected int connectionCount
idleTimeoutMilliseconds
protected long idleTimeoutMilliseconds
timer
protected java.util.Timer timer
maxSize
protected int maxSize
minSize
protected int minSize
shrinkLater
protected int shrinkLater
destroyed
protected volatile boolean destroyed
AbstractSinglePoolConnectionInterceptor
public AbstractSinglePoolConnectionInterceptor(ConnectionInterceptor next,
int maxSize,
int minSize,
int blockingTimeoutMilliseconds,
int idleTimeoutMinutes)
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 boolean internalReturn(ConnectionInfo connectionInfo,
ConnectionReturnAction connectionReturnAction)
- Parameters:
connectionInfo - connection info to return to poolconnectionReturnAction - whether to return to pool or destroy
- Returns:
- true if a connection for which a permit was issued was returned (so the permit should be released),
false if no permit was issued (for instance if the connection was already in the pool and we are destroying it).
internalDestroy
protected abstract void internalDestroy()
destroy
public void destroy()
- Specified by:
destroy in interface ConnectionInterceptor
getPartitionCount
public int getPartitionCount()
- Specified by:
getPartitionCount in interface PoolingAttributes
getPartitionMaxSize
public int getPartitionMaxSize()
- Specified by:
getPartitionMaxSize in interface PoolingAttributes
setPartitionMaxSize
public void setPartitionMaxSize(int newMaxSize)
throws java.lang.InterruptedException
- Specified by:
setPartitionMaxSize in interface PoolingAttributes
- Throws:
java.lang.InterruptedException
doRemove
protected abstract boolean doRemove(ManagedConnectionInfo mci)
doAdd
protected abstract void doAdd(ManagedConnectionInfo mci)
getPool
protected abstract java.lang.Object getPool()
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.List<ManagedConnectionInfo> killList)
addToPool
protected boolean addToPool(ManagedConnectionInfo mci)
Copyright © 2003-2011 The Apache Software Foundation. All Rights Reserved.