|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--ix.util.IPC
Support for interprocess communication in a framework that allows different communication strategies to be used in a uniform way. A default communication strategy that sends serialized objects via sockets is included.
The framework specifies certain entities only a in very general way. Communication strategies that are meant to be interchangeable must therefore follow shared conventions - not enforced by the framework - chiefly concerning the objects used to represent "destinations" and implementations of the InputMessage interface.
Note that a "destination" need not contain all the information needed for communication with the corresponding agent. Instead, the destination may be merely a name, perhaps as a String, with the rest of the information stored elsewhere.
Inner Class Summary | |
static class |
IPC.BasicDestinationTable
A HashMap implementation of the DestinationTable interface. |
static class |
IPC.BasicInputMessage
A minimal implementation of InputMessage. |
static interface |
IPC.CommunicationStrategy
An object that determines how various IPC operations are performed. |
static interface |
IPC.Connection
An object that can send and receive. |
static interface |
IPC.DestinationTable
A mapping from destination names to the data needed to establish connections with the corresponding agents. |
static interface |
IPC.InputMessage
An object that represents an incoming message. |
static class |
IPC.IPCException
The exception thrown by IPC methods. |
static interface |
IPC.MessageListener
An object that is notified when a message is received. |
static class |
IPC.ObjectStreamCommunicationStrategy
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. |
static class |
IPC.ObjectStreamConnection
A Connection that is used to send and receive serialized objects via a socket. |
static class |
IPC.ObjectStreamNameServer
A Thread that acts as a name-server on a specified port. |
static class |
IPC.ObjectStreamServer
A Thread that accepts connections to a ServerSocket and creates an object-reading thread for each connection. |
static class |
IPC.ServiceAddress
An object that contains a host name and a port number. |
static class |
IPC.SimpleIXCommunicationStrategy
An ObjectStream communication strategy that provides default host and port assignments for standard I-X agents. |
static class |
IPC.SimpleIXDestinationTable
A DestinationTable that provides default host and port assignments for standard I-X agents, suitable for use with an instance of ObjectStreamCommunicationStrategy. |
static class |
IPC.SimpleIXXMLCommunicationStrategy
An ObjectStream communication strategy that provides default host and port assignments for standard I-X agents and encodes the message contents in XML rather than serializing. |
static interface |
IPC.SocketlikeCommunicationStrategy
A CommunicationStrategy that provides "connections" analogous to sockets and a visible mapping from destination names to the data needed to establish a connection. |
static class |
IPC.XMLObjectStreamCommunicationStrategy
A version of ObjectStreamCommunicationStrategy that encodes the message contents in XML rather than serializing. |
Field Summary | |
(package private) static IPC.CommunicationStrategy |
defaultCommunicationStrategy
The communication strategy used by the static methods of this class that do not have a communication strategy as a parameter. |
Method Summary | |
static void |
exceptionlessSend(java.lang.Object destination,
java.lang.Object contents)
Like sendObject but catches any IPC.IPCException. |
static IPC.CommunicationStrategy |
getCommunicationStrategy(java.lang.String strategyName)
Returns a CommunicationStrategy based on a name that is either a special abbreviation or the name of a class. |
static void |
sendObject(java.lang.Object destination,
java.lang.Object contents)
Sends an object to the specified destination using the default communication strategy. |
static void |
setDefaultCommunicationStrategy(IPC.CommunicationStrategy s)
Sets the communication strategy used when none is explicitly specified. |
static void |
setDefaultCommunicationStrategy(java.lang.String strategyName)
Sets the communication strategy used when none is explicitly specified. |
static void |
setupServer(java.lang.Object destination,
IPC.MessageListener listener)
Does what is required for this agent to receive messages sent using the default communication strategy. |
Methods inherited from class java.lang.Object |
|
Field Detail |
static IPC.CommunicationStrategy defaultCommunicationStrategy
Method Detail |
public static void setDefaultCommunicationStrategy(IPC.CommunicationStrategy s)
public static void setDefaultCommunicationStrategy(java.lang.String strategyName)
strategyName
is interpreted by
the getCommunicationStrategy(String)
method.getCommunicationStrategy(String)
public static IPC.CommunicationStrategy getCommunicationStrategy(java.lang.String strategyName)
SimpleIXCommunicationStrategy
;
SimpleIXXMLCommunicationStrategy
;
IllegalArgumentException
.
IPC.SimpleIXCommunicationStrategy
,
IPC.SimpleIXXMLCommunicationStrategy
,
setDefaultCommunicationStrategy(String strategyName)
public static void sendObject(java.lang.Object destination, java.lang.Object contents)
public static void exceptionlessSend(java.lang.Object destination, java.lang.Object contents)
IPC.IPCException
,
sendObject(Object, Object)
public static void setupServer(java.lang.Object destination, IPC.MessageListener listener)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |