Gregg Wonderly
2008-07-08 17:59:10 UTC
I'm trying to understand some of the nuances of Landlord implementation, and the
behavior of the LRM related to my previous post, asking about when
LeaseListener.notify() gets called. I've included the text of LE.2.1 below for
reference.
One of the interesting issues, for me, is that lease renewal, indicates a
continued interest in a resource. The lease grantor, who created the lease,
specified an upper bound on the length of time that the lease was valid. That
entity, also could have specified a LeaseStateListener, to watch "renew" come in.
I'm trying to decide at which place, it makes the most since, for renewal
failure, to be handled. My basic concern, is that I am providing leases, which
are "forever" leases when a client adds a listener for particular kinds of
events that the service generates. These leases involve UDP traffic, and are
important to allow the server to stop sending traffic when a client goes away.
I'd like for the service to be notified when any particular renewal interval
expires, and I'd like the client to be in charge of what interval it might
request as a max value, while I can configure the maximum that I'm willing to
grant. All of the values are provided by what is in place today.
My issue is that if the client misses a renewal, I want the service to stop
sending events. I can make my Landlord implementation track the grantor's
specified duration initially, but then set the expiration time to the value that
is specified by the renewal so that a sliding window occurs.
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."
So, should I make the LeaseStateListener deal with missing renews?
It seems like renew is worthless, if it doesn't represent an opportunity for
expiry to occur, when renews are missing.
Gregg Wonderly
---------------------------------------------------------------------------
LE.2.1 Characteristics of a Lease
There are a number of characteristics that are important for understanding what
a lease is and when it is appropriate to use one. Among these characteristics are:
* A lease is a time period during which the grantor of the lease ensures
(to the best of the grantor's abilities) that the holder of the lease will have
access to some resource. The time period of the lease can be determined solely
by the lease grantor, or can be a period of time that is negotiated between the
holder of the lease and the grantor of the lease. Duration negotiation need not
be multi-round; it often suffices for the requestor to indicate the time desired
and the grantor to return the actual time of grant.
* During the period of a lease, a lease can be cancelled by the entity
holding the lease. Such a cancellation allows the grantor of the lease to clean
up any resources associated with the lease and obliges the grantor of the lease
to not take any action involving the lease holder that was part of the agreement
that was the subject of the lease.
* A lease holder can request that a lease be renewed. The renewal period
can be for a different time than the original lease, and is also subject to
negotiation with the grantor of the lease. The grantor may renew the lease for
the requested period or a shorter period or may refuse to renew the lease at
all. 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. A renewed lease is just like any other
lease and is itself subject to renewal.
* A lease can expire. If a lease period has elapsed with no renewals, the
lease expires, and any resources associated with the lease may be freed by the
lease grantor. Both the grantor and the holder are obliged to act as though the
leased agreement is no longer in force. The expiration of a lease is similar to
the cancellation of a lease, except that no communication is necessary between
the lease holder and the lease grantor.
Leasing is part of a programming model for building reliable distributed
applications. In particular, leasing is a way of ensuring that a uniform
response to failure, forgetting, or disinterest is guaranteed, allowing
agreements to be made that can then be forgotten without the possibility of
unbounded resource consumption, and providing a flexible mechanism for
duration-based agreement.
--------------------------------------------------------------------------
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 ***@java.sun.com
behavior of the LRM related to my previous post, asking about when
LeaseListener.notify() gets called. I've included the text of LE.2.1 below for
reference.
One of the interesting issues, for me, is that lease renewal, indicates a
continued interest in a resource. The lease grantor, who created the lease,
specified an upper bound on the length of time that the lease was valid. That
entity, also could have specified a LeaseStateListener, to watch "renew" come in.
I'm trying to decide at which place, it makes the most since, for renewal
failure, to be handled. My basic concern, is that I am providing leases, which
are "forever" leases when a client adds a listener for particular kinds of
events that the service generates. These leases involve UDP traffic, and are
important to allow the server to stop sending traffic when a client goes away.
I'd like for the service to be notified when any particular renewal interval
expires, and I'd like the client to be in charge of what interval it might
request as a max value, while I can configure the maximum that I'm willing to
grant. All of the values are provided by what is in place today.
My issue is that if the client misses a renewal, I want the service to stop
sending events. I can make my Landlord implementation track the grantor's
specified duration initially, but then set the expiration time to the value that
is specified by the renewal so that a sliding window occurs.
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."
So, should I make the LeaseStateListener deal with missing renews?
It seems like renew is worthless, if it doesn't represent an opportunity for
expiry to occur, when renews are missing.
Gregg Wonderly
---------------------------------------------------------------------------
LE.2.1 Characteristics of a Lease
There are a number of characteristics that are important for understanding what
a lease is and when it is appropriate to use one. Among these characteristics are:
* A lease is a time period during which the grantor of the lease ensures
(to the best of the grantor's abilities) that the holder of the lease will have
access to some resource. The time period of the lease can be determined solely
by the lease grantor, or can be a period of time that is negotiated between the
holder of the lease and the grantor of the lease. Duration negotiation need not
be multi-round; it often suffices for the requestor to indicate the time desired
and the grantor to return the actual time of grant.
* During the period of a lease, a lease can be cancelled by the entity
holding the lease. Such a cancellation allows the grantor of the lease to clean
up any resources associated with the lease and obliges the grantor of the lease
to not take any action involving the lease holder that was part of the agreement
that was the subject of the lease.
* A lease holder can request that a lease be renewed. The renewal period
can be for a different time than the original lease, and is also subject to
negotiation with the grantor of the lease. The grantor may renew the lease for
the requested period or a shorter period or may refuse to renew the lease at
all. 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. A renewed lease is just like any other
lease and is itself subject to renewal.
* A lease can expire. If a lease period has elapsed with no renewals, the
lease expires, and any resources associated with the lease may be freed by the
lease grantor. Both the grantor and the holder are obliged to act as though the
leased agreement is no longer in force. The expiration of a lease is similar to
the cancellation of a lease, except that no communication is necessary between
the lease holder and the lease grantor.
Leasing is part of a programming model for building reliable distributed
applications. In particular, leasing is a way of ensuring that a uniform
response to failure, forgetting, or disinterest is guaranteed, allowing
agreements to be made that can then be forgotten without the possibility of
unbounded resource consumption, and providing a flexible mechanism for
duration-based agreement.
--------------------------------------------------------------------------
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 ***@java.sun.com