solar.service.transport
Interface Transport

All Known Implementing Classes:
PastryTransport, TcpTransport, UdpTransport

public interface Transport

Interface for transport layer.

Version:
$Id: Transport.java,v 1.6 2003/10/05 18:51:03 glchen Exp $
Author:
Guanling Chen

Method Summary
 void addTransportListener(TransportListener listener)
          Add a transport listener.
 Address getAddressByKey(java.lang.String key)
          Return a peer address by specified key.
 Address getLocalAddress()
          Return the local address of this transport layer.
 void removeTransportListener(TransportListener listener)
          Remove a transport listener.
 void send(Adu adu, Address dest)
          Send the adu over transport to destination.
 void send(Adu adu, Address dest, Id multiplex)
          Send the adu over transport to destination, with a multipex ID.
 void send(byte[] data, Address dest)
          Send an data unit to destination address.
 void send(byte[] data, Address dest, Id multiplex)
          Send an data unit to destination address with a multiplexer.
 void setAduFactory(AduFactory factory)
          Set the factory that parse the received bytes into data unit.
 void stop()
          Stop the transport layer.
 

Method Detail

setAduFactory

public void setAduFactory(AduFactory factory)
Set the factory that parse the received bytes into data unit.


getLocalAddress

public Address getLocalAddress()
Return the local address of this transport layer.


getAddressByKey

public Address getAddressByKey(java.lang.String key)
                        throws TransportException
Return a peer address by specified key.

TransportException

send

public void send(byte[] data,
                 Address dest)
          throws TransportException
Send an data unit to destination address.

TransportException

send

public void send(byte[] data,
                 Address dest,
                 Id multiplex)
          throws TransportException
Send an data unit to destination address with a multiplexer.

TransportException

send

public void send(Adu adu,
                 Address dest)
          throws TransportException
Send the adu over transport to destination.

TransportException

send

public void send(Adu adu,
                 Address dest,
                 Id multiplex)
          throws TransportException
Send the adu over transport to destination, with a multipex ID.

TransportException

addTransportListener

public void addTransportListener(TransportListener listener)
Add a transport listener.


removeTransportListener

public void removeTransportListener(TransportListener listener)
Remove a transport listener.


stop

public void stop()
Stop the transport layer.