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
FieldsModifier and TypeFieldDescriptionprivate final ConnectionUnderlying connection.private final longTime this connection was created.private static final inthash code seed.private final PooledConnectionStatisticsStatistics for this connection. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanReturns the connection that is being proxied.Returns the connection pool that this proxy is participating in.longReturns the time this proxy was created.Returns the statistics associated with this connection's activity in the pool.inthashCode()toString()
-
Field Details
-
HASH_CODE_SEED
private static final int HASH_CODE_SEEDhash code seed.- See Also:
-
conn
Underlying connection. -
createdTime
private final long createdTimeTime this connection was created. -
statistics
Statistics for this connection.
-
-
Constructor Details
-
DefaultPooledConnectionProxy
Creates a new pooled connection.- Parameters:
c- connection to participate in this pool
-
-
Method Details
-
getConnectionPool
Description copied from interface:PooledConnectionProxyReturns the connection pool that this proxy is participating in.- Specified by:
getConnectionPoolin interfacePooledConnectionProxy- Returns:
- connection pool
-
getConnection
Description copied from interface:PooledConnectionProxyReturns the connection that is being proxied.- Specified by:
getConnectionin interfacePooledConnectionProxy- Returns:
- underlying connection
-
getCreatedTime
public long getCreatedTime()Description copied from interface:PooledConnectionProxyReturns the time this proxy was created.- Specified by:
getCreatedTimein interfacePooledConnectionProxy- Returns:
- creation timestamp in milliseconds
-
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
-
equals
-
hashCode
public int hashCode() -
toString
-
invoke
- Specified by:
invokein interfaceInvocationHandler- Throws:
Throwable
-