|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.jini.lease.LeaseRenewalManager.Entry
private static class LeaseRenewalManager.Entry
Field Summary | |
---|---|
long |
actualRenew
Actual time to renew, given concurrency limitations |
private static long |
cnt
|
long |
endTime
Current actual expiration |
Throwable |
ex
Renewal exception, or null |
long |
expiration
Desired expiration |
long |
id
Unique id |
Lease |
lease
The lease |
LeaseListener |
listener
The listener, or null |
long |
renew
The next time we have to do something with this lease. |
long |
renewDuration
Renew duration |
Constructor Summary | |
---|---|
LeaseRenewalManager.Entry(Lease lease,
long expiration,
long renewDuration,
LeaseListener listener)
|
|
LeaseRenewalManager.Entry(long renew)
Create a fake entry for tailMap |
Method Summary | |
---|---|
void |
calcRenew(long now)
Calculate the renew time for the lease entry |
boolean |
canBatch(LeaseRenewalManager.Entry e)
Returns true if the renewal of this lease can be batched with the (earlier) renewal of the given lease. |
int |
compareTo(Object obj)
Sort by decreasing renew time, secondary sort by decreasing id |
void |
delayRenew()
Calculate a new renew time due to an indefinite exception |
DesiredExpirationListener |
desiredExpirationListener()
Return the DesiredExpirationListener associated with this lease, or null if there is none. |
long |
getRenewDuration(long now)
If the renewDuration is ANY, return ANY, otherwise return the minimum of the renewDuration and the time remaining until the desired expiration. |
boolean |
renewalsDone()
Return true if the actual expiration is greater than or equal to the desired expiration (e.g. we don't need to renew this lease any more. |
private static boolean |
sameConstraints(Lease l1,
Lease l2)
Returns true if the two leases both implement RemoteMethodControl and have the same constraints for Lease methods, or both don't implement RemoteMethodControl, else returns false. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private static long cnt
public final long id
public final Lease lease
public long expiration
public long renewDuration
public final LeaseListener listener
public long endTime
public long renew
public long actualRenew
public Throwable ex
Constructor Detail |
---|
public LeaseRenewalManager.Entry(Lease lease, long expiration, long renewDuration, LeaseListener listener)
public LeaseRenewalManager.Entry(long renew)
Method Detail |
---|
public long getRenewDuration(long now)
public void calcRenew(long now)
public void delayRenew()
public int compareTo(Object obj)
compareTo
in interface Comparable
public boolean canBatch(LeaseRenewalManager.Entry e)
First checks that both leases require renewal, have the same client constraints, and can be batched. Then enforces additional requirements to avoid renewing the lease too much more often than necessary.
One of the following must be true:
In addition, one of the following must be true:
private static boolean sameConstraints(Lease l1, Lease l2)
public DesiredExpirationListener desiredExpirationListener()
public boolean renewalsDone()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |