Package org.apache.tomcat.jdbc.pool
Class ConnectionPool.ConnectionFuture
- java.lang.Object
-
- org.apache.tomcat.jdbc.pool.ConnectionPool.ConnectionFuture
-
- All Implemented Interfaces:
Runnable,Future<Connection>
- Enclosing class:
- ConnectionPool
protected class ConnectionPool.ConnectionFuture extends Object implements Future<Connection>, Runnable
Tread safe wrapper around a future for the regular queue This one retrieves the pooled connection object and performs the initialization according to interceptors and validation rules. This class is thread safe and is cancellable
-
-
Constructor Summary
Constructors Constructor Description ConnectionFuture(Future<PooledConnection> pcf)ConnectionFuture(PooledConnection pc)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleancancel(boolean mayInterruptIfRunning)Connectionget()Connectionget(long timeout, TimeUnit unit)booleanisCancelled()booleanisDone()voidrun()run method to be executed when cancelled by an executor
-
-
-
Constructor Detail
-
ConnectionFuture
public ConnectionFuture(Future<PooledConnection> pcf)
-
ConnectionFuture
public ConnectionFuture(PooledConnection pc) throws SQLException
- Throws:
SQLException
-
-
Method Detail
-
cancel
public boolean cancel(boolean mayInterruptIfRunning)
- Specified by:
cancelin interfaceFuture<Connection>
-
get
public Connection get() throws InterruptedException, ExecutionException
- Specified by:
getin interfaceFuture<Connection>- Throws:
InterruptedExceptionExecutionException
-
get
public Connection get(long timeout, TimeUnit unit) throws InterruptedException, ExecutionException, TimeoutException
- Specified by:
getin interfaceFuture<Connection>- Throws:
InterruptedExceptionExecutionExceptionTimeoutException
-
isCancelled
public boolean isCancelled()
- Specified by:
isCancelledin interfaceFuture<Connection>
-
isDone
public boolean isDone()
- Specified by:
isDonein interfaceFuture<Connection>
-
-