|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.erights.e.elib.ref.Ref | +--org.erights.e.elib.ref.NearRef
A NearRef represents the Ref facet of a promise which has been fulfilled with a local non-Ref object.
In E, a NearRef is forever identical to the object it wraps (the target). In the ELib implementation, NearRefs exist purely for implementation convenience to wrap a non-Ref with a Ref interface. Note that all non-Refs are considered NEAR.
Field Summary | |
private Object |
myTarget
|
Fields inherited from class org.erights.e.elib.ref.Ref |
BROKEN, EVENTUAL, NEAR, TheViciousRef |
Constructor Summary | |
(package private) |
NearRef(Object target)
Wrap target in Ref protocol. |
Method Summary | |
Object |
callAll(String verb,
Object[] args)
Synchronously forward the message and response. |
(package private) void |
commit()
Used by a resolvers to turn off switchability, and thereby make this Ref equivalent to its current target. |
boolean |
isResolved()
Suppressed: |
Throwable |
optProblem()
Returns null. |
Object |
resolution()
Returns the near object. |
(package private) Ref |
resolutionRef()
Returns this, since target isn't a Ref |
Ref |
sendAll(String verb,
Object[] args)
Asynchronously forward the message and response. |
Throwable |
sendAllOnly(String verb,
Object[] args)
Asynchronously forward the message. |
(package private) void |
setTarget(Ref newTarget)
Used by a resolvers to change the target. |
String |
state()
Returns NEAR. |
Methods inherited from class org.erights.e.elib.ref.Ref |
broken, disconnected, getAllegedType, getOptProxyHandler, GetRefMaker, ignore, isBroken, isDeepFrozen, isDeepPassByCopy, isEventual, isFar, isNear, isPassByProxy, isPBC, isPersistent, isResolved, isSameEver, isSelfish, isSelfless, isSettled, makeBufferingPromise, makeSwitchablePromise, optBroken, optProblem, optSealedDispatch, optSealedDispatch, optShorten, promise, resolution, respondsTo, sendMsg, state, toCallable, toRef, toString, whenBroken, whenBrokenOnly, whenResolved, whenResolvedOnly |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
private final Object myTarget
Constructor Detail |
NearRef(Object target)
Method Detail |
public Throwable optProblem()
All implementations of optProblem/0 must be thread safe, in
order for Ref.state/0
to be thread safe.
optProblem
in class Ref
Ref.optProblem(Object)
Ref resolutionRef()
All implementations of resolutionRef/0 must be thread safe, in
order for Ref.resolution/0
to be thread
safe.
resolutionRef
in class Ref
public Object resolution()
All implementations of resolution/0 must be thread safe, in
order for Ref.resolution/1
to be thread
safe.
resolution
in class Ref
public String state()
All implementations of state/0 must be thread safe, in order
for Ref.isNear/1
to be thread safe.
state
in class Ref
Ref.state(Object)
public Object callAll(String verb, Object[] args)
callAll
in interface Callable
callAll
in class Ref
public Ref sendAll(String verb, Object[] args)
sendAll
in class Ref
public Throwable sendAllOnly(String verb, Object[] args)
sendAllOnly
in class Ref
public boolean isResolved()
Ref
isResolved
in class Ref
void setTarget(Ref newTarget)
Ref
setTarget
in class Ref
void commit()
Ref
If the current target is already equivalent to this Ref, then this Ref
becomes broken by a ViciousCycleException
.
commit
in class Ref
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |