|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object | +--com.sap.mw.jco.JCO.Pool
This class encapsulates a connection pool.
A pool is a set of client-connections to a certain destination.
The pool may automatically create new connections to the specified remote system
or return an already existing one. It also provides methods to return a connection
back to the pool when it is no longer needed.
It checks periodically which connections are no longer in use and
can be closed in order to save valuable system resources.
The time period after which the pool checks the connections
as well as the time after which a connection will time-out
can be configured by the calling application.
| Field Summary | |
int |
INFINITE
The max of connections these can be created by the pool |
| Method Summary | |
void |
detachFromPool(JCO.Client client)
Detaches a client-connection from the pool. |
boolean |
getAbapDebug()
Returns true if ABAP debugging is enabled for the connections of this pool, and false otherwise. |
long |
getConnectionTimeout()
Returns the connection timeout in milliseconds. |
int |
getCurrentPoolSize()
Returns the number of connections that are created for this pool and are currently alive. |
int |
getMaxConnections()
Returns the maximum number of connections that can be allocated from the pool. |
int |
getMaxPoolSize()
Returns the maximum number of connections that will be pooled. |
int |
getMaxUsed()
Returns the max. number of connections used simultaneously so far |
long |
getMaxWaitTime()
Returns the maximum time to wait in a connection request for a free connection. |
java.lang.String |
getName()
Returns the pool's name |
int |
getNumUsed()
Returns the number of connections in the pool which are currently reserved by the application due to calls to JCO.getClient(). |
int |
getNumWaitingThreads()
Returns the number of threads that are waiting for a connection. |
JCO.PoolManager |
getPoolManager()
Returns the pool manager this pool is a member of |
boolean |
getResetOnRelease()
Returns true if a connection is being cleaned up in JCO.releaseClient(), false otherwise. |
byte[] |
getStates()
Deprecated. This method will be removed in the next release. Use getNumUsed(), getCurrentPoolSize() instead |
long |
getTimeoutCheckPeriod()
Returns the timeout check period in milliseconds. |
boolean |
getTrace()
Returns whether trace for this pool is enabled or not. |
void |
setAbapDebug(boolean debug)
Enables/disables ABAP debug. |
void |
setConnectionTimeout(long connection_timeout)
Sets the connection timeout in milliseconds. |
void |
setMaxConnections(int max_connections)
Sets the maximum number of connections which can be allocated from the pool. |
void |
setMaxPoolSize(int max_pool_size)
Sets the maximum number of connections which will be held open by the pool for possible future reuse after they have been released. |
void |
setMaxWaitTime(long max_wait_time)
Sets the maximum time to wait in a connection request for a free connection. |
void |
setResetOnRelease(boolean reset_on_release)
Enables/disables cleanup when the client is being returned to its pool. |
void |
setTimeoutCheckPeriod(long timeout_check_period)
Sets the timeout check period in milliseconds. |
void |
setTrace(boolean trace)
Enables/disables RFC tracing for the connections of the pool. This property only affects future connections that will be created by the pool. |
| Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
public final int INFINITE
| Method Detail |
public final void setResetOnRelease(boolean reset_on_release)
reset_on_release - if true reset the connection, e.g. free all resources
that might have been allocated on either the server side or by the local
middleware layer. On systems below SAP 4.0A resetting a connection
effectively means closing and subsequently reopening the connection
which is a very expensive process. However, several scenarios
(e.g. BAPIs) need reinitialized connections while others might not.
This depends strongly on the function modules and their implementation
in the mySAP system. In certain cases it might be worthwhile to switch
the cleanup off for performance reasons. Use with care !public final boolean getResetOnRelease()
public void setAbapDebug(boolean debug)
debug - if true enables ABAP debugging, disables it otherwisepublic final boolean getAbapDebug()
setAbapDebug(boolean)public final boolean getTrace()
public final void setTrace(boolean trace)
trace - if true enables the trace and disables it otherwise.public final java.lang.String getName()
public final JCO.PoolManager getPoolManager()
public final int getMaxPoolSize()
setMaxPoolSize(int),
getMaxConnections()public final void setMaxPoolSize(int max_pool_size)
java.lang.IllegalArgumentException - if max_pool_size is
less than zero.getMaxConnections()public final int getMaxConnections()
setMaxConnections(int)public final void setMaxConnections(int max_connections)
max_connections - maximum numbert of connectionsJCO.Exception - if an error occurs during resizing of poolsetMaxPoolSize(int)public final int getCurrentPoolSize()
getClient(pool_name) method
plus the number of connections that are currently held by the pool (being the
connections that have been previuosly released with the releaseClient(client)
method).public final int getMaxUsed()
public final int getNumUsed()
public final int getNumWaitingThreads()
public final void setMaxWaitTime(long max_wait_time)
max_wait_time - the maximum time to wait for a free connection
in millisecondspublic final long getMaxWaitTime()
public long getConnectionTimeout()
setMaxWaitTime(long),
setConnectionTimeout(long),
PoolManager#setConnectionTimeout(long)public void setConnectionTimeout(long connection_timeout)
connection_timeout - the new value for the connection timeout in millisecondsgetConnectionTimeout()public long getTimeoutCheckPeriod()
public void setTimeoutCheckPeriod(long timeout_check_period)
timeout_check_period - the timeout check period in milliseconds.java.lang.IllegalArgumentException - if timeout_check_period is negative.getTimeoutCheckPeriod()public final byte[] getStates()
getNumUsed(), getCurrentPoolSize() instead
getNumUsed(), getCurrentPoolSize()
to get information about allocated clients and the free client
connections remained in the pool.
Returns an empty array for backwards compatibility.getNumUsed(),
getCurrentPoolSize()public void detachFromPool(JCO.Client client)
client - the client connection which is being returned to its poolJCO.Exception - thrown if a connection could not be removed from pool cleanly
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||