org.ldaptive.pool
Class AbstractConnectionPool.DefaultPooledConnectionProxy

java.lang.Object
  extended by 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.


Constructor Summary
AbstractConnectionPool.DefaultPooledConnectionProxy(Connection c, Response<Void> r)
          Creates a new pooled connection.
 
Method Summary
 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.
 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()
          
 Object invoke(Object proxy, Method method, Object[] args)
          
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractConnectionPool.DefaultPooledConnectionProxy

public AbstractConnectionPool.DefaultPooledConnectionProxy(Connection c,
                                                           Response<Void> r)
Creates a new pooled connection.

Parameters:
c - connection to participate in this pool
r - response produced by opening the connection
Method Detail

getConnectionPool

public ConnectionPool getConnectionPool()
Returns the connection pool that this proxy is participating in.

Specified by:
getConnectionPool in interface PooledConnectionProxy
Returns:
connection pool

getConnection

public Connection getConnection()
Returns the connection that is being proxied.

Specified by:
getConnection in interface PooledConnectionProxy
Returns:
underlying connection

getCreatedTime

public long getCreatedTime()
Returns the time this proxy was created.

Specified by:
getCreatedTime in interface PooledConnectionProxy
Returns:
creation timestamp in milliseconds

getPooledConnectionStatistics

public PooledConnectionStatistics getPooledConnectionStatistics()
Returns the statistics associated with this connection's activity in the pool.

Specified by:
getPooledConnectionStatistics in interface PooledConnectionProxy
Returns:
pooled connection statistics

equals

public boolean equals(Object o)

Overrides:
equals in class Object

hashCode

public int hashCode()

Overrides:
hashCode in class Object

invoke

public Object invoke(Object proxy,
                     Method method,
                     Object[] args)
              throws Throwable

Specified by:
invoke in interface InvocationHandler
Throws:
Throwable


Copyright © 2003-2017 Virginia Tech. All Rights Reserved.