|
||||||||||
| 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 one physical connection per specification
and routes all connect(OTConnectionSpec, IConnectionStateListener)
requests to the connection that matches the specification.
This is convenient as all clients
can view their copy of connection as an independent 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(OTConnectionSpec,IConnectionStateListener) method can be called more
than once.
| Constructor Summary | |
|---|---|
OTPooledConnectionFactory()
|
|
| Method Summary | |
|---|---|
IConnection |
connect(IConnectionStateListener listener)
Please use IConnectionFactory.connect(OTConnectionSpec, IConnectionStateListener)
method. |
IConnection |
connect(OTConnectionSpec spec,
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)
IConnectionFactoryIConnectionFactory.connect(OTConnectionSpec, IConnectionStateListener)
method.
connect in interface IConnectionFactory
public IConnection connect(OTConnectionSpec spec,
IConnectionStateListener listener)
IConnectionFactorylistener
parameter.
connect in interface IConnectionFactoryspec - connection specification. Some implementations may accept
null value, which would mean to use some default values
for the connection parameters.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 | |||||||||