com.infoengine.messaging
Class MsgService.MOMSharedPool
java.lang.Object
java.lang.Thread
com.infoengine.util.IEThread
com.infoengine.messaging.MsgService.MOMSharedPool
- All Implemented Interfaces:
- MsgService.MOMConnectionPool, Runnable
- Enclosing class:
- MsgService
- class MsgService.MOMSharedPool
- extends IEThread
- implements MsgService.MOMConnectionPool
A simple connection pool used to organize and maintain connections
to a MOM. Since SonicMQ will only allow one connection per user name
this pool only maintains one connection per user. Each time a connection
is retrieved from the pool its reference count is incremented. A connection's
reference counts indicates how many times a particular connection is in use.
each time a connection is released from the pool its reference count is
decremented. When the reference count reaches zero the connection may be
removed from the pool since it is no longer in use. A connection with a
reference count of zero will remain available in the pool for a period of
time before being removed to avoid the over head of creating a new connection
if another request for the particular connection comes along. After a
connection has been idle for a certain period of time it will be removed
from the pool and closed.
Fields inherited from class com.infoengine.util.IEThread |
|
Methods inherited from class java.lang.Thread |
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getContextClassLoader, getName, getPriority, getThreadGroup, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setName, setPriority, sleep, sleep, start, stop, stop, suspend, yield |
myName
private String myName
service
private MsgService service
factory
private javax.jms.ConnectionFactory factory
connections
MsgService.MOMHash connections
die
private boolean die
expireInterval
private long expireInterval
idleTime
private long idleTime
MsgService.MOMSharedPool
public MsgService.MOMSharedPool(String myName,
MsgService service,
javax.jms.ConnectionFactory factory)
run
public void run()
- Specified by:
run
in interface Runnable
die
public void die()
- Specified by:
die
in interface MsgService.MOMConnectionPool
expire
private void expire()
get
public javax.jms.Connection get(String user,
String pass)
throws javax.jms.JMSException
- Specified by:
get
in interface MsgService.MOMConnectionPool
- Throws:
javax.jms.JMSException
release
public void release(String user,
String pass)
- Specified by:
release
in interface MsgService.MOMConnectionPool
toString
public String toString()
logStatus
public void logStatus(String log)