com.mymed.controller.core.manager.connection
Interface IConnectionManager

All Known Implementing Classes:
ConnectionManager

public interface IConnectionManager

Common interface for a connection manager

Author:
Milo Casagrande

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.
 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
 

Method Detail

checkOut

IConnection checkOut(java.lang.String address,
                     int port,
                     int capacity)
Take a connection from the pool. If there is no pool, a new one is created with capacity set to capacity.

Parameters:
address - the address of the connection
port - the port of the connection
capacity - the capacity of the pool
Returns:
an open connection, or null

checkOut

IConnection checkOut(java.lang.String address,
                     int port)
Take a connection from the pool. If there is no pool, a new one is initialized with capacity set to zero, meaning that there is no limit in the pool.

Parameters:
address - the address of the connection
port - the port of the connection
Returns:
an open connection, or null

checkIn

void checkIn(IConnection connection)
Give a connection back to the pool

Parameters:
connection - the connection to return to the pool

release

void release()
Release all the connection in the pool

NOT IMPLEMENTED YET


getPoolSize

int getPoolSize(java.lang.String address,
                int port)
Retrieve the actual size of the pool identified by this address and port

Parameters:
address - the address of the connection
port - the port of the connection
Returns:
the size of the pool identified by address and port