Saros
Distributed Collaborative Editing and Distributed Party Programming
de.fu_berlin.inf.dpp.net.internal.ConnectionPool Class Reference

List of all members.

Public Member Functions

synchronized void open ()
void close ()
synchronized IByteStreamConnection get (final String id)
synchronized IByteStreamConnection add (final String id, final IByteStreamConnection connection)
synchronized IByteStreamConnection remove (final String id)

Detailed Description

A connection pool with the ability to close all pooled connections when the pool is closed. After construction the pool must be opened first.


Member Function Documentation

synchronized IByteStreamConnection de.fu_berlin.inf.dpp.net.internal.ConnectionPool.add ( final String  id,
final IByteStreamConnection  connection 
)

Adds the connection with the given id to the pool.

Parameters:
idid of the connection
connectionthe connection to add
Returns:
either the original connection if the pool is closed or the previous connection that was already added with the given id or null if no connection was added with the given id
void de.fu_berlin.inf.dpp.net.internal.ConnectionPool.close ( )

Closes the connection pool. All connection that currently exists in the pool will be closed.

synchronized IByteStreamConnection de.fu_berlin.inf.dpp.net.internal.ConnectionPool.get ( final String  id)

Returns the connection with the given id.

Parameters:
idid of the connection
Returns:
the connection associated with the id or null if no such connection exists or the pool is closed
synchronized void de.fu_berlin.inf.dpp.net.internal.ConnectionPool.open ( )

Opens the connection pool. After the connection pool is opened connections can be added, removed or retrieved.

synchronized IByteStreamConnection de.fu_berlin.inf.dpp.net.internal.ConnectionPool.remove ( final String  id)

Removes the connection with the given id from the pool.

Parameters:
idid of the connection
Returns:
the connection associated with the id or null if no such connection exists or the pool is closed
 All Classes Namespaces Files Functions Variables Enumerations