Expirerpublic class Expirer extends Object implements LeaseManager
Fields Summary |
---|
Landlord | landlord | WakeupManager | manager | HashMap | tickets |
Constructors Summary |
---|
public Expirer(Landlord l)
landlord = l;
tickets = new HashMap(13);
manager = new WakeupManager();
|
Methods Summary |
---|
public void | register(LeasedResource resource, long duration)
WakeupManager.Ticket ticket;
ticket = (WakeupManager.Ticket) tickets.remove(resource);
if (ticket != null)
manager.cancel(ticket);
ExpirerTask task = new ExpirerTask(resource);
ticket = manager.schedule(resource.getExpiration(), task);
tickets.put(resource, ticket);
| public void | renewed(LeasedResource resource, long duration, long oldExpiration)
register(resource, duration);
|
|