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 Connection
Underlying connection.private final long
Time this connection was created.private static final int
hash code seed.private final PooledConnectionStatistics
Statistics for this connection. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionboolean
Returns the connection that is being proxied.Returns the connection pool that this proxy is participating in.long
Returns the time this proxy was created.Returns the statistics associated with this connection's activity in the pool.int
hashCode()
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:PooledConnectionProxy
Returns the connection pool that this proxy is participating in.- Specified by:
getConnectionPool
in interfacePooledConnectionProxy
- Returns:
- connection pool
-
getConnection
Description copied from interface:PooledConnectionProxy
Returns the connection that is being proxied.- Specified by:
getConnection
in interfacePooledConnectionProxy
- Returns:
- underlying connection
-
getCreatedTime
public long getCreatedTime()Description copied from interface:PooledConnectionProxy
Returns the time this proxy was created.- Specified by:
getCreatedTime
in interfacePooledConnectionProxy
- Returns:
- creation timestamp in milliseconds
-
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
-
equals
-
hashCode
public int hashCode() -
toString
-
invoke
- Specified by:
invoke
in interfaceInvocationHandler
- Throws:
Throwable
-