<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> | |
<!-- NewPage --> | |
<html lang="en"> | |
<head> | |
<!-- Generated by javadoc (1.8.0) on Sun Aug 28 20:42:10 EST 2016 --> | |
<title>LeaseRenewalSet (Apache River v3.0.0 API Documentation (internals))</title> | |
<meta name="date" content="2016-08-28"> | |
<link rel="stylesheet" type="text/css" href="../../../stylesheet.css" title="Style"> | |
<script type="text/javascript" src="../../../script.js"></script> | |
</head> | |
<body> | |
<script type="text/javascript"><!-- | |
try { | |
if (location.href.indexOf('is-external=true') == -1) { | |
parent.document.title="LeaseRenewalSet (Apache River v3.0.0 API Documentation (internals))"; | |
} | |
} | |
catch(err) { | |
} | |
//--> | |
var methods = {"i0":6,"i1":6,"i2":6,"i3":6,"i4":6,"i5":6,"i6":6,"i7":6,"i8":6}; | |
var tabs = {65535:["t0","All Methods"],2:["t2","Instance Methods"],4:["t3","Abstract Methods"]}; | |
var altColor = "altColor"; | |
var rowColor = "rowColor"; | |
var tableTab = "tableTab"; | |
var activeTableTab = "activeTableTab"; | |
</script> | |
<noscript> | |
<div>JavaScript is disabled on your browser.</div> | |
</noscript> | |
<!-- ========= START OF TOP NAVBAR ======= --> | |
<div class="topNav"><a name="navbar.top"> | |
<!-- --> | |
</a> | |
<div class="skipNav"><a href="#skip.navbar.top" title="Skip navigation links">Skip navigation links</a></div> | |
<a name="navbar.top.firstrow"> | |
<!-- --> | |
</a> | |
<ul class="navList" title="Navigation"> | |
<li><a href="../../../overview-summary.html">Overview</a></li> | |
<li><a href="package-summary.html">Package</a></li> | |
<li class="navBarCell1Rev">Class</li> | |
<li><a href="class-use/LeaseRenewalSet.html">Use</a></li> | |
<li><a href="package-tree.html">Tree</a></li> | |
<li><a href="../../../deprecated-list.html">Deprecated</a></li> | |
<li><a href="../../../index-all.html">Index</a></li> | |
<li><a href="../../../help-doc.html">Help</a></li> | |
</ul> | |
</div> | |
<div class="subNav"> | |
<ul class="navList"> | |
<li><a href="../../../net/jini/lease/LeaseRenewalService.html" title="interface in net.jini.lease"><span class="typeNameLink">Prev Class</span></a></li> | |
<li><a href="../../../net/jini/lease/LeaseUnmarshalException.html" title="class in net.jini.lease"><span class="typeNameLink">Next Class</span></a></li> | |
</ul> | |
<ul class="navList"> | |
<li><a href="../../../index.html?net/jini/lease/LeaseRenewalSet.html" target="_top">Frames</a></li> | |
<li><a href="LeaseRenewalSet.html" target="_top">No Frames</a></li> | |
</ul> | |
<ul class="navList" id="allclasses_navbar_top"> | |
<li><a href="../../../allclasses-noframe.html">All Classes</a></li> | |
</ul> | |
<div> | |
<script type="text/javascript"><!-- | |
allClassesLink = document.getElementById("allclasses_navbar_top"); | |
if(window==top) { | |
allClassesLink.style.display = "block"; | |
} | |
else { | |
allClassesLink.style.display = "none"; | |
} | |
//--> | |
</script> | |
</div> | |
<div> | |
<ul class="subNavList"> | |
<li>Summary: </li> | |
<li>Nested | </li> | |
<li><a href="#field.summary">Field</a> | </li> | |
<li>Constr | </li> | |
<li><a href="#method.summary">Method</a></li> | |
</ul> | |
<ul class="subNavList"> | |
<li>Detail: </li> | |
<li><a href="#field.detail">Field</a> | </li> | |
<li>Constr | </li> | |
<li><a href="#method.detail">Method</a></li> | |
</ul> | |
</div> | |
<a name="skip.navbar.top"> | |
<!-- --> | |
</a></div> | |
<!-- ========= END OF TOP NAVBAR ========= --> | |
<!-- ======== START OF CLASS DATA ======== --> | |
<div class="header"> | |
<div class="subTitle">net.jini.lease</div> | |
<h2 title="Interface LeaseRenewalSet" class="title">Interface LeaseRenewalSet</h2> | |
</div> | |
<div class="contentContainer"> | |
<div class="description"> | |
<ul class="blockList"> | |
<li class="blockList"> | |
<dl> | |
<dt>All Known Implementing Classes:</dt> | |
<dd><a href="../../../org/apache/river/norm/SetProxy.html" title="class in org.apache.river.norm">SetProxy</a>, <a href="../../../org/apache/river/norm/SetProxy.ConstrainableSetProxy.html" title="class in org.apache.river.norm">SetProxy.ConstrainableSetProxy</a></dd> | |
</dl> | |
<hr> | |
<br> | |
<pre>public interface <span class="typeNameLabel">LeaseRenewalSet</span></pre> | |
<div class="block">A collection of leases being managed by a lease renewal service. | |
<p> | |
Clients of the renewal service organize the leases they wish to | |
have renewed into <em>lease renewal sets</em> (or <em>sets</em>, | |
for short). These sets are represented by objects implementing this | |
interface. The | |
<code>LeaseRenewalService.createLeaseRenewalSet</code> method is | |
provided to create sets. Sets are populated by methods on the sets | |
themselves. Two leases in the same set need not be granted by the | |
same service or have the same expiration time; in addition, they | |
can be added or removed from the set independently. | |
<p> | |
This interface is not a remote interface; each implementation of the | |
renewal service exports proxy objects that implement the | |
<code>LeaseRenewalSet</code> interface that use an | |
implementation-specific protocol to communicate with the actual | |
remote server. All of the proxy methods obey normal RMI remote | |
interface semantics except where explicitly noted. Two proxy objects | |
are equal if they are proxies for the same set created by the same | |
renewal service. Every method invocation (on both a | |
<code>LeaseRenewalService</code> and all the | |
<code>LeaseRenewalSet</code> instances created by that server) is | |
atomic with respect to other invocations. | |
<p> | |
A number of the methods in this class throw | |
<code>RemoteException</code>, each of these may throw the | |
<code>java.rmi.NoSuchObjectException</code> subclass. If a client | |
receives a <code>NoSuchObjectException</code> when calling a method | |
on a renewal set, the client can infer that the set has been | |
destroyed; however, it should not infer that the renewal service | |
has been destroyed. | |
<p> | |
The term <em>client lease</em> is used to refer to a lease that has | |
been placed into a renewal set. Client leases are distinct from the | |
leases that the renewal service grants on renewal sets it has | |
created. | |
<p> | |
Each client lease has two expiration related times associated with | |
it: the <em>desired expiration</em> time for the lease, and the | |
<em>actual expiration</em> time granted when the lease was created | |
or last renewed. The desired expiration represents when the client | |
would like the lease to expire. The actual expiration represents | |
when the lease is going to expire if it is not renewed. Both time | |
values are absolute times, not relative time durations. When a | |
client lease's desired expiration arrives, the lease will be | |
removed from the set without further client intervention. | |
<p> | |
Each client lease also has two other associated attributes: a | |
desired <em>renewal duration</em> and a <em>remaining desired | |
duration</em>. The desired renewal duration is specified by the | |
client (directly or indirectly) when the lease is added to the | |
set. This duration must normally be a positive number, however, it | |
may be <code>Lease.ANY</code> if the lease's desired expiration is | |
<code>Lease.FOREVER</code>. The remaining desired duration is | |
always the desired expiration less the current time. | |
<p> | |
Each time a client lease is renewed, the renewal service will ask | |
for an extension equal to the lease's renewal duration if the | |
renewal duration is: | |
<ul> | |
<li> Lease.ANY, or | |
<li> less than the remaining desired duration, | |
</ul> | |
otherwise, it will ask for an extension equal to the lease's | |
remaining desired duration. | |
<p> | |
If a client lease's actual expiration is later than its desired | |
expiration, the renewal service will not renew the lease; the lease | |
will remain in the set until its desired expiration is reached, the | |
set is destroyed, or it is removed by the client. | |
<p> | |
Each set is leased from the renewal service. If the lease on a set | |
expires or is cancelled, the renewal service will destroy the set | |
and take no further action with regard to the client leases in the | |
set. Each lease renewal set has associated with it an expiration | |
warning event that occurs at a client-specified time before the | |
lease on the set expires. Clients can register for warning events | |
using methods provided by the set. A registration for warning | |
events does not have its own lease, but instead is covered by the | |
same lease under which the set was granted. | |
<p> | |
The term <em>definite exception</em> is used to refer to an | |
exception that could be thrown by an operation on a client lease | |
(such as a remote method call) that would be indicative of a | |
permanent failure of the client lease. For purposes of this | |
document, all bad object exceptions, bad invocation exceptions, and | |
<code>LeaseException</code>s are considered to be definite | |
exceptions. | |
<p> | |
Each lease renewal set has associated with it a renewal failure | |
event that will occur in either of two cases: if any client lease | |
in the set reaches its actual expiration before its desired | |
expiration is reached, or if the renewal service attempts to renew | |
a client lease and gets a definite exception. Clients can register | |
for failure events using methods provided by the set. A | |
registration for failure event does not have its own lease, but | |
instead is covered by the same lease under which the set was | |
granted. | |
<p> | |
Once placed in a set, a client lease will stay there until one or | |
more of the following occurs: | |
<ul> | |
<li> The lease on the set itself expires or is cancelled, | |
causing destruction of the set | |
<li> The client lease is removed by the client | |
<li> The client lease's actual or desired expiration is reached | |
<li> A renewal attempt on the client lease results in a | |
definite exception | |
</ul> | |
<p> | |
Each client lease in a set will be renewed as long as it is in the | |
set. If a renewal call throws an indefinite exception, the renewal | |
service should retry the lease renewal until the lease would | |
otherwise be removed from the set. The renewal service will never | |
cancel a client lease. The preferred method of cancelling a client | |
lease is for the client to first remove the lease from the set and | |
then call cancel on it. It is also permissible for the client to | |
cancel the lease without first removing the lease from the set, | |
although this is likely to result in additional network traffic. | |
<p> | |
Client leases get returned to clients in a number of ways (via | |
<code>remove</code> and <code>getLeases</code> calls, as components | |
of events, etc.). In general, they should have their serial format | |
set to <code>Lease.DURATION</code> before being transferred to the | |
client's virtual machine. In some exceptional circumstances, this | |
may not be possible (for example, the client lease was recovered | |
from persistent storage and could not be deserialized in the | |
server's virtual machine). In these cases, it is acceptable to | |
transfer the lease to the client using the | |
<code>Lease.ABSOLUTE</code> serial format. | |
<p> | |
Whenever a client lease gets returned to a client, its actual | |
expiration should reflect either: | |
<ul> | |
<li> The result of the last successful renewal call that the | |
renewal service made or | |
<li> The expiration time the lease originally had when it was | |
added to the set, if the renewal service has not yet | |
successfully renewed the lease | |
</ul></div> | |
<dl> | |
<dt><span class="simpleTagLabel">Author:</span></dt> | |
<dd>Sun Microsystems, Inc.</dd> | |
<dt><span class="seeLabel">See Also:</span></dt> | |
<dd><a href="../../../net/jini/lease/LeaseRenewalService.html" title="interface in net.jini.lease"><code>LeaseRenewalService</code></a></dd> | |
</dl> | |
</li> | |
</ul> | |
</div> | |
<div class="summary"> | |
<ul class="blockList"> | |
<li class="blockList"> | |
<!-- =========== FIELD SUMMARY =========== --> | |
<ul class="blockList"> | |
<li class="blockList"><a name="field.summary"> | |
<!-- --> | |
</a> | |
<h3>Field Summary</h3> | |
<table class="memberSummary" border="0" cellpadding="3" cellspacing="0" summary="Field Summary table, listing fields, and an explanation"> | |
<caption><span>Fields</span><span class="tabEnd"> </span></caption> | |
<tr> | |
<th class="colFirst" scope="col">Modifier and Type</th> | |
<th class="colLast" scope="col">Field and Description</th> | |
</tr> | |
<tr class="altColor"> | |
<td class="colFirst"><code>static long</code></td> | |
<td class="colLast"><code><span class="memberNameLink"><a href="../../../net/jini/lease/LeaseRenewalSet.html#EXPIRATION_WARNING_EVENT_ID">EXPIRATION_WARNING_EVENT_ID</a></span></code> | |
<div class="block">The event id for all <code>ExpirationWarningEvent</code> objects.</div> | |
</td> | |
</tr> | |
<tr class="rowColor"> | |
<td class="colFirst"><code>static long</code></td> | |
<td class="colLast"><code><span class="memberNameLink"><a href="../../../net/jini/lease/LeaseRenewalSet.html#RENEWAL_FAILURE_EVENT_ID">RENEWAL_FAILURE_EVENT_ID</a></span></code> | |
<div class="block">The event id for all <code>RenewalFailureEvent</code> objects.</div> | |
</td> | |
</tr> | |
</table> | |
</li> | |
</ul> | |
<!-- ========== METHOD SUMMARY =========== --> | |
<ul class="blockList"> | |
<li class="blockList"><a name="method.summary"> | |
<!-- --> | |
</a> | |
<h3>Method Summary</h3> | |
<table class="memberSummary" border="0" cellpadding="3" cellspacing="0" summary="Method Summary table, listing methods, and an explanation"> | |
<caption><span id="t0" class="activeTableTab"><span>All Methods</span><span class="tabEnd"> </span></span><span id="t2" class="tableTab"><span><a href="javascript:show(2);">Instance Methods</a></span><span class="tabEnd"> </span></span><span id="t3" class="tableTab"><span><a href="javascript:show(4);">Abstract Methods</a></span><span class="tabEnd"> </span></span></caption> | |
<tr> | |
<th class="colFirst" scope="col">Modifier and Type</th> | |
<th class="colLast" scope="col">Method and Description</th> | |
</tr> | |
<tr id="i0" class="altColor"> | |
<td class="colFirst"><code>void</code></td> | |
<td class="colLast"><code><span class="memberNameLink"><a href="../../../net/jini/lease/LeaseRenewalSet.html#clearExpirationWarningListener--">clearExpirationWarningListener</a></span>()</code> | |
<div class="block">Remove the listener currently registered for expiration warning | |
events.</div> | |
</td> | |
</tr> | |
<tr id="i1" class="rowColor"> | |
<td class="colFirst"><code>void</code></td> | |
<td class="colLast"><code><span class="memberNameLink"><a href="../../../net/jini/lease/LeaseRenewalSet.html#clearRenewalFailureListener--">clearRenewalFailureListener</a></span>()</code> | |
<div class="block">Remove the listener currently registered for renewal failure | |
events.</div> | |
</td> | |
</tr> | |
<tr id="i2" class="altColor"> | |
<td class="colFirst"><code><a href="../../../net/jini/core/lease/Lease.html" title="interface in net.jini.core.lease">Lease</a>[]</code></td> | |
<td class="colLast"><code><span class="memberNameLink"><a href="../../../net/jini/lease/LeaseRenewalSet.html#getLeases--">getLeases</a></span>()</code> | |
<div class="block">Returns all the leases currently in the set.</div> | |
</td> | |
</tr> | |
<tr id="i3" class="rowColor"> | |
<td class="colFirst"><code><a href="../../../net/jini/core/lease/Lease.html" title="interface in net.jini.core.lease">Lease</a></code></td> | |
<td class="colLast"><code><span class="memberNameLink"><a href="../../../net/jini/lease/LeaseRenewalSet.html#getRenewalSetLease--">getRenewalSetLease</a></span>()</code> | |
<div class="block">Returns the lease that controls the lifetime of this set.</div> | |
</td> | |
</tr> | |
<tr id="i4" class="altColor"> | |
<td class="colFirst"><code><a href="../../../net/jini/core/lease/Lease.html" title="interface in net.jini.core.lease">Lease</a></code></td> | |
<td class="colLast"><code><span class="memberNameLink"><a href="../../../net/jini/lease/LeaseRenewalSet.html#remove-net.jini.core.lease.Lease-">remove</a></span>(<a href="../../../net/jini/core/lease/Lease.html" title="interface in net.jini.core.lease">Lease</a> leaseToRemove)</code> | |
<div class="block">Removes the specified lease from set.</div> | |
</td> | |
</tr> | |
<tr id="i5" class="rowColor"> | |
<td class="colFirst"><code>void</code></td> | |
<td class="colLast"><code><span class="memberNameLink"><a href="../../../net/jini/lease/LeaseRenewalSet.html#renewFor-net.jini.core.lease.Lease-long-">renewFor</a></span>(<a href="../../../net/jini/core/lease/Lease.html" title="interface in net.jini.core.lease">Lease</a> leaseToRenew, | |
long desiredDuration)</code> | |
<div class="block">Include a client lease in the set for a specified duration.</div> | |
</td> | |
</tr> | |
<tr id="i6" class="altColor"> | |
<td class="colFirst"><code>void</code></td> | |
<td class="colLast"><code><span class="memberNameLink"><a href="../../../net/jini/lease/LeaseRenewalSet.html#renewFor-net.jini.core.lease.Lease-long-long-">renewFor</a></span>(<a href="../../../net/jini/core/lease/Lease.html" title="interface in net.jini.core.lease">Lease</a> leaseToRenew, | |
long desiredDuration, | |
long renewDuration)</code> | |
<div class="block">Include a client lease in the set for a specified duration and | |
with a specified renewal duration.</div> | |
</td> | |
</tr> | |
<tr id="i7" class="rowColor"> | |
<td class="colFirst"><code><a href="../../../net/jini/core/event/EventRegistration.html" title="class in net.jini.core.event">EventRegistration</a></code></td> | |
<td class="colLast"><code><span class="memberNameLink"><a href="../../../net/jini/lease/LeaseRenewalSet.html#setExpirationWarningListener-net.jini.core.event.RemoteEventListener-long-java.rmi.MarshalledObject-">setExpirationWarningListener</a></span>(<a href="../../../net/jini/core/event/RemoteEventListener.html" title="interface in net.jini.core.event">RemoteEventListener</a> listener, | |
long minWarning, | |
<a href="http://docs.oracle.com/javase/6/docs/api/java/rmi/MarshalledObject.html?is-external=true" title="class or interface in java.rmi">MarshalledObject</a> handback)</code> | |
<div class="block">Register for the expiration warning event associated with this | |
set.</div> | |
</td> | |
</tr> | |
<tr id="i8" class="altColor"> | |
<td class="colFirst"><code><a href="../../../net/jini/core/event/EventRegistration.html" title="class in net.jini.core.event">EventRegistration</a></code></td> | |
<td class="colLast"><code><span class="memberNameLink"><a href="../../../net/jini/lease/LeaseRenewalSet.html#setRenewalFailureListener-net.jini.core.event.RemoteEventListener-java.rmi.MarshalledObject-">setRenewalFailureListener</a></span>(<a href="../../../net/jini/core/event/RemoteEventListener.html" title="interface in net.jini.core.event">RemoteEventListener</a> listener, | |
<a href="http://docs.oracle.com/javase/6/docs/api/java/rmi/MarshalledObject.html?is-external=true" title="class or interface in java.rmi">MarshalledObject</a> handback)</code> | |
<div class="block">Register for the renewal failure event associated with this set.</div> | |
</td> | |
</tr> | |
</table> | |
</li> | |
</ul> | |
</li> | |
</ul> | |
</div> | |
<div class="details"> | |
<ul class="blockList"> | |
<li class="blockList"> | |
<!-- ============ FIELD DETAIL =========== --> | |
<ul class="blockList"> | |
<li class="blockList"><a name="field.detail"> | |
<!-- --> | |
</a> | |
<h3>Field Detail</h3> | |
<a name="RENEWAL_FAILURE_EVENT_ID"> | |
<!-- --> | |
</a> | |
<ul class="blockList"> | |
<li class="blockList"> | |
<h4>RENEWAL_FAILURE_EVENT_ID</h4> | |
<pre>static final long RENEWAL_FAILURE_EVENT_ID</pre> | |
<div class="block">The event id for all <code>RenewalFailureEvent</code> objects.</div> | |
<dl> | |
<dt><span class="seeLabel">See Also:</span></dt> | |
<dd><a href="../../../net/jini/lease/RenewalFailureEvent.html" title="class in net.jini.lease"><code>RenewalFailureEvent</code></a>, | |
<a href="../../../constant-values.html#net.jini.lease.LeaseRenewalSet.RENEWAL_FAILURE_EVENT_ID">Constant Field Values</a></dd> | |
</dl> | |
</li> | |
</ul> | |
<a name="EXPIRATION_WARNING_EVENT_ID"> | |
<!-- --> | |
</a> | |
<ul class="blockListLast"> | |
<li class="blockList"> | |
<h4>EXPIRATION_WARNING_EVENT_ID</h4> | |
<pre>static final long EXPIRATION_WARNING_EVENT_ID</pre> | |
<div class="block">The event id for all <code>ExpirationWarningEvent</code> objects.</div> | |
<dl> | |
<dt><span class="seeLabel">See Also:</span></dt> | |
<dd><a href="../../../net/jini/lease/ExpirationWarningEvent.html" title="class in net.jini.lease"><code>ExpirationWarningEvent</code></a>, | |
<a href="../../../constant-values.html#net.jini.lease.LeaseRenewalSet.EXPIRATION_WARNING_EVENT_ID">Constant Field Values</a></dd> | |
</dl> | |
</li> | |
</ul> | |
</li> | |
</ul> | |
<!-- ============ METHOD DETAIL ========== --> | |
<ul class="blockList"> | |
<li class="blockList"><a name="method.detail"> | |
<!-- --> | |
</a> | |
<h3>Method Detail</h3> | |
<a name="renewFor-net.jini.core.lease.Lease-long-long-"> | |
<!-- --> | |
</a> | |
<ul class="blockList"> | |
<li class="blockList"> | |
<h4>renewFor</h4> | |
<pre>void renewFor(<a href="../../../net/jini/core/lease/Lease.html" title="interface in net.jini.core.lease">Lease</a> leaseToRenew, | |
long desiredDuration, | |
long renewDuration) | |
throws <a href="http://docs.oracle.com/javase/6/docs/api/java/rmi/RemoteException.html?is-external=true" title="class or interface in java.rmi">RemoteException</a></pre> | |
<div class="block">Include a client lease in the set for a specified duration and | |
with a specified renewal duration. | |
<p> | |
The <code>leaseToRenew</code> argument specifies the lease to be | |
added to the set. An <code>IllegalArgumentException</code> must | |
be thrown if the lease was granted by the renewal service | |
itself. If <code>leaseToRenew</code> is <code>null</code>, a | |
<code>NullPointerException</code> must be thrown. | |
<p> | |
The <code>desiredDuration</code> argument is the number of | |
milliseconds the client would like the lease to remain in the | |
set. It is used to calculate the lease's initial desired | |
expiration by adding <code>desiredDuration</code> to the current | |
time (as viewed by the service). If this causes an overflow, a | |
desired expiration of <code>Long.MAX_VALUE</code> will be | |
used. Unlike a lease duration, the desired duration is | |
unilaterally specified by the client, not negotiated between the | |
client and the service. Note, a negative value for | |
<code>desiredDuration</code> (including <code>Lease.ANY</code>) | |
will result in a desired expiration that is in the past, causing | |
<code>leaseToRenew</code> to be dropped from the set; this action | |
will neither result in an exception or an event. | |
<p> | |
If the actual expiration time of <code>leaseToRenew</code> is | |
less than the current time (as viewed by the renewal service) and | |
the current time is less than the desired expiration time for | |
<code>leaseToRenew</code>, the method will return | |
normally. However, <code>leaseToRenew</code> will be dropped from | |
the set and a renewal failure event will be generated. | |
<p> | |
The <code>renewDuration</code> is the initial renewal duration to | |
associate with <code>leaseToRenew</code> (in milliseconds). If | |
<code>desiredDuration</code> is exactly | |
<code>Long.MAX_VALUE</code>, the <code>renewDuration</code> may | |
be any positive number or <code>Lease.ANY</code>; otherwise it | |
must be a positive number. If these requirements are not met, the | |
renewal service must throw an | |
<code>IllegalArgumentException</code>. | |
<p> | |
Calling this method with a lease that is equivalent to a client | |
lease already in the set will associate the existing client lease | |
in the set with the new desired duration and renew duration. The | |
client lease is not replaced because it is more likely that the | |
renewal service, rather than the client, has an up-to-date lease | |
expiration. The service is more likely to have an up-to-date | |
expiration because the client should not be renewing a lease that | |
it has passed to a lease renewal service unless the lease is | |
removed first. These semantics also allow <code>renewFor</code> | |
to be used in an idempotent fashion.</div> | |
<dl> | |
<dt><span class="paramLabel">Parameters:</span></dt> | |
<dd><code>leaseToRenew</code> - the lease to be added to the renewal set</dd> | |
<dd><code>desiredDuration</code> - the maximum length of time in milliseconds | |
the <code>leaseToRenew</code> should remain in the set, or | |
<code>Lease.FOREVER</code> which implies there is no | |
pre-specified time when the lease should be removed from | |
the set</dd> | |
<dd><code>renewDuration</code> - the lease duration to request when renewing | |
the lease, unless <code>renewDuration</code> is greater | |
than the remainder of the <code>desiredDuration</code></dd> | |
<dt><span class="throwsLabel">Throws:</span></dt> | |
<dd><code><a href="http://docs.oracle.com/javase/6/docs/api/java/lang/IllegalArgumentException.html?is-external=true" title="class or interface in java.lang">IllegalArgumentException</a></code> - if <code>desiredDuration</code> | |
is <code>Lease.FOREVER</code>, <code>renewDuration</code> | |
is not a positive value, <code>Lease.FOREVER</code>, or | |
<code>Lease.ANY</code>. If <code>desiredDuration</code> | |
is not <code>Lease.FOREVER</code>, | |
<code>IllegalArgumentException</code> will be thrown if | |
<code>renewDuration</code> is not a positive value or | |
<code>Lease.ANY</code>. <code>IllegalArgumentException</code> | |
will also be thrown if <code>leaseToRenew</code> | |
was granted by this renewal service.</dd> | |
<dd><code><a href="http://docs.oracle.com/javase/6/docs/api/java/lang/NullPointerException.html?is-external=true" title="class or interface in java.lang">NullPointerException</a></code> - if <code>leaseToRenew</code> is | |
<code>null</code></dd> | |
<dd><code><a href="http://docs.oracle.com/javase/6/docs/api/java/rmi/RemoteException.html?is-external=true" title="class or interface in java.rmi">RemoteException</a></code> - if a communication-related exception | |
occurs</dd> | |
</dl> | |
</li> | |
</ul> | |
<a name="renewFor-net.jini.core.lease.Lease-long-"> | |
<!-- --> | |
</a> | |
<ul class="blockList"> | |
<li class="blockList"> | |
<h4>renewFor</h4> | |
<pre>void renewFor(<a href="../../../net/jini/core/lease/Lease.html" title="interface in net.jini.core.lease">Lease</a> leaseToRenew, | |
long desiredDuration) | |
throws <a href="http://docs.oracle.com/javase/6/docs/api/java/rmi/RemoteException.html?is-external=true" title="class or interface in java.rmi">RemoteException</a></pre> | |
<div class="block">Include a client lease in the set for a specified duration. | |
<p> | |
Calling this method is equivalent to making the following call | |
on this set: | |
<pre> | |
renewFor(leaseToRenew, desiredDuration, Lease.FOREVER) | |
</pre></div> | |
<dl> | |
<dt><span class="paramLabel">Parameters:</span></dt> | |
<dd><code>leaseToRenew</code> - the lease to be added to the renewal set</dd> | |
<dd><code>desiredDuration</code> - the maximum length of time in milliseconds | |
the <code>leaseToRenew</code> should remain in the set, or | |
<code>Lease.FOREVER</code> which implies there is no | |
pre-specified time when the lease should be removed from | |
the set</dd> | |
<dt><span class="throwsLabel">Throws:</span></dt> | |
<dd><code><a href="http://docs.oracle.com/javase/6/docs/api/java/lang/IllegalArgumentException.html?is-external=true" title="class or interface in java.lang">IllegalArgumentException</a></code> - if <code>leaseToRenew</code> | |
was granted by this renewal service</dd> | |
<dd><code><a href="http://docs.oracle.com/javase/6/docs/api/java/lang/NullPointerException.html?is-external=true" title="class or interface in java.lang">NullPointerException</a></code> - if <code>leaseToRenew</code> is | |
<code>null</code></dd> | |
<dd><code><a href="http://docs.oracle.com/javase/6/docs/api/java/rmi/RemoteException.html?is-external=true" title="class or interface in java.rmi">RemoteException</a></code> - if a communication-related exception | |
occurs</dd> | |
</dl> | |
</li> | |
</ul> | |
<a name="remove-net.jini.core.lease.Lease-"> | |
<!-- --> | |
</a> | |
<ul class="blockList"> | |
<li class="blockList"> | |
<h4>remove</h4> | |
<pre><a href="../../../net/jini/core/lease/Lease.html" title="interface in net.jini.core.lease">Lease</a> remove(<a href="../../../net/jini/core/lease/Lease.html" title="interface in net.jini.core.lease">Lease</a> leaseToRemove) | |
throws <a href="http://docs.oracle.com/javase/6/docs/api/java/rmi/RemoteException.html?is-external=true" title="class or interface in java.rmi">RemoteException</a></pre> | |
<div class="block">Removes the specified lease from set. If the lease is currently | |
in the set it will be returned, otherwise <code>null</code> will | |
be returned. <code>leaseToRemove</code> will not be | |
canceled by this call.</div> | |
<dl> | |
<dt><span class="paramLabel">Parameters:</span></dt> | |
<dd><code>leaseToRemove</code> - lease to be removed from the set</dd> | |
<dt><span class="returnLabel">Returns:</span></dt> | |
<dd>the removed lease if it was in the set or | |
<code>null</code> if it was not</dd> | |
<dt><span class="throwsLabel">Throws:</span></dt> | |
<dd><code><a href="http://docs.oracle.com/javase/6/docs/api/java/lang/NullPointerException.html?is-external=true" title="class or interface in java.lang">NullPointerException</a></code> - if <code>leaseToRemove</code> is | |
<code>null</code></dd> | |
<dd><code><a href="http://docs.oracle.com/javase/6/docs/api/java/rmi/RemoteException.html?is-external=true" title="class or interface in java.rmi">RemoteException</a></code> - if a communication-related exception | |
occurs</dd> | |
</dl> | |
</li> | |
</ul> | |
<a name="getLeases--"> | |
<!-- --> | |
</a> | |
<ul class="blockList"> | |
<li class="blockList"> | |
<h4>getLeases</h4> | |
<pre><a href="../../../net/jini/core/lease/Lease.html" title="interface in net.jini.core.lease">Lease</a>[] getLeases() | |
throws <a href="../../../net/jini/lease/LeaseUnmarshalException.html" title="class in net.jini.lease">LeaseUnmarshalException</a>, | |
<a href="http://docs.oracle.com/javase/6/docs/api/java/rmi/RemoteException.html?is-external=true" title="class or interface in java.rmi">RemoteException</a></pre> | |
<div class="block">Returns all the leases currently in the set.</div> | |
<dl> | |
<dt><span class="returnLabel">Returns:</span></dt> | |
<dd>the leases in the set. Return a zero length array if | |
there are not leases currently in the set.</dd> | |
<dt><span class="throwsLabel">Throws:</span></dt> | |
<dd><code><a href="../../../net/jini/lease/LeaseUnmarshalException.html" title="class in net.jini.lease">LeaseUnmarshalException</a></code> - if one or more of the leases can | |
not be unmarshalled. The throwing of a | |
<code>LeaseUnmarshalException</code> represents a, | |
possibly transient, failure in the ability to unmarshal | |
one or more client leases in the set, it does not | |
necessarily imply anything about the state of the renewal | |
service or the set themselves.</dd> | |
<dd><code><a href="http://docs.oracle.com/javase/6/docs/api/java/rmi/RemoteException.html?is-external=true" title="class or interface in java.rmi">RemoteException</a></code> - if a communication-related exception | |
occurs</dd> | |
</dl> | |
</li> | |
</ul> | |
<a name="setExpirationWarningListener-net.jini.core.event.RemoteEventListener-long-java.rmi.MarshalledObject-"> | |
<!-- --> | |
</a> | |
<ul class="blockList"> | |
<li class="blockList"> | |
<h4>setExpirationWarningListener</h4> | |
<pre><a href="../../../net/jini/core/event/EventRegistration.html" title="class in net.jini.core.event">EventRegistration</a> setExpirationWarningListener(<a href="../../../net/jini/core/event/RemoteEventListener.html" title="interface in net.jini.core.event">RemoteEventListener</a> listener, | |
long minWarning, | |
<a href="http://docs.oracle.com/javase/6/docs/api/java/rmi/MarshalledObject.html?is-external=true" title="class or interface in java.rmi">MarshalledObject</a> handback) | |
throws <a href="http://docs.oracle.com/javase/6/docs/api/java/rmi/RemoteException.html?is-external=true" title="class or interface in java.rmi">RemoteException</a></pre> | |
<div class="block">Register for the expiration warning event associated with this | |
set. | |
<p> | |
This method allows the client to register for notification of | |
the approaching expiration of the set's lease. The | |
<code>listener</code> argument specifies what listener should | |
be notified when the lease is about to expire. The | |
<code>minWarning</code> argument specifies a minimum number of | |
milliseconds before lease expiration that the first event | |
delivery attempt should be made by the service. The service may | |
also make subsequent delivery attempts if the first and any | |
subsequent attempts have been indeterminate. The | |
<code>minWarning</code> argument must be zero or a positive | |
number; if it is not, an <code>IllegalArgumentException</code> | |
must be thrown. If the current expiration of the set's lease is | |
less than <code>minWarning</code> milliseconds away, the event | |
will occur immediately (though it will take time to propagate | |
to the listener). | |
<p> | |
The <code>handback</code> argument to this method specifies an | |
object that will be part of the expiration warning event | |
notification. This mechanism is detailed in the Jini | |
Distributed Event Specification. | |
<p> | |
This method returns the event registration for this event. The | |
<code>Lease</code> object associated with the registration will | |
be equivalent (in the sense of <code>equals</code>) to the | |
<code>Lease</code> on the renewal set. Because the event | |
registration shares a lease with the set, clients that want to | |
just remove their expiration warning registration without | |
destroying the set should use the | |
<code>clearExpirationWarningListener</code> method instead of | |
cancelling the registration's lease. The registration's event | |
ID will be | |
<code>LeaseRenewalSet.EXPIRATION_WARNING_EVENT_ID</code>. The | |
source of the registration will be the set. The method must | |
throw a <code>NullPointerException</code> if the | |
<code>listener</code> argument is <code>null</code>. If an | |
event handler has already been specified for this event the | |
current registration is replaced with the new one. Because both | |
registrations are for the same kind of event, the events sent | |
to the new registration must be in the same sequence as the | |
events sent to the old registration.</div> | |
<dl> | |
<dt><span class="paramLabel">Parameters:</span></dt> | |
<dd><code>listener</code> - the listener to be notified when this event | |
occurs</dd> | |
<dd><code>minWarning</code> - how long before the lease on the set expires | |
should the event be sent</dd> | |
<dd><code>handback</code> - an object to be handed back to the listener when | |
the warning event occurs</dd> | |
<dt><span class="returnLabel">Returns:</span></dt> | |
<dd>an <code>EventRegistration</code> describing the event | |
registration</dd> | |
<dt><span class="throwsLabel">Throws:</span></dt> | |
<dd><code><a href="http://docs.oracle.com/javase/6/docs/api/java/lang/IllegalArgumentException.html?is-external=true" title="class or interface in java.lang">IllegalArgumentException</a></code> - if <code>minWarning</code> is | |
negative</dd> | |
<dd><code><a href="http://docs.oracle.com/javase/6/docs/api/java/lang/NullPointerException.html?is-external=true" title="class or interface in java.lang">NullPointerException</a></code> - if <code>listener</code> is | |
<code>null</code></dd> | |
<dd><code><a href="http://docs.oracle.com/javase/6/docs/api/java/rmi/RemoteException.html?is-external=true" title="class or interface in java.rmi">RemoteException</a></code> - if a communication-related exception | |
occurs</dd> | |
</dl> | |
</li> | |
</ul> | |
<a name="clearExpirationWarningListener--"> | |
<!-- --> | |
</a> | |
<ul class="blockList"> | |
<li class="blockList"> | |
<h4>clearExpirationWarningListener</h4> | |
<pre>void clearExpirationWarningListener() | |
throws <a href="http://docs.oracle.com/javase/6/docs/api/java/rmi/RemoteException.html?is-external=true" title="class or interface in java.rmi">RemoteException</a></pre> | |
<div class="block">Remove the listener currently registered for expiration warning | |
events. It is safe to call this method even if no listener is | |
currently registered.</div> | |
<dl> | |
<dt><span class="throwsLabel">Throws:</span></dt> | |
<dd><code><a href="http://docs.oracle.com/javase/6/docs/api/java/rmi/RemoteException.html?is-external=true" title="class or interface in java.rmi">RemoteException</a></code> - if a communication-related exception | |
occurs</dd> | |
</dl> | |
</li> | |
</ul> | |
<a name="setRenewalFailureListener-net.jini.core.event.RemoteEventListener-java.rmi.MarshalledObject-"> | |
<!-- --> | |
</a> | |
<ul class="blockList"> | |
<li class="blockList"> | |
<h4>setRenewalFailureListener</h4> | |
<pre><a href="../../../net/jini/core/event/EventRegistration.html" title="class in net.jini.core.event">EventRegistration</a> setRenewalFailureListener(<a href="../../../net/jini/core/event/RemoteEventListener.html" title="interface in net.jini.core.event">RemoteEventListener</a> listener, | |
<a href="http://docs.oracle.com/javase/6/docs/api/java/rmi/MarshalledObject.html?is-external=true" title="class or interface in java.rmi">MarshalledObject</a> handback) | |
throws <a href="http://docs.oracle.com/javase/6/docs/api/java/rmi/RemoteException.html?is-external=true" title="class or interface in java.rmi">RemoteException</a></pre> | |
<div class="block">Register for the renewal failure event associated with this set. | |
<p> | |
This method allows the client to register for the event | |
associated with the failure to renew a client lease in the | |
set. These events are generated when a client lease expires | |
while it is still in the set, or when the service attempts to | |
renew a client lease and gets a definite exception. The | |
listener argument specifies the listener to be notified if a | |
client lease could not be renewed. | |
<p> | |
The <code>handback</code> argument specifies an object that | |
will be part of the renewal failure event notification. This | |
mechanism is detailed in the Jini Distributed Event | |
Specification. | |
<p> | |
This method returns the event registration for this event. The | |
<code>Lease</code> object associated with the registration will | |
be equivalent (in the sense of <code>equals</code>) to the | |
<code>Lease</code> on the renewal set. Because the event | |
registration shares a lease with the set, clients that want to | |
just remove their expiration warning registration without | |
destroying the set should use the | |
<code>clearRenewalFailureListener</code> method, instead of | |
cancelling the registration's lease. The registration's event | |
ID will be | |
<code>LeaseRenewalSet.RENEWAL_FAILURE_EVENT_ID</code>. The | |
source of the registration will be the set. The method must | |
throw <code>NullPointerException</code> if the | |
<code>listener</code> argument is <code>null</code>. If an | |
event handler has already been specified for this event the | |
current registration is replaced with the new one. The returned | |
event registration must have the same event ID as the replaced | |
registration. Because both registrations are for the same kind | |
of event, the events sent to the new registration must be in | |
the same sequence as the events sent to the old registration.</div> | |
<dl> | |
<dt><span class="paramLabel">Parameters:</span></dt> | |
<dd><code>listener</code> - the listener to be notified when this event | |
occurs</dd> | |
<dd><code>handback</code> - an object to be handed back to the listener when | |
the warning event occurs</dd> | |
<dt><span class="returnLabel">Returns:</span></dt> | |
<dd>an <code>EventRegistration</code> describing the event | |
registration</dd> | |
<dt><span class="throwsLabel">Throws:</span></dt> | |
<dd><code><a href="http://docs.oracle.com/javase/6/docs/api/java/lang/NullPointerException.html?is-external=true" title="class or interface in java.lang">NullPointerException</a></code> - if <code>listener</code> is | |
<code>null</code></dd> | |
<dd><code><a href="http://docs.oracle.com/javase/6/docs/api/java/rmi/RemoteException.html?is-external=true" title="class or interface in java.rmi">RemoteException</a></code> - if a communication-related exception | |
occurs</dd> | |
</dl> | |
</li> | |
</ul> | |
<a name="clearRenewalFailureListener--"> | |
<!-- --> | |
</a> | |
<ul class="blockList"> | |
<li class="blockList"> | |
<h4>clearRenewalFailureListener</h4> | |
<pre>void clearRenewalFailureListener() | |
throws <a href="http://docs.oracle.com/javase/6/docs/api/java/rmi/RemoteException.html?is-external=true" title="class or interface in java.rmi">RemoteException</a></pre> | |
<div class="block">Remove the listener currently registered for renewal failure | |
events. It is safe to call this method even if no listener is | |
currently registered.</div> | |
<dl> | |
<dt><span class="throwsLabel">Throws:</span></dt> | |
<dd><code><a href="http://docs.oracle.com/javase/6/docs/api/java/rmi/RemoteException.html?is-external=true" title="class or interface in java.rmi">RemoteException</a></code> - if a communication-related exception | |
occurs</dd> | |
</dl> | |
</li> | |
</ul> | |
<a name="getRenewalSetLease--"> | |
<!-- --> | |
</a> | |
<ul class="blockListLast"> | |
<li class="blockList"> | |
<h4>getRenewalSetLease</h4> | |
<pre><a href="../../../net/jini/core/lease/Lease.html" title="interface in net.jini.core.lease">Lease</a> getRenewalSetLease()</pre> | |
<div class="block">Returns the lease that controls the lifetime of this set. Can | |
be used to extend or end the sets lifetime. Note that this method | |
does not make a remote call.</div> | |
<dl> | |
<dt><span class="returnLabel">Returns:</span></dt> | |
<dd>the lease that controls the lifetime of this set</dd> | |
</dl> | |
</li> | |
</ul> | |
</li> | |
</ul> | |
</li> | |
</ul> | |
</div> | |
</div> | |
<!-- ========= END OF CLASS DATA ========= --> | |
<!-- ======= START OF BOTTOM NAVBAR ====== --> | |
<div class="bottomNav"><a name="navbar.bottom"> | |
<!-- --> | |
</a> | |
<div class="skipNav"><a href="#skip.navbar.bottom" title="Skip navigation links">Skip navigation links</a></div> | |
<a name="navbar.bottom.firstrow"> | |
<!-- --> | |
</a> | |
<ul class="navList" title="Navigation"> | |
<li><a href="../../../overview-summary.html">Overview</a></li> | |
<li><a href="package-summary.html">Package</a></li> | |
<li class="navBarCell1Rev">Class</li> | |
<li><a href="class-use/LeaseRenewalSet.html">Use</a></li> | |
<li><a href="package-tree.html">Tree</a></li> | |
<li><a href="../../../deprecated-list.html">Deprecated</a></li> | |
<li><a href="../../../index-all.html">Index</a></li> | |
<li><a href="../../../help-doc.html">Help</a></li> | |
</ul> | |
</div> | |
<div class="subNav"> | |
<ul class="navList"> | |
<li><a href="../../../net/jini/lease/LeaseRenewalService.html" title="interface in net.jini.lease"><span class="typeNameLink">Prev Class</span></a></li> | |
<li><a href="../../../net/jini/lease/LeaseUnmarshalException.html" title="class in net.jini.lease"><span class="typeNameLink">Next Class</span></a></li> | |
</ul> | |
<ul class="navList"> | |
<li><a href="../../../index.html?net/jini/lease/LeaseRenewalSet.html" target="_top">Frames</a></li> | |
<li><a href="LeaseRenewalSet.html" target="_top">No Frames</a></li> | |
</ul> | |
<ul class="navList" id="allclasses_navbar_bottom"> | |
<li><a href="../../../allclasses-noframe.html">All Classes</a></li> | |
</ul> | |
<div> | |
<script type="text/javascript"><!-- | |
allClassesLink = document.getElementById("allclasses_navbar_bottom"); | |
if(window==top) { | |
allClassesLink.style.display = "block"; | |
} | |
else { | |
allClassesLink.style.display = "none"; | |
} | |
//--> | |
</script> | |
</div> | |
<div> | |
<ul class="subNavList"> | |
<li>Summary: </li> | |
<li>Nested | </li> | |
<li><a href="#field.summary">Field</a> | </li> | |
<li>Constr | </li> | |
<li><a href="#method.summary">Method</a></li> | |
</ul> | |
<ul class="subNavList"> | |
<li>Detail: </li> | |
<li><a href="#field.detail">Field</a> | </li> | |
<li>Constr | </li> | |
<li><a href="#method.detail">Method</a></li> | |
</ul> | |
</div> | |
<a name="skip.navbar.bottom"> | |
<!-- --> | |
</a></div> | |
<!-- ======== END OF BOTTOM NAVBAR ======= --> | |
<p class="legalCopy"><small>Copyright 2007-2013, multiple authors.<br>Licensed under the <a href=http://www.apache.org/licenses/LICENSE-2.0 target=child >Apache License, Version 2.0</a>, see the <a href=../../../doc-files/NOTICE target=child >NOTICE</a> file for attributions.</small></p> | |
</body> | |
</html> |