solar.service.transport
Class TcpObjectTransport

java.lang.Object
  |
  +--solar.service.transport.TcpTransport
        |
        +--solar.service.transport.TcpObjectTransport
All Implemented Interfaces:
java.lang.Runnable, Transport

public class TcpObjectTransport
extends TcpTransport

The TCP transport layer using object serialization.

Version:
$Id: TcpObjectTransport.java,v 1.5 2003/10/12 03:56:35 glchen Exp $
Author:
Guanling Chen

Field Summary
 
Fields inherited from class solar.service.transport.TcpTransport
_aduFactory, _flows, _hostname, _laddr, _listeners, _log, _port, _server, _ssock
 
Constructor Summary
TcpObjectTransport()
           
TcpObjectTransport(int port)
           
TcpObjectTransport(java.lang.String hostname, int port)
           
 
Method Summary
protected  TcpConnection makeTcpConnection(java.net.Socket socket, SocketAddress peer)
          Create a TcpConenction based on the socket and peer address.
 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.
 
Methods inherited from class solar.service.transport.TcpTransport
addConnection, addTransportListener, clearConnections, getAddressByKey, getAduFactory, getConnection, getLocalAddress, getLogger, getPort, notifyConnectionClosed, notifyConnectionOpened, notifyDataReceived, openConnection, removeConnection, removeTransportListener, run, setAduFactory, stop
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TcpObjectTransport

public TcpObjectTransport()
                   throws java.lang.Exception

TcpObjectTransport

public TcpObjectTransport(int port)
                   throws java.lang.Exception

TcpObjectTransport

public TcpObjectTransport(java.lang.String hostname,
                          int port)
                   throws java.lang.Exception
Method Detail

makeTcpConnection

protected TcpConnection makeTcpConnection(java.net.Socket socket,
                                          SocketAddress peer)
                                   throws java.lang.Exception
Description copied from class: TcpTransport
Create a TcpConenction based on the socket and peer address.

Overrides:
makeTcpConnection in class TcpTransport
java.lang.Exception

send

public void send(byte[] data,
                 Address dest)
          throws TransportException
Description copied from interface: Transport
Send an data unit to destination address.

Specified by:
send in interface Transport
Overrides:
send in class TcpTransport
TransportException

send

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

Specified by:
send in interface Transport
Overrides:
send in class TcpTransport
TransportException

send

public void send(Adu adu,
                 Address dest)
          throws TransportException
Description copied from interface: Transport
Send the adu over transport to destination.

Specified by:
send in interface Transport
Overrides:
send in class TcpTransport
TransportException

send

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

Specified by:
send in interface Transport
Overrides:
send in class TcpTransport
TransportException