« 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:

> John McClain - Sun Microsystems, Inc. wrote:
>> Gregg Wonderly wrote:
>>> Okay, I'm not sure I see the scenario where this wouldn't be tree if
>>> I remove the if above and just always do
>>>
>>>     le.expTime = now + inc;
>>
>> Your are right, it is not a problem if maxLeaseDuration is fixed ( it
>> is an issue for us because in most our implementations
>> maxLeaseDuration is configurable and thus might change over a lease's
>> lifetime, Reggie takes  this a steep further and dynamically varies
>> the max lease duration it is willing to grant based on load).
>
> So do you think that there would be a need for a Landlord implementation
> that encompassed all of these different aspects to help people who need
> to create leases have an easier time getting started? :-)

Gregg Wonderly wrote:

> John McClain - Sun Microsystems, Inc. wrote:
>> What's going on here is that the Landlord interface isn't defining
>> some policy object, but just the network protocol (in the Jini sense)
>> that LandlordLeases use to callback to the server, we don't really expect
>> implementations of the Landord interface that are standalone objects.
>
> Okay.  It seems that many of the concepts of lease life cycle are
> repetitive and variations on renew() might be the biggest difference,
> overall.  So, I have a standalone class, that I pass a Configuration to
> etc.  I'm interested in getting this stuff right, once, in one place,
> and dealing with nuances in a general way I guess.  I'll look some more
> at the various JTSK services use of Landlord for any other "detail" I
> can learn more about.

FWIW, a bit of background

When we did the initial analysis (~10 years ago - it could be dated...)
we decided that in our context[*] it wasn't practical to design Landlord
as the sort of standalone class you describe. When you get into the
internals of a service's lease management you intersect with its
approach to synchronization, persistence, and resource lookup, and the
services in the starter kit diverged quite a bit in these areas. Instead
we focused the landlord package (then com.sun.jini.lease.landlord) on
providing an implementation of net.jini.core.lease.Lease, LandlordLease,
the Landlord interface was introduced for LandlordLease's sake, it
doesn't help the service implementation directly.

We did provide a few bits of code to help the server side of the
implementation, in particular FixLeasePeriodPolicy embodies a simple
(and for most our services sufficient) policy for granting lease periods
while also capturing some easy to forget details around handing
Lease.ANY, overflows, and not letting renewals go back in time unless
the client asks. LeasePeriodPolicy was introduced so we could make lease
period granting polices plugable. LandlordUtil & LocalLandlord just
capture a bit of structural code for handling batch renew and cancel.
LeaseFactory is just a convent way to construct LandlordLeases in the
context 2.0 security model - so again it is just a bit of structure
captured in a utility.

[*]"in our context" is key, if you were developing a higher level
framework for service development that assumed/provided schemes
persistence/concurrency/resource lookup then you could provide a
standalone object, though I expect at that point you probably keep going
and make most of the lease handling invisible to the developer, maybe
only exposing an "isExpired" method and a place to register a
LeasePeriodPolicy.

--
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