|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.ibm.di.server.ConnectorPool
public class ConnectorPool
This class is a pool for connectors. It stores certain amount and can give them when needed. When not needed the connectors can be returned to the pool. Also the pool is periodically purged, thus shrunk to a specified size.
Constructor Summary | |
---|---|
ConnectorPool(java.lang.String aConnectorLibName,
PoolDefConfig aPoolDefConfig,
Log aLog)
Constructor of the connector pool. |
Method Summary | |
---|---|
ConnectorInterface |
getConnector()
Returns a connector from the pool. |
ConnectorInterface |
getConnector(boolean aWaitOnExhausted)
Returns a connector from the pool if there is an available free one. |
int |
getFreeConnectorsNum()
Returns the count of the free connectors in the pool. |
java.lang.String |
getName()
Returns the name of the connector pool. |
PoolDefConfig |
getPoolConfig()
Returns the pool configuration. |
int |
getSize()
Returns the size of the pool (the count of connectors in it). |
void |
initialize()
Initializes the connector pool. |
void |
purge()
Removes connectors from the pool and the free connectors collection until the minimum size of the pool is reached. |
void |
returnConnector(ConnectorInterface aConnector)
Returns a connector to the pool and enlists it again in the free connectors. |
void |
terminate()
Terminates the connector pool. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ConnectorPool(java.lang.String aConnectorLibName, PoolDefConfig aPoolDefConfig, Log aLog) throws java.lang.Exception
aConnectorLibName
- a connector pool name used for logging.aPoolDefConfig
- a default configuration for the poolaLog
- a Log object used to log messages to log files
java.lang.Exception
Method Detail |
---|
public void initialize() throws java.lang.Exception
java.lang.Exception
- if a problem occurspublic void terminate() throws java.lang.Exception
java.lang.Exception
- if a problem occurspublic java.lang.String getName()
public int getSize()
public int getFreeConnectorsNum()
public PoolDefConfig getPoolConfig()
public ConnectorInterface getConnector() throws java.lang.Exception
java.lang.Exception
- if a problem occurspublic ConnectorInterface getConnector(boolean aWaitOnExhausted) throws java.lang.Exception
aWaitOnExhausted
option is used, this method will wait
for a connector to be returned to the pool and use it. When a connector
is taken from the pool it is no longer a free connector but a used one.
aWaitOnExhausted
- whether to wait for a connector to be returned to the pool, or
take one directly
java.lang.Exception
- if a problem occurspublic void returnConnector(ConnectorInterface aConnector) throws java.lang.Exception
aConnector
- the returned connector
java.lang.Exception
- if a problem occurspublic void purge()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |