edu.ucdavis.rj.Ops
Class OpMethod

java.lang.Object
  extended by java.rmi.server.RemoteObject
      extended by java.rmi.server.RemoteServer
          extended by java.rmi.server.UnicastRemoteObject
              extended by edu.ucdavis.rj.Ops.OpImpl
                  extended by edu.ucdavis.rj.Ops.OpMethod
All Implemented Interfaces:
Op, OpRemote, java.io.Serializable, java.rmi.Remote

public abstract class OpMethod
extends OpImpl

An operation that's to be serviced via a method. (Aka Proc-Op.) Extend this class with one that contains actual code.

See Also:
Serialized Form

Nested Class Summary
(package private)  class OpMethod.T1
           
 
Nested classes/interfaces inherited from interface edu.ucdavis.rj.Ops.OpRemote
OpRemote.Helper
 
Field Summary
(package private) static long serialVersionUID
           
 
Fields inherited from class java.rmi.server.RemoteObject
ref
 
Constructor Summary
OpMethod()
          Create a new instance of an operation that's to be serviced via a method.
 
Method Summary
 boolean canAppearInInni()
          Can this operation be serviced by an inni? Only an OpInni can.
abstract  void codeBlock(Invocation inv)
          Override this method with the actual code for the operation.
 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()
          ///// /////////////////////// throw exception
 long getFirstTime()
          /////
 InLock getLock()
          Get the equivalence class lock for this operation.
(package private)  void internalSend(Invocation inv)
          Internal asynchronous invocation.
 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()
          //////////////////
 Invocation receive()
          Get the first (oldest) pending invocation of this operation.
 
Methods inherited from class edu.ucdavis.rj.Ops.OpImpl
call, call, equals, getId, hashCode, isNoop, send, send, V
 
Methods inherited from class java.rmi.server.UnicastRemoteObject
clone, exportObject, exportObject, exportObject, unexportObject
 
Methods inherited from class java.rmi.server.RemoteServer
getClientHost, getLog, setLog
 
Methods inherited from class java.rmi.server.RemoteObject
getRef, toString, toStub
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

serialVersionUID

static final long serialVersionUID
See Also:
Constant Field Values
Constructor Detail

OpMethod

public OpMethod()
         throws java.rmi.RemoteException
Create a new instance of an operation that's to be serviced via a method.

Throws:
java.rmi.RemoteException
Method Detail

internalSend

void internalSend(Invocation inv)
Internal asynchronous invocation. Note that both call and send come through here.

Specified by:
internalSend in class OpImpl
Parameters:
inv - The invocation to service. It is assumed to have already been cloned and its replyOp set properly (null for send; non-null for call).

codeBlock

public abstract void codeBlock(Invocation inv)
Override this method with the actual code for the operation.

Parameters:
inv - The invocation to service.

receive

public Invocation receive()
Get the first (oldest) pending invocation of this operation. Wait if no invocation is pending.

Returns:
The first pending invocation.

getFirstTime

public long getFirstTime()
/////

Returns:
that timestamp.

canAppearInInni

public boolean canAppearInInni()
                        throws java.rmi.RemoteException
Description copied from interface: Op
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

public InLock getLock()
               throws java.rmi.RemoteException
Description copied from interface: Op
Get the equivalence class lock for this operation.

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

isRemote

public boolean isRemote(java.lang.String site)
                 throws java.rmi.RemoteException
Description copied from interface: Op
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

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

Throws:
java.rmi.RemoteException

elements

public OpInniIterator elements()
                        throws java.rmi.RemoteException
///// /////////////////////// throw exception

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

P

public Invocation P()
//////////////////


length

public int length()
Returns the number of Invocations pending for this operation.

Specified by:
length in interface Op
Specified by:
length in class OpImpl
Returns:
The number of pending Invocations, which will be 0 for an OpMethod.