org.apache.manifoldcf.crawler.interfaces
Class RepositoryConnectorFactory.Pool

java.lang.Object
  extended by org.apache.manifoldcf.crawler.interfaces.RepositoryConnectorFactory.Pool
Enclosing class:
RepositoryConnectorFactory

public static class RepositoryConnectorFactory.Pool
extends java.lang.Object

This class represents a value in the pool hash, which corresponds to a given key.


Field Summary
protected  RepositoryConnectorFactory.PoolKey key
           
protected  int numFree
           
protected  java.util.ArrayList stack
           
 
Constructor Summary
RepositoryConnectorFactory.Pool(RepositoryConnectorFactory.PoolKey pk, int maxCount)
          Constructor
 
Method Summary
 IRepositoryConnector getConnector(IThreadContext threadContext)
          Grab a repository connector.
 void pollAll(IThreadContext threadContext)
          Notify all free connectors.
 void printStats()
          Print pool stats
 void releaseAll(IThreadContext threadContext)
          Release all free connectors.
 void releaseConnector(IRepositoryConnector connector)
          Release a repository connector to the pool.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

stack

protected java.util.ArrayList stack

key

protected RepositoryConnectorFactory.PoolKey key

numFree

protected int numFree
Constructor Detail

RepositoryConnectorFactory.Pool

public RepositoryConnectorFactory.Pool(RepositoryConnectorFactory.PoolKey pk,
                                       int maxCount)
Constructor

Method Detail

getConnector

public IRepositoryConnector getConnector(IThreadContext threadContext)
                                  throws ManifoldCFException
Grab a repository connector. If none exists, construct it using the information in the pool key.

Returns:
the connector, or null if no connector could be connected.
Throws:
ManifoldCFException

releaseConnector

public void releaseConnector(IRepositoryConnector connector)
                      throws ManifoldCFException
Release a repository connector to the pool.

Parameters:
connector - is the connector.
Throws:
ManifoldCFException

pollAll

public void pollAll(IThreadContext threadContext)
             throws ManifoldCFException
Notify all free connectors.

Throws:
ManifoldCFException

releaseAll

public void releaseAll(IThreadContext threadContext)
                throws ManifoldCFException
Release all free connectors.

Throws:
ManifoldCFException

printStats

public void printStats()
Print pool stats