ix.util.ipc
Class SerializedCommunicationStrategy

java.lang.Object
  extended by ix.util.ipc.SerializedCommunicationStrategy
All Implemented Interfaces:
IPC.CommunicationStrategy
Direct Known Subclasses:
IPC.SimpleIXCommunicationStrategy, IPC.XMLObjectStreamCommunicationStrategy

public class SerializedCommunicationStrategy
extends java.lang.Object
implements IPC.CommunicationStrategy

A communication strategy in which a destination is mapped to a host and port number, and objects are sent by writing their serialization to a socket.

Command-line arguments / parameters:

    -name-server=host:port
    -run-as-name-server=boolean
    -host=host
 
-host is used when it is necessary to specify the host name this agent should use when registering with the name-server.

See Also:
Parameters

Nested Class Summary
static class SerializedCommunicationStrategy.ObjectStreamNameServer
          A Thread that acts as a name-server on a specified port.
static class SerializedCommunicationStrategy.ObjectStreamServer
          A Thread that accepts connections to a ServerSocket and creates an object-reading thread for each connection.
 
Constructor Summary
SerializedCommunicationStrategy()
           
 
Method Summary
 java.lang.Object postDecode(java.lang.Object contents)
           
 java.lang.Object preEncode(java.lang.Object contents)
           
 void sendObject(java.lang.Object destination, java.lang.Object contents)
           
 java.lang.Object sendRequest(java.lang.Object destination, java.lang.Object contents)
           
 void setDestinationAddress(java.lang.String destination, ServiceAddress addr)
           
protected  void setupNameServer()
           
protected  void setupNameServerAddress()
           
 void setupServer(java.lang.Object destination, IPC.MessageListener listener)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SerializedCommunicationStrategy

public SerializedCommunicationStrategy()
Method Detail

preEncode

public java.lang.Object preEncode(java.lang.Object contents)

postDecode

public java.lang.Object postDecode(java.lang.Object contents)

sendObject

public void sendObject(java.lang.Object destination,
                       java.lang.Object contents)
Specified by:
sendObject in interface IPC.CommunicationStrategy

sendRequest

public java.lang.Object sendRequest(java.lang.Object destination,
                                    java.lang.Object contents)

setDestinationAddress

public void setDestinationAddress(java.lang.String destination,
                                  ServiceAddress addr)

setupServer

public void setupServer(java.lang.Object destination,
                        IPC.MessageListener listener)
Specified by:
setupServer in interface IPC.CommunicationStrategy

setupNameServerAddress

protected void setupNameServerAddress()

setupNameServer

protected void setupNameServer()