Package org.ldaptive.pool
Class AbstractConnectionPool.DefaultPooledConnectionProxy
- java.lang.Object
-
- org.ldaptive.pool.AbstractConnectionPool.DefaultPooledConnectionProxy
-
- All Implemented Interfaces:
InvocationHandler,PooledConnectionProxy
- Enclosing class:
- AbstractConnectionPool
protected class AbstractConnectionPool.DefaultPooledConnectionProxy extends Object implements PooledConnectionProxy
Contains a connection that is participating in this pool. Used to track how long a connection has been in use and override certain method invocations.
-
-
Field Summary
Fields Modifier and Type Field Description private ConnectionconnUnderlying connection.private InstantcreatedTimeTime this connection was created.private static intHASH_CODE_SEEDhash code seed.private PooledConnectionStatisticsstatisticsStatistics for this connection.
-
Constructor Summary
Constructors Constructor Description DefaultPooledConnectionProxy(Connection c)Creates a new pooled connection.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(Object o)ConnectiongetConnection()Returns the connection that is being proxied.ConnectionPoolgetConnectionPool()Returns the connection pool that this proxy is participating in.InstantgetCreatedTime()Returns the time this proxy was created.intgetMaxPoolSize()Returns the maximum size of the connection pool that this proxy is participating in.intgetMinPoolSize()Returns the minimum size of the connection pool that this proxy is participating in.PooledConnectionStatisticsgetPooledConnectionStatistics()Returns the statistics associated with this connection's activity in the pool.inthashCode()Objectinvoke(Object proxy, Method method, Object[] args)StringtoString()
-
-
-
Field Detail
-
HASH_CODE_SEED
private static final int HASH_CODE_SEED
hash code seed.- See Also:
- Constant Field Values
-
conn
private final Connection conn
Underlying connection.
-
createdTime
private final Instant createdTime
Time this connection was created.
-
statistics
private final PooledConnectionStatistics statistics
Statistics for this connection.
-
-
Constructor Detail
-
DefaultPooledConnectionProxy
public DefaultPooledConnectionProxy(Connection c)
Creates a new pooled connection.- Parameters:
c- connection to participate in this pool
-
-
Method Detail
-
getConnectionPool
public ConnectionPool getConnectionPool()
Description copied from interface:PooledConnectionProxyReturns the connection pool that this proxy is participating in.- Specified by:
getConnectionPoolin interfacePooledConnectionProxy- Returns:
- connection pool
-
getConnection
public Connection getConnection()
Description copied from interface:PooledConnectionProxyReturns the connection that is being proxied.- Specified by:
getConnectionin interfacePooledConnectionProxy- Returns:
- underlying connection
-
getCreatedTime
public Instant getCreatedTime()
Description copied from interface:PooledConnectionProxyReturns the time this proxy was created.- Specified by:
getCreatedTimein interfacePooledConnectionProxy- Returns:
- creation timestamp in milliseconds
-
getPooledConnectionStatistics
public PooledConnectionStatistics getPooledConnectionStatistics()
Description copied from interface:PooledConnectionProxyReturns the statistics associated with this connection's activity in the pool.- Specified by:
getPooledConnectionStatisticsin interfacePooledConnectionProxy- Returns:
- pooled connection statistics
-
getMinPoolSize
public int getMinPoolSize()
Description copied from interface:PooledConnectionProxyReturns the minimum size of the connection pool that this proxy is participating in.- Specified by:
getMinPoolSizein interfacePooledConnectionProxy- Returns:
- minimum pool size
-
getMaxPoolSize
public int getMaxPoolSize()
Description copied from interface:PooledConnectionProxyReturns the maximum size of the connection pool that this proxy is participating in.- Specified by:
getMaxPoolSizein interfacePooledConnectionProxy- Returns:
- mqximum pool size
-
-