|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.otfeed.OTPooledConnectionFactory
public class OTPooledConnectionFactory
Class that facilitates connection pooling (sharing).
This class maintains (at most) one connection to the
Opentick server and routes all connect(IConnectionStateListener)
requests
to this single connection. This is convenient as all clients
can view their copy of connection as an independant one. This
is efficient, because only minimal number of system resources
is consumed.
It is recommended that this class should be used whenever there is
a chance that factory's connect(IConnectionStateListener)
method can be called more
than once.
Constructor Summary | |
---|---|
OTPooledConnectionFactory()
|
Method Summary | |
---|---|
IConnection |
connect(IConnectionStateListener listener)
Connects to the server. |
IConnectionFactory |
getConnectionFactory()
|
void |
setConnectionFactory(IConnectionFactory engine)
The factory of shared connection (typically an instance of OTConnectionFactory ). |
void |
shutdownAll()
Forces the shutdown of the pooled connection. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public OTPooledConnectionFactory()
Method Detail |
---|
public void setConnectionFactory(IConnectionFactory engine)
OTConnectionFactory
).
engine
- public IConnectionFactory getConnectionFactory()
public IConnection connect(IConnectionStateListener listener)
IConnectionFactory
listener
parameter.
connect
in interface IConnectionFactory
listener
- listener to receive connection state events. This parameter
may be null, to indicate that there is no interest in monitoring
connection status.public void shutdownAll()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |