John McClain - Sun Microsystems, Inc. wrote:
> 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.
I am becomming confused by these responses because I am thinking that there are
two time periods involved. The end lease expiration that was granted by
LeaseFactory.newLease()'s activities (and the Landlord impl), and then the
requested renewal durations, which can only span the time period between the
time the lease was created and the time that the Landlord returned as the
expiration time.
Am I missing something? 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?
>> 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?
It may just be slow arriving on the list.
>> 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.
The Landlord provides some interface for external users to create leases right?
So how would the caller of that mechanism adjust the ultimate expiry time, if
they wanted to extend it "forever" based on the fact that the client is still
calling renew and things still seem to be sane?
> [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].
Ahha, I forgot that I invented LeaseStateListener. My Landlord implementation
accepts an implementation of this when you ask it for a lease. It notifies you
of expired(), cancelled() and renewed() events that it gets from external calls.
Gregg Wonderly
--------------------------------------------------------------------------
Getting Started:
http://www.jini.org/wiki/Category:Getting_StartedCommunity Web Site:
http://jini.orgjini-users Archive:
http://archives.java.sun.com/archives/jini-users.htmlUnsubscribing: email "signoff JINI-USERS" to
listserv@...