Re: LE.2.1 Characteristics of a Lease
Gregg Wonderly <[email protected]> Wed, 9 Jul 2008 10:49:59 -0500
| Newsgroups | gmane.comp.java.sun.jini |
|---|---|
| Message-ID | <[email protected]> |
Bob Scheifler wrote: >> Is it possible for a lease renewal to extend the expiry time beyond >> what the granter returned via Lease.getExpiration()'s value at the >> time the Lease is created? > > Yes, that's pretty much the purpose of lease renewal. As another follow up, it seems to me that there is a lot of confusing terminology rolled into the lease javadocs. I didn't seem to find a nice explanation of the usage patterns that would of allowed me to find out the information that I've spent a couple of days of discovery on. I found it confusing at times to try and understand the various time values and their usages. The absolute time used to create a lease (LeaseFactory.newLease() most likely used), created the view for me, that the caller makes the decision of when the lease ultimately expires, absolutely by passing some precise time. This led me to believe that a forever lease, required the granter to use Lease.FOREVER as the LeaseFactory.newLease() argument, for any lease that was open ended. I thought that was a bit odd, and that's why I posted to the list. The lease granter didn't appear to get any chance to "cap" the time on the lease, except through this argument to LeaseFactory.newLease(). I think it would be great to have a little more visibility of the relationship of expiry, vs the requested lease duration in the javadocs. Is there a pattern, or something else done normally that makes this all a little more obvious? LeaseRenewalManager.renewUntil()'s two different signatures allow it to either get an explicit renewal interval, or choose one based on the leases expiry and renew returned duration. But, it's not clear how these times would relate to the Lease granters used time in creating the lease. The client gets to say, explicitly how long it is interested, while the granter, seems to have that with the LeaseFactory.newLease() argument, but not actually, because Landlord impls can accept renewals forever. So, a granter has to provide the Landlord impl as a closely associated implementation detail if it wants to manage a cap on the lease. The Landlord interface doesn't provide such an API, so probably a more specialized implementation would be used in such cases. When I've just used leases related to transactions and ServiceRegistrar.notify(), the LRM provided me what I thought was an appropriate mechanism as a client. Implementing a Landlord, has revealed some things that I just didn't grasp well before I guess. I just need open ended leases, but I keep trying to figure out how 'capped' leases would be implemented, and I think it's a Landlord implementation detail, not a LeaseFactory.newLease() argument detail. Perhaps newLease() documentation could help with this by discussing more about the expiration argument. It calls in the initial expiration time. With some more thought about the words and what I know, the text there is probably sufficient for the informed, but perhaps somewhat terse for those trying to understand how Landlord should use that value. 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]