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 Connection
conn
Underlying connection.private Instant
createdTime
Time this connection was created.private static int
HASH_CODE_SEED
hash code seed.private PooledConnectionStatistics
statistics
Statistics 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 boolean
equals(Object o)
Connection
getConnection()
Returns the connection that is being proxied.ConnectionPool
getConnectionPool()
Returns the connection pool that this proxy is participating in.Instant
getCreatedTime()
Returns the time this proxy was created.int
getMaxPoolSize()
Returns the maximum size of the connection pool that this proxy is participating in.int
getMinPoolSize()
Returns the minimum size of the connection pool that this proxy is participating in.PooledConnectionStatistics
getPooledConnectionStatistics()
Returns the statistics associated with this connection's activity in the pool.int
hashCode()
Object
invoke(Object proxy, Method method, Object[] args)
String
toString()
-
-
-
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:PooledConnectionProxy
Returns the connection pool that this proxy is participating in.- Specified by:
getConnectionPool
in interfacePooledConnectionProxy
- Returns:
- connection pool
-
getConnection
public Connection getConnection()
Description copied from interface:PooledConnectionProxy
Returns the connection that is being proxied.- Specified by:
getConnection
in interfacePooledConnectionProxy
- Returns:
- underlying connection
-
getCreatedTime
public Instant getCreatedTime()
Description copied from interface:PooledConnectionProxy
Returns the time this proxy was created.- Specified by:
getCreatedTime
in interfacePooledConnectionProxy
- Returns:
- creation timestamp in milliseconds
-
getPooledConnectionStatistics
public PooledConnectionStatistics getPooledConnectionStatistics()
Description copied from interface:PooledConnectionProxy
Returns the statistics associated with this connection's activity in the pool.- Specified by:
getPooledConnectionStatistics
in interfacePooledConnectionProxy
- Returns:
- pooled connection statistics
-
getMinPoolSize
public int getMinPoolSize()
Description copied from interface:PooledConnectionProxy
Returns the minimum size of the connection pool that this proxy is participating in.- Specified by:
getMinPoolSize
in interfacePooledConnectionProxy
- Returns:
- minimum pool size
-
getMaxPoolSize
public int getMaxPoolSize()
Description copied from interface:PooledConnectionProxy
Returns the maximum size of the connection pool that this proxy is participating in.- Specified by:
getMaxPoolSize
in interfacePooledConnectionProxy
- Returns:
- mqximum pool size
-
-