gsim.sim.communication
Class MethodInvocationProtocolSender
java.lang.Object
gsim.sim.communication.AbstractCommunicationProtocol
gsim.sim.communication.CommunicationProtocol
gsim.sim.communication.MethodInvocationProtocolSender
- All Implemented Interfaces:
- java.io.Serializable
public class MethodInvocationProtocolSender
- extends CommunicationProtocol
Any communication in gsim is defined ASYNCHRONOSLY (even in the single-machin
case for coherent semantics). A method invocation must there for register an
observer if using this convenience class, or code all logic within the
respond-method of the protocol.
- Author:
- s.schuster@surrey.ac.uk
- See Also:
- Serialized Form
Constructor Summary |
MethodInvocationProtocolSender(java.lang.String ownName,
java.lang.String receiverName,
java.lang.String methodName,
java.lang.Object[] params)
|
Methods inherited from class java.lang.Object |
getClass, notify, notifyAll, toString, wait, wait, wait |
MethodInvocationProtocolSender
public MethodInvocationProtocolSender(java.lang.String ownName,
java.lang.String receiverName,
java.lang.String methodName,
java.lang.Object[] params)
getObservable
public java.util.Observable getObservable()
getResult
public java.lang.Object getResult()
- Blocks until protocol has finished.
- Returns:
- the result value of the called method
getStartMessage
public Message getStartMessage()
- Specified by:
getStartMessage
in class CommunicationProtocol
respond
public Message respond(Message message)
- Specified by:
respond
in class AbstractCommunicationProtocol