|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectedu.ucdavis.rj.Ops.OpProxy
public class OpProxy
An OpProxy acts like a capability in JR or SR terms.
Its methods are delegated to the remote object.
To get an OpProxy for an OpRemote f
,
just use new OpProxy(f)
.
Field Summary | |
---|---|
private int |
cachedImplHashCode
|
private java.lang.String |
cachedImplId
|
private boolean |
cachedImplIsNoop
|
private OpRemote |
impl
|
Constructor Summary | |
---|---|
OpProxy(OpRemote impl)
|
Method Summary | |
---|---|
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)
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx. |
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()
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx. |
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? |
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. |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private OpRemote impl
private java.lang.String cachedImplId
private boolean cachedImplIsNoop
private int cachedImplHashCode
Constructor Detail |
---|
public OpProxy(OpRemote impl)
Method Detail |
---|
public OpRemote getOpRemote()
public java.lang.String getId() throws java.rmi.RemoteException
Op
getId
in interface Op
java.rmi.RemoteException
public boolean isNoop() throws java.rmi.RemoteException
Op
noop
.
isNoop
in interface Op
noop
.
java.rmi.RemoteException
public long getFirstTime() throws java.rmi.RemoteException
Op
getFirstTime
in interface Op
java.rmi.RemoteException
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
public InLock getLock() throws java.rmi.RemoteException
Op
getLock
in interface Op
java.rmi.RemoteException
public boolean isRemote(java.lang.String site) throws java.rmi.RemoteException
Op
isRemote
in interface Op
true
if and only if this operation is remote.
java.rmi.RemoteException
public void deliverPendingMessages() throws java.rmi.RemoteException
Op
deliverPendingMessages
in interface Op
java.rmi.RemoteException
public OpInniIterator elements() throws java.rmi.RemoteException
Op
elements
in interface Op
java.rmi.RemoteException
public void send(Invocation inv) throws java.rmi.RemoteException
Op
send
in interface Op
inv
- The invocation to service.
java.rmi.RemoteException
public void send() throws java.rmi.RemoteException
Op
this.send (new Invocation(...));
See Op.send(edu.ucdavis.rj.Ops.Invocation)
.
send
in interface Op
java.rmi.RemoteException
public void V() throws java.rmi.RemoteException
Op
OpInni
's semaphore operations.
V
in interface Op
java.rmi.RemoteException
public Invocation call(Invocation inv) throws java.rmi.RemoteException
Op
call
in interface Op
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
public Invocation call() throws java.rmi.RemoteException
Op
this.call (new Invocation(...));
See Op.call(edu.ucdavis.rj.Ops.Invocation)
.
call
in interface Op
java.rmi.RemoteException
public Invocation receive() throws java.rmi.RemoteException
Op
OpInni
.
Wait if no invocation is pending.
receive
in interface Op
java.rmi.RemoteException
public Invocation P() throws java.rmi.RemoteException
Op
OpInni
's semaphore operations.
P
in interface Op
java.rmi.RemoteException
public int length() throws java.rmi.RemoteException
Op
length
in interface Op
java.rmi.RemoteException
public boolean equals(java.lang.Object other)
equals
in class java.lang.Object
The
- other Object
to compare.
public int hashCode()
hashCode
in class java.lang.Object
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |