edu.ucdavis.rj.Ops
Interface Op

All Known Subinterfaces:
OpRemote
All Known Implementing Classes:
OpImpl, OpInni, OpMethod, OpProxy

public interface Op

Basic operation abstraction. Don't extend java.rmi.Remote!


Method Summary
 Invocation call()
          Invoke this operation synchronously.
 Invocation call(Invocation originalInv)
          Invoke this operation synchronously.
 boolean canAppearInInni()
          Can this operation be serviced by an inni? Only an OpInni can.
 void deliverPendingMessages()
          If operation's queue of pending invocations was locked due to equivalence class locking stuff (e.g., merging), then deliver pending messages.
 OpInniIterator elements()
          Get an iterator to iterate over pending invocations of this operation.
 long getFirstTime()
          Get the timestamp of the first (oldest) pending invocation of this operation.
 java.lang.String getId()
          Returns unique identifier for this operation.
 InLock getLock()
          Get the equivalence class lock for this operation.
 boolean isNoop()
          Determines whether this operation is a noop.
 boolean isRemote(java.lang.String site)
          Is this operation on a remote VM or on the current VM?
 int length()
          Returns the number of Invocations pending for this operation.
 Invocation P()
          A semaphore P (aka down) operation.
 Invocation receive()
          Get the first (oldest) pending invocation of this OpInni.
 void send()
          Invoke this operation asynchronously.
 void send(Invocation originalInv)
          Invoke this operation asynchronously.
 void V()
          A semaphore V (aka up) operation.
 

Method Detail

isNoop

boolean isNoop()
               throws java.rmi.RemoteException
Determines whether this operation is a noop.

Returns:
true if and only if this operation is a noop.
Throws:
java.rmi.RemoteException

send

void send(Invocation originalInv)
          throws java.rmi.RemoteException
Invoke this operation asynchronously.

Parameters:
originalInv - The invocation to service.
Throws:
java.rmi.RemoteException

send

void send()
          throws java.rmi.RemoteException
Invoke this operation asynchronously. Abbreviation for this.send (new Invocation(...)); See send(edu.ucdavis.rj.Ops.Invocation).

Throws:
java.rmi.RemoteException

V

void V()
       throws java.rmi.RemoteException
A semaphore V (aka up) operation. Intended for use on OpInni's semaphore operations.

Throws:
java.rmi.RemoteException

call

Invocation call(Invocation originalInv)
                throws java.rmi.RemoteException
Invoke this operation synchronously.

Parameters:
inv - The invocation to service.
Returns:
The invocation, from which the return value of the operation can be extracted.

N.B., (the reference for) the returned invocation might not be the same as inv. For example, do NOT use, e.g., Invocation inv = new Invocation(...); thefun.call(inv); System.out.println(inv.getReturnValue()); because inv's value after the call will be the same as its value before the call, and inv.getReturnValue() will likely be null. Instead, in this example, use inv = thefun.call(inv);.

Throws:
java.rmi.RemoteException

call

Invocation call()
                throws java.rmi.RemoteException
Invoke this operation synchronously. Abbreviation for this.call (new Invocation(...)); See call(edu.ucdavis.rj.Ops.Invocation).

Throws:
java.rmi.RemoteException

receive

Invocation receive()
                   throws java.rmi.RemoteException
Get the first (oldest) pending invocation of this OpInni. Wait if no invocation is pending.

Returns:
The first pending invocation.
Throws:
rjRunTimeError - if this Op is an OpMethod.
java.rmi.RemoteException

P

Invocation P()
             throws java.rmi.RemoteException
A semaphore P (aka down) operation. Intended for use on OpInni's semaphore operations.

Throws:
rjRunTimeError - if this Op is an OpMethod.
java.rmi.RemoteException

length

int length()
           throws java.rmi.RemoteException
Returns the number of Invocations pending for this operation.

Returns:
The number of pending Invocations.
Throws:
java.rmi.RemoteException

getId

java.lang.String getId()
                       throws java.rmi.RemoteException
Returns unique identifier for this operation.

Returns:
that id.
Throws:
java.rmi.RemoteException

getFirstTime

long getFirstTime()
                  throws java.rmi.RemoteException
Get the timestamp of the first (oldest) pending invocation of this operation.

Returns:
that timestamp.
Throws:
rjRunTimeError - if this Op is an OpMethod.
java.rmi.RemoteException

canAppearInInni

boolean canAppearInInni()
                        throws java.rmi.RemoteException
Can this operation be serviced by an inni? Only an OpInni can.

Returns:
true if and only if this operation is an OpInni.
Throws:
java.rmi.RemoteException

getLock

InLock getLock()
               throws java.rmi.RemoteException
Get the equivalence class lock for this operation.

Returns:
that lock.
Throws:
java.rmi.RemoteException

isRemote

boolean isRemote(java.lang.String site)
                 throws java.rmi.RemoteException
Is this operation on a remote VM or on the current VM?

Returns:
true if and only if this operation is remote.
Throws:
java.rmi.RemoteException

deliverPendingMessages

void deliverPendingMessages()
                            throws java.rmi.RemoteException
If operation's queue of pending invocations was locked due to equivalence class locking stuff (e.g., merging), then deliver pending messages.

Throws:
rjRunTimeError - if this Op is an OpMethod.
java.rmi.RemoteException

elements

OpInniIterator elements()
                        throws java.rmi.RemoteException
Get an iterator to iterate over pending invocations of this operation.

Returns:
that iterator.
Throws:
rjRunTimeError - if this Op is an OpMethod.
java.rmi.RemoteException