|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.ibm.as400.access.ConnectionPool
public abstract class ConnectionPool extends Object implements Serializable
Represents a pool of connections to the system.
ConnectionPool objects generate the following events:
ConnectionPoolEvent
- The events fired are:
Constructor and Description |
---|
ConnectionPool()
|
Modifier and Type | Method and Description |
---|---|
void |
addConnectionPoolListener(ConnectionPoolListener listener)
Adds a ConnectionPoolListener. |
void |
addPropertyChangeListener(PropertyChangeListener listener)
Adds a PropertyChangeListener. |
abstract void |
close()
Closes the connection pool. |
protected void |
finalize()
Closes the connection pool if not explicitly closed by the caller. |
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(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 IBM Toolbox for Java uses additional threads. |
Methods inherited from class java.lang.Object |
---|
clone, equals, 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(PropertyChangeListener listener)
listener
- The PropertyChangeListener.removePropertyChangeListener(java.beans.PropertyChangeListener)
public abstract void close() throws ConnectionPoolException
ConnectionPoolException
- If a pool error occurs.protected void finalize() throws Throwable
finalize
in class Object
Throwable
- If an error occurs.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(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)
setThreadUsed
can be set
in interchangeable order.
The default value is true.
cleanup
- If expired connections are cleaned up by the maintenance daemon.public void setThreadUsed(boolean useThreads)
setRunMaintenance
can be called
in interchangeable order.
The default value is true.
useThreads
- true to use additional threads; false otherwise.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |