Re: Reference Tracking and Leases.

Gregg Wonderly <[email protected]> Thu, 6 Dec 2007 14:00:32 -0600
Newsgroups gmane.comp.java.sun.jini
Message-ID <[email protected]>
Peter Jones wrote:
> On Wed, Dec 05, 2007 at 02:16:54PM -0600, Gregg Wonderly wrote:
> 
>>Peter Jones wrote:
>>
>>>FYI, this seems very similar to how the client side of DGC works under
>>>the covers.  For DGC, instead of a smart proxy, the tracked object is
>>>a so-called "live remote reference" object inside a remote proxy--
>>>BasicObjectEndpoint for JERI (or sun.rmi.transport.LiveRef for JRMP);
>>>the analogue of the Lease is the object ID and transport-layer
>>>endpoint (which are contained in the live reference) and a specialized
>>>lease renewal/cancellation protocol.  For JERI, the implementation is
>>>in com.sun.jini.jeri.internal.runtime.AbstractDgcClient (and the spec
>>>is in BasicObjectEndpoint).
>>
>>Right, that's what I've seen.  The work that I did was to just
>>expose that leasing at the application level so that I can take
>>specific actions at the point that such action is necessary.  For
>>example, I have a smart proxy who's server side endpoint streams
>>data over a UDP socket, as well as making normal RMI centric calls.
>>Those RMI calls would get a RemoteException when the DGC discovered
>>that the client was gone.  But the UDP pump would not see any
>>particular failures.  So, having the lease in place to manage that
>>issue helps to alert the servers UDP generation that there is no
>>longer a path so that it can throw a RemoteException which will
>>allow the server to stop pumping out UDP events.
> 
> 
> I may not be understanding this scenario fully, but wouldn't
> implementing the (DGC-based) java.rmi.server.Unreferenced callback on
> the per-client exported remote objets have helped with this?

When there is an actual exported object, yes.  But in some cases, I just
have a serialized object.  I was looking for a solution that would be equaly 
capable in multiple use cases to provide some uniformity to the code and the
use of the mechanism.

> Regardless, though, there are reasons to do this explicitly at a
> higher level, like how the way that the implicit DGC model ported
> more-or-less directly from RMI/JRMP doesn't work with certain JERI
> features, like applying constraints or Subject-based credentials to
> the DGC lease communication.

Yes, that is a more interesting issue in the world of security.  I'll be trying 
to put together some more concrete use patterns into code so that I can 
investigate more of what is possible and if there are some different or at lease 
interesting characteristics that fall out.

Gregg Wonderly

--------------------------------------------------------------------------
Getting Started:     http://www.jini.org/wiki/Category:Getting_Started
Community Web Site:  http://jini.org
jini-users Archive:  http://archives.java.sun.com/archives/jini-users.html
Unsubscribing:       email "signoff JINI-USERS"  to [email protected]