All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.ldaptive.pool.ConnectionPool Maven / Gradle / Ivy

There is a newer version: 2.4.0
Show newest version
/* See LICENSE for licensing and NOTICE for copyright. */
package org.ldaptive.pool;

import java.util.Set;
import org.ldaptive.Connection;

/**
 * Provides an interface for connection pooling.
 *
 * @author  Middleware Services
 */
public interface ConnectionPool
{


  /**
   * Returns the activator for this pool.
   *
   * @return  activator
   */
  Activator getActivator();


  /**
   * Sets the activator for this pool.
   *
   * @param  a  activator
   */
  void setActivator(Activator a);


  /**
   * Returns the passivator for this pool.
   *
   * @return  passivator
   */
  Passivator getPassivator();


  /**
   * Sets the passivator for this pool.
   *
   * @param  p  passivator
   */
  void setPassivator(Passivator p);


  /**
   * Returns the validator for this pool.
   *
   * @return  validator
   */
  Validator getValidator();


  /**
   * Sets the validator for this pool.
   *
   * @param  v  validator
   */
  void setValidator(Validator v);


  /** Initialize this pool for use. */
  void initialize();


  /**
   * Returns an object from the pool.
   *
   * @return  pooled object
   *
   * @throws  PoolException  if this operation fails
   * @throws  BlockingTimeoutException  if this pool is configured with a block time and it occurs
   * @throws  PoolInterruptedException  if this pool is configured with a block time and the current thread is
   *                                    interrupted
   */
  Connection getConnection()
    throws PoolException;


  /**
   * Returns the number of connections available for use.
   *
   * @return  count
   */
  int availableCount();


  /**
   * Returns the number of connections in use.
   *
   * @return  count
   */
  int activeCount();


  /**
   * Returns the statistics for each connection in the pool.
   *
   * @return  connection statistics
   */
  Set getPooledConnectionStatistics();


  /** Empty this pool, freeing any resources. */
  void close();
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy