FileDocCategorySizeDatePackage
Expirer.javaAPI DocExample3488Thu Mar 16 11:52:48 GMT 2000None

Expirer

public 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 voidregister(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 voidrenewed(LeasedResource resource, long duration, long oldExpiration)

        register(resource, duration);