Re: Reference Tracking and Leases.
Peter Jones <[email protected]> Thu, 6 Dec 2007 02:35:44 -0500
| Newsgroups | gmane.comp.java.sun.jini |
|---|---|
| Message-ID | <20071206073544.GA1685@east> |
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? 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. -- Peter -------------------------------------------------------------------------- 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]