ix.util.ipc
Class SerializedCommunicationStrategy
java.lang.Object
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
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
DEFAULT_NAME_SERVER_ADDRESS
static final java.lang.String DEFAULT_NAME_SERVER_ADDRESS
- See Also:
- Constant Field Values
nameServerAddress
ServiceAddress nameServerAddress
agentTable
java.util.HashMap agentTable
thisAgentsName
java.lang.String thisAgentsName
SerializedCommunicationStrategy
public SerializedCommunicationStrategy()
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)
getAgentRecord
SerializedCommunicationStrategy.AgentRecord getAgentRecord(java.lang.String name)
askNameServer
ServiceAddress askNameServer(java.lang.Object destination)
- Requests a ServiceAddress from the name-server.
- Throws:
AssertionFailure
- if the name-server address isn't known
or if the name-server returns an address that isn't a
ServiceAddress.
IPC.IPCException
- if the name-server does not know a
address for the specified destination.
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()