fabric.worker.remote.messages
Class RemoteCallMessage

java.lang.Object
  extended by fabric.messages.Message<RemoteWorker,R>
      extended by fabric.worker.remote.messages.InterWorkerMessage<RemoteCallMessage.Response>
          extended by fabric.worker.remote.messages.RemoteCallMessage

public class RemoteCallMessage
extends InterWorkerMessage<RemoteCallMessage.Response>


Nested Class Summary
static class RemoteCallMessage.Response
           
 
Nested classes/interfaces inherited from class fabric.messages.Message
Message.MessageType
 
Field Summary
 java.lang.Object[] args
           
 java.lang.String methodName
           
 java.lang.Class<?>[] parameterTypes
           
 Object._Proxy receiver
           
 java.lang.Class<?> receiverType
           
 TransactionID tid
           
 UpdateMap updateMap
           
 
Fields inherited from class fabric.messages.Message
messageType
 
Constructor Summary
RemoteCallMessage(java.io.DataInput in)
          Deserialization constructor.
RemoteCallMessage(TransactionID tid, UpdateMap updateMap, java.lang.Class<?> receiverType, Object._Proxy receiver, java.lang.String methodName, java.lang.Class<?>[] parameterTypes, java.lang.Object[] args)
           
 
Method Summary
 RemoteCallMessage.Response dispatch(MessageHandlerThread handler)
          Calls the appropriate handle(...) method on the handler.
 java.lang.reflect.Method getMethod()
           
 RemoteCallMessage.Response response(RemoteWorker c, java.io.DataInput in)
          Creates a Response message of the appropriate type using the provided input stream.
 RemoteCallMessage.Response send(RemoteWorker worker)
           
 void write(java.io.DataOutput out)
          Writes this message out on the given output stream.
 
Methods inherited from class fabric.worker.remote.messages.InterWorkerMessage
readRef, writeRef
 
Methods inherited from class fabric.messages.Message
dispatch, receive, send
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

tid

public final TransactionID tid

updateMap

public final UpdateMap updateMap

receiverType

public final java.lang.Class<?> receiverType

receiver

public final Object._Proxy receiver

methodName

public final java.lang.String methodName

parameterTypes

public final java.lang.Class<?>[] parameterTypes

args

public final java.lang.Object[] args
Constructor Detail

RemoteCallMessage

public RemoteCallMessage(TransactionID tid,
                         UpdateMap updateMap,
                         java.lang.Class<?> receiverType,
                         Object._Proxy receiver,
                         java.lang.String methodName,
                         java.lang.Class<?>[] parameterTypes,
                         java.lang.Object[] args)
Parameters:
tid - The identifier for the transaction in which the remote call is being made.
receiver - The object that is receiving the call.
methodName - The name of the method to be called.
args - The arguments to the method.

RemoteCallMessage

public RemoteCallMessage(java.io.DataInput in)
                  throws java.io.IOException,
                         java.lang.ClassNotFoundException
Deserialization constructor.

Throws:
java.io.IOException
java.lang.ClassNotFoundException
Method Detail

dispatch

public RemoteCallMessage.Response dispatch(MessageHandlerThread handler)
                                    throws RemoteCallException,
                                           ProtocolError
Description copied from class: Message
Calls the appropriate handle(...) method on the handler.

Overrides:
dispatch in class Message<RemoteWorker,RemoteCallMessage.Response>
Returns:
the result computed by the handler
Throws:
RemoteCallException
ProtocolError

send

public RemoteCallMessage.Response send(RemoteWorker worker)
                                throws UnreachableNodeException,
                                       RemoteCallException
Throws:
UnreachableNodeException
RemoteCallException

response

public RemoteCallMessage.Response response(RemoteWorker c,
                                           java.io.DataInput in)
                                    throws java.io.IOException,
                                           RemoteCallException
Description copied from class: Message
Creates a Response message of the appropriate type using the provided input stream.

Specified by:
response in class Message<RemoteWorker,RemoteCallMessage.Response>
Parameters:
c - the remote node from which the response originated.
in - Input stream containing the message.
Returns:
A Response message with the appropriate type.
Throws:
java.io.IOException
RemoteCallException

write

public void write(java.io.DataOutput out)
           throws java.io.IOException
Description copied from class: Message
Writes this message out on the given output stream. Only used by the worker.

Specified by:
write in class Message<RemoteWorker,RemoteCallMessage.Response>
Throws:
java.io.IOException - if the output stream throws an IOException.

getMethod

public java.lang.reflect.Method getMethod()
                                   throws java.lang.SecurityException,
                                          java.lang.NoSuchMethodException
Throws:
java.lang.SecurityException
java.lang.NoSuchMethodException