org.openorb.orb.net
Interface Transport

All Known Implementing Classes:
IIOPTransport

public interface Transport

Transport for messages. Overload toString to give some info on the transport layer. Synchronization groupings:

( [open, close, isOpen, (sendMessage, recvMessage)], establishAssociation )

Version:
$Revision: 1.5 $ $Date: 2004/02/10 21:02:50 $
Author:
Chris Wood

Method Summary
 void close()
          Close the connection.
 boolean establishAssociation(Address addr)
          Check for applicability of channel for carrying messages for the specified address and setup any client transport binding.
 boolean isOpen()
          Is is the transport open?
 void open()
          Open the connection.
 StorageBuffer recvMessage(int timeout)
          Read next message.
 void sendMessage(StorageBuffer msg)
          Write message to comms protocol.
 

Method Detail

open

public void open()
Open the connection. This is only ever called by client channels.
Throws:
org.omg.CORBA.COMM_FAILURE - failed to open channel. This exception will be reported to clients.

close

public void close()
Close the connection.

isOpen

public boolean isOpen()
Is is the transport open?

sendMessage

public void sendMessage(StorageBuffer msg)
Write message to comms protocol. If an interrupt occours while writing the interrupt will be preserved.
Parameters:
msg - The message to be sent.
Throws:
org.omg.CORBA.COMM_FAILURE - Transport failure occurred.

recvMessage

public StorageBuffer recvMessage(int timeout)
                          throws java.io.EOFException
Read next message. This function will be regularly serviced by a worker thread. This operation always reads an entire message if it can, if an interupt occours while reading the interrupt will be preserved.
Parameters:
timeout - max time to wait before recieving a message. If 0 wait until the read occours or the thread performing the read is interrupted.
Throws:
java.io.EOFException - end of file has been reached. This is an orderly shutdown.
org.omg.CORBA.COMM_FAILURE - Transport failure occoured. This is a disorderly shutdown.

establishAssociation

public boolean establishAssociation(Address addr)
Check for applicability of channel for carrying messages for the specified address and setup any client transport binding.
Parameters:
addr - the address.
Returns:
true if this transport can carry messages for the target. Basic checks like checking the host and port will already be done, just check specifics. If false a new channel will be opened for requests.