|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.Objectorg.apache.manifoldcf.crawler.connectors.webcrawler.ThrottledFetcher.ConnectionBin
protected static class ThrottledFetcher.ConnectionBin
Connection pool for a bin. An instance of this class tracks the connections that are pooled and that are in use for a specific bin.
| Field Summary | |
|---|---|
protected java.lang.String |
binName
This is the bin name which this connection pool belongs to |
protected java.lang.Integer |
connectionWait
This object is what we synchronize on when we are waiting on a connection to free up for this bin. |
protected java.util.HashMap |
freePool
This map contains ThrottledConnection objects that are in the pool, and are not in use. |
protected int |
inUseConnections
This is the number of connections in this bin that are signed out and presumably in use |
protected long |
lastFetchTime
This is the last time a fetch was done on this bin |
| Constructor Summary | |
|---|---|
ThrottledFetcher.ConnectionBin(java.lang.String binName)
Constructor. |
|
| Method Summary | |
|---|---|
void |
addToPool(ThrottledFetcher.ThrottledConnection tc)
Put a connection into the pool. |
int |
countConnections()
Count connections that are in use. |
protected boolean |
existsInPool(ThrottledFetcher.ThrottledConnection tc)
Check if a connection exists in the pool already. |
ThrottledFetcher.ThrottledConnection |
findConnection(int maxConnections,
ThrottledFetcher.ConnectionBin[] binNames,
java.lang.String protocol,
java.lang.String server,
int port,
PageCredentials authentication,
java.lang.String trustStoreString)
This method is called only when there is no existing connection yet identified that can be used for contacting the server and port specified. |
boolean |
flushIdleConnections(long idleTimeout)
Flush any idle connections. |
java.lang.String |
getBinName()
Get the bin name. |
long |
getLastFetchTime()
Get the last fetch time. |
protected ThrottledFetcher.ThrottledConnection |
getPoolConnection()
Grab a connection from the current pool. |
void |
insureWithinLimits(int maxConnections,
ThrottledFetcher.ThrottledConnection existingConnection)
Verify that this bin is within limits. |
void |
noteConnectionCreation()
Note the creation of an active connection that belongs to this bin. |
void |
noteConnectionDestruction()
Note the destruction of an active connection that belongs to this bin. |
void |
sanityCheck()
|
void |
setLastFetchTime(long currentTime)
Note a new time for connection fetch for this pool. |
void |
takeFromPool(ThrottledFetcher.ThrottledConnection tc)
Activate a connection that should be in the pool. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected java.lang.String binName
protected int inUseConnections
protected long lastFetchTime
protected java.lang.Integer connectionWait
protected java.util.HashMap freePool
| Constructor Detail |
|---|
public ThrottledFetcher.ConnectionBin(java.lang.String binName)
| Method Detail |
|---|
public java.lang.String getBinName()
public void noteConnectionCreation()
public void noteConnectionDestruction()
public void takeFromPool(ThrottledFetcher.ThrottledConnection tc)
public void addToPool(ThrottledFetcher.ThrottledConnection tc)
public void insureWithinLimits(int maxConnections,
ThrottledFetcher.ThrottledConnection existingConnection)
throws ThrottledFetcher.PoolException
ThrottledFetcher.PoolException
public ThrottledFetcher.ThrottledConnection findConnection(int maxConnections,
ThrottledFetcher.ConnectionBin[] binNames,
java.lang.String protocol,
java.lang.String server,
int port,
PageCredentials authentication,
java.lang.String trustStoreString)
throws ThrottledFetcher.PoolException
ThrottledFetcher.PoolExceptionpublic void setLastFetchTime(long currentTime)
currentTime - is the time the fetch was started.public long getLastFetchTime()
public int countConnections()
public boolean flushIdleConnections(long idleTimeout)
protected ThrottledFetcher.ThrottledConnection getPoolConnection()
protected boolean existsInPool(ThrottledFetcher.ThrottledConnection tc)
public void sanityCheck()
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||