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 booleanequals(java.lang.Object o)ConnectiongetConnection()Returns the connection that is being proxied.ConnectionPoolgetConnectionPool()Returns the connection pool that this proxy is participating in.longgetCreatedTime()Returns the time this proxy was created.PooledConnectionStatisticsgetPooledConnectionStatistics()Returns the statistics associated with this connection's activity in the pool.inthashCode()java.lang.Objectinvoke(java.lang.Object proxy, java.lang.reflect.Method method, java.lang.Object[] args)java.lang.StringtoString()
-
-
-
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 long 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
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equalsin classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toStringin 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:
invokein interfacejava.lang.reflect.InvocationHandler- Throws:
java.lang.Throwable
-
-