|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.mymed.controller.core.manager.connection.ConnectionManager
public final class ConnectionManager
The manager of the connections and of the pools. It is a singleton since all
it does is providing the methods for accessing the pool. The logic is all in
the pool.
To request a connection it is just necessary to call the checkOut()
methods with the appropriate parameters. If a pool for that connection is not
available, it will be created, otherwise it will get the one already
available and return a connection from there.
To return a connection to the pool, it is necessary to use the
checkIn()
method.
The release()
method is not yet implemented.
Method Summary | |
---|---|
void |
checkIn(IConnection connection)
Give a connection back to the pool |
IConnection |
checkOut(java.lang.String address,
int port)
Take a connection from the pool. |
IConnection |
checkOut(java.lang.String address,
int port,
int capacity)
Take a connection from the pool. |
static ConnectionManager |
getInstance()
Get the instance of the manager |
int |
getPoolSize(java.lang.String address,
int port)
Retrieve the actual size of the pool identified by this address and port |
void |
release()
Release all the connection in the pool NOT IMPLEMENTED YET |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static ConnectionManager getInstance()
public IConnection checkOut(java.lang.String address, int port)
IConnectionManager
checkOut
in interface IConnectionManager
address
- the address of the connectionport
- the port of the connection
public IConnection checkOut(java.lang.String address, int port, int capacity)
IConnectionManager
capacity
.
checkOut
in interface IConnectionManager
address
- the address of the connectionport
- the port of the connectioncapacity
- the capacity of the pool
public void checkIn(IConnection connection)
IConnectionManager
checkIn
in interface IConnectionManager
connection
- the connection to return to the poolpublic int getPoolSize(java.lang.String address, int port)
IConnectionManager
getPoolSize
in interface IConnectionManager
address
- the address of the connectionport
- the port of the connection
public void release()
IConnectionManager
NOT IMPLEMENTED YET
release
in interface IConnectionManager
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |