|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--net.captp.jcomm.RemoteHandler
Handles the tail-ends of remote references.
There is a 3x2 taxonomy of RemoteHandlers. The first distinction is between a) handlers in the Imports table (or "imported handlers"), for which the position is positive, b) handlers in the questions table (or "question handlers"), for which the position is negative, and c) the handler of the other side's NonceLocator, for which the position is zero.
The second distinction is between handlers for resolved remote references, represented by the concrete subclass FarHandler, and handlers for remote references that aren't yet resolved, represented by the concrete subclass RemotePromiseHandler. As a special case, the handler at zero for the other side's NonceLocator is a RemotePromiseHandler, since shutdown attempts may cause it to be retargeted at a newly incarnated NonceLocator from the other side, which may have a new identity.
Field Summary | |
private FlexList |
myBreakageReactors
|
(package private) CapTPConnection |
myConn
Connection to the vat I point into |
private int |
myPos
My outgoing position. |
(package private) ProxyResolver |
myResolver
The Resolver of our Proxy, which also revives the Proxy on demand. |
private int |
myWireCount
Only relevant if myPos > 0. |
Constructor Summary | |
(package private) |
RemoteHandler(CapTPConnection connection,
int pos,
Object optIdentity)
|
Method Summary | |
(package private) void |
countWireRef()
|
(package private) int |
getPos()
|
SealedBox |
handleOptSealedDispatch(Brand brand)
How should my ref respond to an __optSealedDispatch request? |
void |
handleResolution(Object newTarget)
Enabled: My Ref no longer needs me, as it's become equivalent to newTarget. |
Ref |
handleSendAll(String verb,
Object[] args)
Enabled: My Ref is asking me to deliver the message to the other side, and return a promise for the result. |
void |
handleSendAllOnly(String verb,
Object[] args)
Enabled: My Ref is asking me to deliver the message to the other side and ignore the result. |
private Throwable |
handleWhenBroken(Object reactor)
Handles this special case separately, so subclasses can override separately. |
private Throwable |
handleWhenMoreResolved(Object reactor)
Handles this special case separately, so subclasses can override separately. |
void |
reactToGC()
Enabled: One of my Refs was GCed, and I have no current Ref. |
boolean |
sameConnection(Object other)
Enabled: Are 'other' and the remote reference handled by 'this' part of the same comm system, and do they both connect to the same remote vat? |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface org.erights.e.elib.ref.ProxyHandler |
isFresh |
Field Detail |
final CapTPConnection myConn
private final int myPos
If < 0, in the Questions table. If == 0, the special RemotePromiseHandler for the other side's NonceLocator. If > 0, in the Imports table.
private int myWireCount
final ProxyResolver myResolver
private final FlexList myBreakageReactors
Constructor Detail |
RemoteHandler(CapTPConnection connection, int pos, Object optIdentity)
connection
- The CapTPConnection to communicate viapos
- The Imports or Questions map pos of the objectoptIdentity
- null, or the sameness identity of the far
reference.Method Detail |
public SealedBox handleOptSealedDispatch(Brand brand)
handleOptSealedDispatch
in interface ProxyHandler
private Throwable handleWhenMoreResolved(Object reactor)
The default implementation up here tries to deliver-only the __whenMoreResolved, but if that throws an exception back at us, ie, if the __whenMoreResolved message seems to be unable to get through, we report a broken reference (broken by that problen) to the reactor as the resolution, and return that problem.
private Throwable handleWhenBroken(Object reactor)
The default implementation up here stores the reactor in myBreakageReactors and always returns null.
public void handleSendAllOnly(String verb, Object[] args)
ProxyHandler
If the underlying transport mechanism is shut down or otherwise not accepting messages, then it should throw a problem explaining why this message wasn't queued.
handleSendAllOnly
in interface ProxyHandler
public Ref handleSendAll(String verb, Object[] args)
ProxyHandler
If the underlying transport mechanism is shut down or otherwise not accepting messages, then it should either throw a problem explaining why this message wasn't queued, or return a reference that's immediately broken by this problem.
handleSendAll
in interface ProxyHandler
public void handleResolution(Object newTarget)
ProxyHandler
handleResolution
in interface ProxyHandler
public void reactToGC()
ProxyHandler
reactToGC
in interface ProxyHandler
int getPos()
void countWireRef()
public boolean sameConnection(Object other)
ProxyHandler
sameConnection
in interface ProxyHandler
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |