Package org.apache.tomcat.jdbc.pool
Class ConnectionPool.ConnectionFuture
- java.lang.Object
-
- org.apache.tomcat.jdbc.pool.ConnectionPool.ConnectionFuture
-
- All Implemented Interfaces:
java.lang.Runnable,java.util.concurrent.Future<java.sql.Connection>
- Enclosing class:
- ConnectionPool
protected class ConnectionPool.ConnectionFuture extends java.lang.Object implements java.util.concurrent.Future<java.sql.Connection>, java.lang.RunnableThread 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(java.util.concurrent.Future<PooledConnection> pcf)ConnectionFuture(PooledConnection pc)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleancancel(boolean mayInterruptIfRunning)java.sql.Connectionget()java.sql.Connectionget(long timeout, java.util.concurrent.TimeUnit unit)booleanisCancelled()booleanisDone()voidrun()run method to be executed when cancelled by an executor
-
-
-
Constructor Detail
-
ConnectionFuture
public ConnectionFuture(java.util.concurrent.Future<PooledConnection> pcf)
-
ConnectionFuture
public ConnectionFuture(PooledConnection pc) throws java.sql.SQLException
- Throws:
java.sql.SQLException
-
-
Method Detail
-
cancel
public boolean cancel(boolean mayInterruptIfRunning)
- Specified by:
cancelin interfacejava.util.concurrent.Future<java.sql.Connection>
-
get
public java.sql.Connection get() throws java.lang.InterruptedException, java.util.concurrent.ExecutionException- Specified by:
getin interfacejava.util.concurrent.Future<java.sql.Connection>- Throws:
java.lang.InterruptedExceptionjava.util.concurrent.ExecutionException
-
get
public java.sql.Connection get(long timeout, java.util.concurrent.TimeUnit unit) throws java.lang.InterruptedException, java.util.concurrent.ExecutionException, java.util.concurrent.TimeoutException- Specified by:
getin interfacejava.util.concurrent.Future<java.sql.Connection>- Throws:
java.lang.InterruptedExceptionjava.util.concurrent.ExecutionExceptionjava.util.concurrent.TimeoutException
-
isCancelled
public boolean isCancelled()
- Specified by:
isCancelledin interfacejava.util.concurrent.Future<java.sql.Connection>
-
isDone
public boolean isDone()
- Specified by:
isDonein interfacejava.util.concurrent.Future<java.sql.Connection>
-
run
public void run()
run method to be executed when cancelled by an executor- Specified by:
runin interfacejava.lang.Runnable
-
-