« Return to Thread: LE.2.1 Characteristics of a Lease

Re: LE.2.1 Characteristics of a Lease

by John McClain - Sun Microsystems, Inc. :: Rate this Message:

Reply to Author | View in Thread

Gregg Wonderly wrote:

> Bob Scheifler wrote:
>>> My issue is that if the client misses a renewal, I want the service
>>> to stop sending events.
>>
>> That's what it should do.
>>
>>> My issue is that this seems to invalidate my implementation, because
>>> of the text, "However, when renewing a lease the grantor cannot,
>>> unless explicitly requested to do so, shorten the duration of the
>>> lease so that it expires before it would have if it had not been
>>> renewed."
>>
>> That text means that if the existing expiration time is E0, and the
>> new expiration time requested in the renewal is E1, and if E1 >= E0,
>> then the granted expiration time E must also be >= E0.  If a lease's
>> expiration time is reached without a renewal, the lease must still
>> expire.
>
> My reading says that E0 would always be == to time that was passed to
> LeaseFactory.newLease().  

I think the duality between durations and expirations may be tripping
you up here. Say its 6 pm and you are a client holding a lease set to
expire at 8 pm. You call renew() passing 14,400,000 (which works out to
4  hours), because 14,400,000 ms is longer than the current duration
(7,200,000 ms) the granter can't change the expiration time to 7 pm (or
7:59 pm) because that would shorten the current duration and you asked
for a renewal that was longer than the current duration.


> Maybe my previous email with more specifics,
> reveals more about what I am trying to get at?

I can't find your previous message, do you have a pointer?

> That text is also a little bit troubling from the perspective of the
> Landlord implementation.  The callee of LeaseFactory.newLease() never
> has the opportunity to extend or shorten the lease, unless it also has
> knowledge of the Landlord that the LeaseFactory was created with.  Is it
> intended that lease grantors and resources be that close together in
> binding of leases to lease expiration?
>
> Maybe I am trying to keep them too far apart, so that the
> Landlord.renew() call can't be influenced by the resource owner?  The
> LeaseStateListener seems to be the hook for learning about renewal
> requests, not explicit relationships between the Landlord implementation
> and the resource.

My assumption as always been that the caller of LeaseFactory.newLease()
is the Landlord.

[where is LeaseStateListener? I see LeaseListener, but that is part of
the LRM's interface, which is on the client side, not sure what that has
to do with Landlords].

--
John McClain john.mcclain@...
Sun Microsystems, Inc.
Burlington, MA

And it is that way today. We are tricked by hope into starting
companies, beginning books, immigrating to this country and investing
in telecom networks. The challenges turn out to be tougher than we
imagined. Our excessive optimism is exposed. New skills are demanded.
But nothing important was ever begun in a prudential frame of mind.

         - David Brooks

--------------------------------------------------------------------------
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 listserv@...

 « Return to Thread: LE.2.1 Characteristics of a Lease