public abstract class OpImpl extends java.rmi.server.UnicastRemoteObject implements OpRemote
OpImpl
shouldn't be passed as a parameter.
Instead, use an OpProxy
.
E.g., if f
is an OpImpl
, then pass new OpProxy(f))
OpRemote.Helper
Constructor and Description |
---|
OpImpl()
Create an instance of an
OpImpl . |
Modifier and Type | Method and Description |
---|---|
Invocation |
call()
Invoke this operation synchronously.
|
Invocation |
call(Invocation originalInv)
Invoke this operation synchronously.
|
boolean |
equals(java.lang.Object other)
Compares this
OpImpl object with the specified object,
which can be an OpRemote or an OpProxy . |
java.lang.String |
getId()
Returns unique identifier for this operation.
|
int |
hashCode()
Returns a hash code for this
OpImpl . |
boolean |
isNoop()
Since have one noop per VM, need to know whether an OpImpl is a noop.
|
abstract int |
length()
Returns the number of Invocations pending for this operation.
|
void |
send()
Invoke this operation asynchronously.
|
void |
send(Invocation originalInv)
Invoke this operation asynchronously.
|
void |
V()
A semaphore V (aka up) operation.
|
clone, exportObject, exportObject, exportObject, unexportObject
finalize, getClass, notify, notifyAll, wait, wait, wait
canAppearInInni, deliverPendingMessages, elements, getFirstTime, getLock, isRemote, P, receive
public OpImpl() throws java.rmi.RemoteException
OpImpl
.java.rmi.RemoteException
- if RMI fails.public java.lang.String getId()
Op
public boolean isNoop()
public void send(Invocation originalInv)
public void send()
this.send (new Invocation(...));
See Op.send(edu.ucdavis.rj.Invocation)
.public void V()
Op
OpInni
's semaphore operations.public Invocation call(Invocation originalInv)
call
in interface Op
originalInv
- The invocation to service.
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);
.
public Invocation call()
this.call (new Invocation(...));
See Op.call(edu.ucdavis.rj.Invocation)
.public abstract int length()
public boolean equals(java.lang.Object other)
OpImpl
object with the specified object,
which can be an OpRemote
or an OpProxy
.equals
in class java.rmi.server.RemoteObject
other
- The other Object
to compare.true
if and only if the two objects are equal.public int hashCode()
OpImpl
.
The hashCode for noop
is same across all VMs.
The hashCodes for non-noop
s are different on and across VMs.hashCode
in class java.rmi.server.RemoteObject