org.objectweb.dream.channel
Class ConnectionState

java.lang.Object
  extended byorg.objectweb.dream.channel.ConnectionState

public class ConnectionState
extends Object

Class returned by DestinationSocketManager.getConnection(java.net.InetAddress, int). It contains a socket, and can be used to retreive associated ObjectOutputand ObjectInput.


Field Summary
protected  ObjectInputStream input
           
protected  ObjectOutputStream output
           
protected  Socket socket
           
 
Constructor Summary
ConnectionState(Socket socket)
          Creates a new connection state for the specified socket.
 
Method Summary
 void close()
          Closes the connection.
 ObjectInput getInput()
          Returns an ObjectInputthat can be used to read data from the socket.
 ObjectOutput getOutput()
          Returns an ObjectOutputthat can be used to write data to the socket.
 boolean isClosed()
          Returns true if the socket is closed or is deconnected.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

socket

protected Socket socket

input

protected ObjectInputStream input

output

protected ObjectOutputStream output
Constructor Detail

ConnectionState

public ConnectionState(Socket socket)
Creates a new connection state for the specified socket.

Parameters:
socket - a socket.
Method Detail

isClosed

public boolean isClosed()
Returns true if the socket is closed or is deconnected.

Returns:
true if the socket is closed or is deconnected.

getInput

public ObjectInput getInput()
                     throws IOException
Returns an ObjectInputthat can be used to read data from the socket.

Returns:
an ObjectInputconnected to the socket.
Throws:
IOException - if the ObjectInputcan't be created.

getOutput

public ObjectOutput getOutput()
                       throws IOException
Returns an ObjectOutputthat can be used to write data to the socket.

Returns:
an ObjectOutputconnected to the socket.
Throws:
IOException - if the ObjectOutputcan't be created.

close

public void close()
Closes the connection.



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