public class OpProxy extends java.lang.Object implements java.io.Serializable, Op
f
,
just use new OpProxy(f)
.Modifier and Type | Field and Description |
---|---|
private int |
cachedImplHashCode |
private java.lang.String |
cachedImplId |
private boolean |
cachedImplIsNoop |
private OpRemote |
impl |
Modifier and Type | Method and Description |
---|---|
Invocation |
call()
Invoke this operation synchronously.
|
Invocation |
call(Invocation inv)
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.
|
boolean |
equals(java.lang.Object other)
Two OpProxys are equal if their OpRemotes are.
|
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.
|
OpRemote |
getOpRemote()
Access method to return proxy's implementation.
|
int |
hashCode()
// force hashing to use equals.
|
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?
(Not allowed on an
OpMethod .) |
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 inv)
Invoke this operation asynchronously.
|
void |
V()
A semaphore V (aka up) operation.
|
private OpRemote impl
private java.lang.String cachedImplId
private boolean cachedImplIsNoop
private int cachedImplHashCode
public OpProxy(OpRemote impl)
public OpRemote getOpRemote()
OpRemote
implementation.public java.lang.String getId() throws java.rmi.RemoteException
Op
public boolean isNoop() throws java.rmi.RemoteException
Op
noop
.public long getFirstTime() throws java.rmi.RemoteException
Op
getFirstTime
in interface Op
java.rmi.RemoteException
- if this Op
is an OpMethod
.public boolean canAppearInInni() throws java.rmi.RemoteException
Op
OpInni
can.canAppearInInni
in interface Op
true
if and only if this operation is an OpInni
.java.rmi.RemoteException
- if RMI fails.public InLock getLock() throws java.rmi.RemoteException
Op
OpMethod
.)public boolean isRemote(java.lang.String site) throws java.rmi.RemoteException
Op
OpMethod
.)public void deliverPendingMessages() throws java.rmi.RemoteException
Op
deliverPendingMessages
in interface Op
java.rmi.RemoteException
- if this Op
is an OpMethod
.public OpInniIterator elements() throws java.rmi.RemoteException
Op
public void send(Invocation inv) throws java.rmi.RemoteException
Op
public void send() throws java.rmi.RemoteException
Op
this.send (new Invocation(...));
See Op.send(edu.ucdavis.rj.Invocation)
.public void V() throws java.rmi.RemoteException
Op
OpInni
's semaphore operations.public Invocation call(Invocation inv) throws java.rmi.RemoteException
Op
call
in interface Op
inv
- 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);
.
java.rmi.RemoteException
- if RMI fails.public Invocation call() throws java.rmi.RemoteException
Op
this.call (new Invocation(...));
See Op.call(edu.ucdavis.rj.Invocation)
.public Invocation receive() throws java.rmi.RemoteException
Op
public Invocation P() throws java.rmi.RemoteException
Op
public int length() throws java.rmi.RemoteException
Op
public boolean equals(java.lang.Object other)
equals
in class java.lang.Object
other
- The other Object
to compare.true
if and only if equal.public int hashCode()
hashCode
in class java.lang.Object