|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.ibm.as400.access.ConnectionPool
The ConnectionPool class represents a pool of connections to the AS/400.
ConnectionPool objects generate the following events:
Constructor Summary | |
ConnectionPool()
|
Method Summary | |
void |
addConnectionPoolListener(ConnectionPoolListener listener)
Adds a ConnectionPoolListener. |
void |
addPropertyChangeListener(java.beans.PropertyChangeListener listener)
Adds a PropertyChangeListener. |
abstract void |
close()
Closes the connection pool. |
long |
getCleanupInterval()
Returns the time interval for how often the maintenance daemon is run. |
int |
getMaxConnections()
Returns the maximum number of connections. |
long |
getMaxInactivity()
Returns the maximum amount of inactive time before an available connection is closed. |
long |
getMaxLifetime()
Returns the maximum life for an available connection. |
int |
getMaxUseCount()
Returns the maximum number of times a connection can be used before it is replaced in the pool. |
long |
getMaxUseTime()
Returns the maximum amount of time a connection can be in use before it is closed and returned to the pool. |
boolean |
isRunMaintenance()
Indicates whether the maintenance thread is used to cleanup expired connections. |
boolean |
isThreadUsed()
Indicates whether threads are used in communication with the host servers and for running maintenance. |
void |
removeConnectionPoolListener(ConnectionPoolListener listener)
Removes a ConnectionPoolListener. |
void |
removePropertyChangeListener(java.beans.PropertyChangeListener listener)
Removes a PropertyChangeListener. |
void |
setCleanupInterval(long cleanupInterval)
Sets the time interval for how often the maintenance daemon is run. |
void |
setMaxConnections(int maxConnections)
Sets the maximum number of connections. |
void |
setMaxInactivity(long maxInactivity)
Sets the maximum amount of inactive time before an available connection is closed. |
void |
setMaxLifetime(long maxLifetime)
Sets the maximum life for an available connection. |
void |
setMaxUseCount(int maxUseCount)
Sets the maximum number of times a connection can be used before it is replaced in the pool. |
void |
setMaxUseTime(long maxUseTime)
Sets the maximum amount of time a connection can be in use before it is closed and returned to the pool. |
void |
setRunMaintenance(boolean cleanup)
Sets whether the Toolbox does periodic maintenance on the connection pool to clean up expired connections. |
void |
setThreadUsed(boolean useThreads)
Sets whether the AS/400 Toolbox for Java uses threads in communication with the host servers and for running maintenance. |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
Constructor Detail |
public ConnectionPool()
Method Detail |
public void addConnectionPoolListener(ConnectionPoolListener listener)
listener
- The ConnectionPoolListener.removeConnectionPoolListener(com.ibm.as400.access.ConnectionPoolListener)
public void addPropertyChangeListener(java.beans.PropertyChangeListener listener)
listener
- The PropertyChangeListener.removePropertyChangeListener(java.beans.PropertyChangeListener)
public abstract void close() throws ConnectionPoolException
public long getCleanupInterval()
public int getMaxConnections()
public long getMaxInactivity()
public long getMaxLifetime()
public int getMaxUseCount()
public long getMaxUseTime()
public boolean isRunMaintenance()
public boolean isThreadUsed()
public void removePropertyChangeListener(java.beans.PropertyChangeListener listener)
listener
- The PropertyChangeListener.addPropertyChangeListener(java.beans.PropertyChangeListener)
public void removeConnectionPoolListener(ConnectionPoolListener listener)
listener
- The ConnectionPoolListener.addConnectionPoolListener(com.ibm.as400.access.ConnectionPoolListener)
public void setCleanupInterval(long cleanupInterval)
cleanupInterval
- The number of milliseconds.public void setMaxConnections(int maxConnections)
maxConnections
- Maximum number of connections.public void setMaxInactivity(long maxInactivity)
maxInactivity
- Number of milliseconds.public void setMaxLifetime(long maxLifetime)
maxLifetime
- Number of milliseconds.public void setMaxUseCount(int maxUseCount)
maxUseCount
- Maximum usage count.public void setMaxUseTime(long maxUseTime)
maxUseTime
- Number of milliseconds.public void setRunMaintenance(boolean cleanup)
cleanup
- If expired connections are cleaned up by the maintenance daemon.public void setThreadUsed(boolean useThreads)
useThreads
- true to use threads; false otherwise.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |