Package org.ldaptive.pool
Class AbstractConnectionPool.DefaultPooledConnectionProxy
- java.lang.Object
-
- org.ldaptive.pool.AbstractConnectionPool.DefaultPooledConnectionProxy
-
- All Implemented Interfaces:
java.lang.reflect.InvocationHandler
,PooledConnectionProxy
- Enclosing class:
- AbstractConnectionPool
protected class AbstractConnectionPool.DefaultPooledConnectionProxy extends java.lang.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.
-
-
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(java.lang.Object o)
Connection
getConnection()
Returns the connection that is being proxied.ConnectionPool
getConnectionPool()
Returns the connection pool that this proxy is participating in.long
getCreatedTime()
Returns the time this proxy was created.PooledConnectionStatistics
getPooledConnectionStatistics()
Returns the statistics associated with this connection's activity in the pool.int
hashCode()
java.lang.Object
invoke(java.lang.Object proxy, java.lang.reflect.Method method, java.lang.Object[] args)
java.lang.String
toString()
-
-
-
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 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
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
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equals
in classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
invoke
public java.lang.Object invoke(java.lang.Object proxy, java.lang.reflect.Method method, java.lang.Object[] args) throws java.lang.Throwable
- Specified by:
invoke
in interfacejava.lang.reflect.InvocationHandler
- Throws:
java.lang.Throwable
-
-