Apache Tomcat 7.0.26

org.apache.tomcat.jdbc.pool
Class ConnectionPool.ConnectionFuture

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

Author:
fhanik

Constructor Summary
ConnectionPool.ConnectionFuture(java.util.concurrent.Future<PooledConnection> pcf)
           
ConnectionPool.ConnectionFuture(PooledConnection pc)
           
 
Method Summary
 boolean cancel(boolean mayInterruptIfRunning)
          
 java.sql.Connection get()
          
 java.sql.Connection get(long timeout, java.util.concurrent.TimeUnit unit)
          
 boolean isCancelled()
          
 boolean isDone()
          
 void run()
          run method to be executed when cancelled by an executor
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ConnectionPool.ConnectionFuture

public ConnectionPool.ConnectionFuture(java.util.concurrent.Future<PooledConnection> pcf)

ConnectionPool.ConnectionFuture

public ConnectionPool.ConnectionFuture(PooledConnection pc)
                                throws java.sql.SQLException
Throws:
java.sql.SQLException
Method Detail

cancel

public boolean cancel(boolean mayInterruptIfRunning)

Specified by:
cancel in interface java.util.concurrent.Future<java.sql.Connection>

get

public java.sql.Connection get()
                        throws java.lang.InterruptedException,
                               java.util.concurrent.ExecutionException

Specified by:
get in interface java.util.concurrent.Future<java.sql.Connection>
Throws:
java.lang.InterruptedException
java.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:
get in interface java.util.concurrent.Future<java.sql.Connection>
Throws:
java.lang.InterruptedException
java.util.concurrent.ExecutionException
java.util.concurrent.TimeoutException

isCancelled

public boolean isCancelled()

Specified by:
isCancelled in interface java.util.concurrent.Future<java.sql.Connection>

isDone

public boolean isDone()

Specified by:
isDone in interface java.util.concurrent.Future<java.sql.Connection>

run

public void run()
run method to be executed when cancelled by an executor

Specified by:
run in interface java.lang.Runnable

Apache Tomcat 7.0.26

Copyright © 2000-2012 Apache Software Foundation. All Rights Reserved.