/** * Attempts to lease a connection for the given route and with the given * state from the pool. * <p> * Please note that this class does not maintain its own pool of execution * {@link Thread}s. Therefore, one <b>must</b> call {@link Future#get()} * or {@link Future#get(long, TimeUnit)} method on the {@link Future} * returned by this method in order for the lease operation to complete. * * @param route route of the connection. * @param state arbitrary object that represents a particular state * (usually a security principal or a unique token identifying * the user whose credentials have been used while establishing the connection). * May be {@code null}. * @return future for a leased pool entry. */ public Future<E> lease(final T route, final Object state) { return lease(route, state, null); }
/** * Attempts to lease a connection for the given route and with the given * state from the pool. * <p> * Please note that this class does not maintain its own pool of execution * {@link Thread}s. Therefore, one <b>must</b> call {@link Future#get()} * or {@link Future#get(long, TimeUnit)} method on the {@link Future} * returned by this method in order for the lease operation to complete. * * @param route route of the connection. * @param state arbitrary object that represents a particular state * (usually a security principal or a unique token identifying * the user whose credentials have been used while establishing the connection). * May be {@code null}. * @return future for a leased pool entry. */ public Future<E> lease(final T route, final Object state) { return lease(route, state, null); }
/** * Attempts to lease a connection for the given route and with the given * state from the pool. * <p> * Please note that this class does not maintain its own pool of execution * {@link Thread}s. Therefore, one <b>must</b> call {@link Future#get()} * or {@link Future#get(long, TimeUnit)} method on the {@link Future} * returned by this method in order for the lease operation to complete. * * @param route route of the connection. * @param state arbitrary object that represents a particular state * (usually a security principal or a unique token identifying * the user whose credentials have been used while establishing the connection). * May be {@code null}. * @return future for a leased pool entry. */ public Future<E> lease(final T route, final Object state) { return lease(route, state, null); }
/** * Attempts to lease a connection for the given route and with the given * state from the pool. * <p/> * Please note that this class does not maintain its own pool of execution * {@link Thread}s. Therefore, one <b>must</b> call {@link Future#get()} * or {@link Future#get(long, TimeUnit)} method on the {@link Future} * returned by this method in order for the lease operation to complete. * * @param route route of the connection. * @param state arbitrary object that represents a particular state * (usually a security principal or a unique token identifying * the user whose credentials have been used while establishing the connection). * May be <code>null</code>. * @return future for a leased pool entry. */ public Future<E> lease(final T route, final Object state) { return lease(route, state, null); }
/** * Attempts to lease a connection for the given route and with the given * state from the pool. * <p/> * Please note that this class does not maintain its own pool of execution * {@link Thread}s. Therefore, one <b>must</b> call {@link Future#get()} * or {@link Future#get(long, TimeUnit)} method on the {@link Future} * returned by this method in order for the lease operation to complete. * * @param route route of the connection. * @param state arbitrary object that represents a particular state * (usually a security principal or a unique token identifying * the user whose credentials have been used while establishing the connection). * May be <code>null</code>. * @return future for a leased pool entry. */ public Future<E> lease(final T route, final Object state) { return lease(route, state, null); }
/** * Attempts to lease a connection for the given route and with the given * state from the pool. * <p> * Please note that this class does not maintain its own pool of execution * {@link Thread}s. Therefore, one <b>must</b> call {@link Future#get()} * or {@link Future#get(long, TimeUnit)} method on the {@link Future} * returned by this method in order for the lease operation to complete. * * @param route route of the connection. * @param state arbitrary object that represents a particular state * (usually a security principal or a unique token identifying * the user whose credentials have been used while establishing the connection). * May be {@code null}. * @return future for a leased pool entry. */ public Future<E> lease(final T route, final Object state) { return lease(route, state, null); }