net.jini.lease
Class LeaseRenewalManager.RenewTask

java.lang.Object
  extended by net.jini.lease.LeaseRenewalManager.RenewTask
All Implemented Interfaces:
TaskManager.Task, Runnable
Enclosing class:
LeaseRenewalManager

private final class LeaseRenewalManager.RenewTask
extends Object
implements TaskManager.Task


Field Summary
private  List bList
          Entries of leases to renew (if multiple, all can be batched)
private  boolean noRenewals
          True if this task only holds leases that have reached their actual or desired expiration
 
Constructor Summary
LeaseRenewalManager.RenewTask(long now)
          Create a collection of entries whose leases can be batch renewed with the last lease in the map, or a list of entries whose leases need to be removed.
 
Method Summary
private  List processBadLeases(long now)
          Find any expired leases, remove them from bList and leaseInRenew, and return any with listeners.
 void run()
           
 boolean runAfter(List tasks, int size)
          No ordering.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

bList

private final List bList
Entries of leases to renew (if multiple, all can be batched)


noRenewals

private final boolean noRenewals
True if this task only holds leases that have reached their actual or desired expiration

Constructor Detail

LeaseRenewalManager.RenewTask

LeaseRenewalManager.RenewTask(long now)
Create a collection of entries whose leases can be batch renewed with the last lease in the map, or a list of entries whose leases need to be removed. Which is created depends on the state of the last lease in the map. Remove each entry from the map, and add them to leaseInRenew.

Method Detail

run

public void run()
Specified by:
run in interface Runnable

runAfter

public boolean runAfter(List tasks,
                        int size)
No ordering.

Specified by:
runAfter in interface TaskManager.Task
Parameters:
tasks - the tasks to consider. A read-only List, with all elements instanceof Task.
size - elements with index less than size should be considered

processBadLeases

private List processBadLeases(long now)
Find any expired leases, remove them from bList and leaseInRenew, and return any with listeners.



Copyright 2007-2010, multiple authors.
Licensed under the Apache License, Version 2.0, see the NOTICE file for attributions.