org.objectweb.dream.channel
Interface IPSocketManager

All Known Implementing Classes:
IPSocketManagerCachingImpl, IPSocketManagerTCPImpl

public interface IPSocketManager

Interface used by ChannelOut to retreive a socket to send a message to an IPChannelIn identified by its InetAddressand its port.


Field Summary
static String ITF_NAME
          The default name of interface of this type.
 
Method Summary
 SocketState getSocket(InetAddress address, int port)
          Returns a socket that can be used to send message to the ChannelIn identified by the given IP address and port.
 void releaseSocket(SocketState socketState, boolean error)
          Releases the given SocketStateImpl.
 

Field Detail

ITF_NAME

public static final String ITF_NAME
The default name of interface of this type.

See Also:
Constant Field Values
Method Detail

getSocket

public SocketState getSocket(InetAddress address,
                             int port)
                      throws IOException,
                             InterruptedException
Returns a socket that can be used to send message to the ChannelIn identified by the given IP address and port.

Parameters:
address - the address of the ChannelIn.
port - the port of the ChannelIn.
Returns:
a connection to the ChannelIn.
Throws:
IOException - if the socket can't be opened.
InterruptedException - if the component is interrupted while waiting for a socket to be released.

releaseSocket

public void releaseSocket(SocketState socketState,
                          boolean error)
Releases the given SocketStateImpl.

Parameters:
socketState - the socket state to release.
error - true if an exception has been catched while sending the message, false otherwise.


Copyright © 2003, 2004 - INRIA Rhone-Alpes - All Rights Reserved.