edu.ucdavis.rj.Ops
Class Invocation

java.lang.Object
  extended by edu.ucdavis.rj.Ops.Invocation
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable

public class Invocation
extends java.lang.Object
implements java.io.Serializable, java.lang.Cloneable

Basic invocation abstraction.

See Also:
Serialized Form

Constructor Summary
Invocation(java.lang.Object... params)
          Create an invocation with the given parameters.
 
Method Summary
protected  Invocation clone()
          Clone this Invocation.
 void forward(OpImpl fwdOpImpl)
           
 void forward(OpImpl fwdOpImpl, Invocation fwdInvocation)
           
 void forward(OpProxy fwdOpProxy)
           
 void forward(OpProxy fwdOpProxy, Invocation fwdInvocation)
          Forward an invocation to the specified operation; most importantly, the ability to reply to the original invoker is also forwarded.
 java.lang.Object getParam(int index)
          Return a parameter of the invocation.
 OpProxy getReplyOp()
          Get the reply operation for the invocation.
 java.lang.Object getReturnValue()
          Get the return value for the invocation.
 int paramsLength()
          Return the number of parameters in the invocation.
 void reply()
          Early reply for this invocation to the invoker.
 void reply(java.lang.Object value)
          //////////////// Abbreviation for this.setReplyOp(value); this.reply();
 void setReplyOp(OpProxy replyOp)
          Set the reply operation for the invocation.
 void setReturnValue(java.lang.Object value)
          Set the return value for the invocation.
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Invocation

public Invocation(java.lang.Object... params)
Create an invocation with the given parameters.

Parameters:
params - The parameters of the invocation.
Method Detail

paramsLength

public int paramsLength()
Return the number of parameters in the invocation.

Returns:
The number of parameters in the invocation.

getParam

public java.lang.Object getParam(int index)
Return a parameter of the invocation.

Parameters:
index - Index (zero-based) of the invocation parameter to return.
Returns:
The index-th parameter. /////////// if out of range, throws IndexOutOfBoundsException

setReturnValue

public void setReturnValue(java.lang.Object value)
Set the return value for the invocation.

Parameters:
value - The return value.

getReturnValue

public java.lang.Object getReturnValue()
Get the return value for the invocation.

Returns:
The return value.

setReplyOp

public void setReplyOp(OpProxy replyOp)
Set the reply operation for the invocation.

Parameters:
replyOp - The reply operation. //////////////////////////// 2010-08-31 public for testing //////////////// deferred reply stuff

getReplyOp

public OpProxy getReplyOp()
Get the reply operation for the invocation.

Returns:
The reply operation. //////////////////////////// 2010-08-31 public for testing //////////////// deferred reply stuff

reply

public void reply()
Early reply for this invocation to the invoker. Subsequent replies are ignored. Make copy of invocation to send back to invoker since current process will continue to use this invocation.


reply

public void reply(java.lang.Object value)
//////////////// Abbreviation for this.setReplyOp(value); this.reply();

Parameters:
value - The return value.

forward

public void forward(OpProxy fwdOpProxy,
                    Invocation fwdInvocation)
Forward an invocation to the specified operation; most importantly, the ability to reply to the original invoker is also forwarded. The invocation forwarded is either a copy of the current invocation, if no invocation is explicitly specified as a parameter, or it's the invocation specified. (Caution on forwarding the current invocation: if code has extracted parameters from the invocation into local variables and modified those variables, those changes don't appear in the invocation; create and forward a new invocation from the local variables. In either case, after forwarding, the forwarder continues to execute using the current invocation. Subsequent forwards behave like a send. A forward of an invocation that was sent also acts like a send.

Parameters:
inv - The invocation to which to reply.

forward

public void forward(OpImpl fwdOpImpl,
                    Invocation fwdInvocation)

forward

public void forward(OpProxy fwdOpProxy)

forward

public void forward(OpImpl fwdOpImpl)

clone

protected Invocation clone()
                    throws java.lang.CloneNotSupportedException
Clone this Invocation.

Overrides:
clone in class java.lang.Object
Throws:
java.lang.CloneNotSupportedException