|
xmlBlaster 2.2.0 API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.xmlBlaster.protocol.jdbc.NamedConnectionPool.UnnamedConnectionPool
private class NamedConnectionPool.UnnamedConnectionPool
Inner class, every user of the Named pool has its own connection pool.
If the resource pool is exhausted, the request will poll for a connection 5 times, with 1 sec sleeping in between.JdbcPool.maxResourceExhaustRetries=5 JdbcPool.resourceExhaustSleepGap=1000
Field Summary | |
---|---|
private NamedConnectionPool |
boss
|
private java.lang.String |
dbPasswd
|
private java.lang.String |
dbUrl
|
private java.lang.String |
dbUser
|
private long |
eraseUnusedPoolTimeout
|
private int |
maxResourceExhaustRetries
If the pool is exhausted, we poll the given times |
private static java.lang.String |
ME
|
private java.lang.Object |
meetingPoint
|
(package private) PoolManager |
poolManager
|
private long |
resourceExhaustSleepGap
If the pool is exhausted, we poll every given millis Please note that the current request thread will block for maxResourceExhaustRetries*resourceExhaustSleepGap millis. |
private Timestamp |
timeoutHandle
|
private java.lang.Object |
timeoutMonitor
|
Constructor Summary | |
---|---|
NamedConnectionPool.UnnamedConnectionPool(NamedConnectionPool boss,
java.lang.String dbUrl,
java.lang.String dbUser,
java.lang.String dbPasswd,
long eraseUnusedPoolTimeout,
int maxInstances,
long busyToIdle,
long idleToErase)
|
Method Summary | |
---|---|
void |
busyToIdle(java.lang.Object resource)
This callback does nothing (enforced by interface I_PoolManager |
(package private) void |
destroy()
Destroy the complete unnamed pool |
(package private) void |
erase(java.sql.Connection con)
Destroy a JDBC connection (from busy or idle to undef). |
void |
idleToBusy(java.lang.Object resource)
This callback does nothing (enforced by interface I_PoolManager) |
(package private) void |
release(java.sql.Connection con)
Use this method to release a JDBC connection. |
(package private) java.sql.Connection |
reserve()
Use this method to get a JDBC connection. |
void |
timeout(java.lang.Object o)
Timeout callback enforced by I_Timeout. |
java.lang.Object |
toCreate(java.lang.String instanceId)
Create a new JDBC connection, the driver must be registered already. |
void |
toErased(java.lang.Object resource)
Destroy the JDBC connection. |
java.lang.String |
toXml()
Dump state of this object into a XML ASCII string. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private static final java.lang.String ME
private NamedConnectionPool boss
PoolManager poolManager
private java.lang.String dbUrl
private java.lang.String dbUser
private java.lang.String dbPasswd
private long eraseUnusedPoolTimeout
private int maxResourceExhaustRetries
private long resourceExhaustSleepGap
private Timestamp timeoutHandle
private final java.lang.Object timeoutMonitor
private final java.lang.Object meetingPoint
Constructor Detail |
---|
public NamedConnectionPool.UnnamedConnectionPool(NamedConnectionPool boss, java.lang.String dbUrl, java.lang.String dbUser, java.lang.String dbPasswd, long eraseUnusedPoolTimeout, int maxInstances, long busyToIdle, long idleToErase)
boss
- My managereraseUnusedPoolTimeout
- This pool is erased after given millis without activity of the owning usermaxInstances
- Max. number of resources in this pool.
-1 uses default of 20 (xmlBlaster.properties)busyToIdleTimeout
- Max. busy time of this resource in milli secondsidleToEraseTimeout
- Max. idle time span of this resource in milli secondsMethod Detail |
---|
public void idleToBusy(java.lang.Object resource)
idleToBusy
in interface I_PoolManager
public void busyToIdle(java.lang.Object resource)
busyToIdle
in interface I_PoolManager
public java.lang.Object toCreate(java.lang.String instanceId) throws XmlBlasterException
toCreate
in interface I_PoolManager
XmlBlasterException
public void toErased(java.lang.Object resource)
toErased
in interface I_PoolManager
The
- Connection objectjava.sql.Connection reserve() throws XmlBlasterException
XmlBlasterException
void release(java.sql.Connection con) throws XmlBlasterException
XmlBlasterException
void erase(java.sql.Connection con) throws XmlBlasterException
XmlBlasterException
public void timeout(java.lang.Object o)
timeout
in interface I_Timeout
o
- You get bounced back your userData which you passed
with Timeout.addTimeoutListener()void destroy()
public final java.lang.String toXml()
|
xmlBlaster 2.2.0 API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |