class LeaseExpirationMgr extends Object implements LeaseManager, WeakTable.KeyGCHandler
LeaseManager| Modifier and Type | Class and Description |
|---|---|
private class |
LeaseExpirationMgr.Canceler
Objects that do the actually cancel the resource in question, stuck
in
WakeupManager |
(package private) static interface |
LeaseExpirationMgr.Expirer
Interface that allows LeaseExpirationMgr to expire resources.
|
| Modifier and Type | Field and Description |
|---|---|
private WakeupManager |
expirationQueue |
private LeaseExpirationMgr.Expirer |
landlord |
private WeakTable |
ticketMap |
| Constructor and Description |
|---|
LeaseExpirationMgr(LeaseExpirationMgr.Expirer landlord)
Create a
LeaseExpirationMgr to aggressively expire
the leases of the passed landlord (implementing
Expirer is trivial for a Landlord. |
| Modifier and Type | Method and Description |
|---|---|
void |
keyGC(Object value)
Called by WeakTable when it notices that a key has been
collected and the value still exists.
|
void |
register(LeasedResource resource)
Notifies the manager of a new lease being created.
|
void |
renewed(LeasedResource resource)
Notifies the manager of a lease being renewed.
|
private void |
schedule(LeasedResource resource)
Schedule a leased resource to be reaped in the future.
|
(package private) void |
terminate()
Terminate the
LeaseExpirationMgr, killing any
threads it has started |
private final WeakTable ticketMap
private final LeaseExpirationMgr.Expirer landlord
private final WakeupManager expirationQueue
LeaseExpirationMgr(LeaseExpirationMgr.Expirer landlord)
LeaseExpirationMgr to aggressively expire
the leases of the passed landlord (implementing
Expirer is trivial for a Landlord.void terminate()
LeaseExpirationMgr, killing any
threads it has startedpublic void register(LeasedResource resource)
LeaseManagerregister in interface LeaseManagerresource - The resource associated with the new Lease.public void renewed(LeasedResource resource)
LeaseManagerrenewed in interface LeaseManagerresource - The resource associated with the new Lease.private void schedule(LeasedResource resource)
public void keyGC(Object value)
WeakTable.KeyGCHandlerkeyGC in interface WeakTable.KeyGCHandlervalue - The value associated with the collected keyCopyright 2007-2013, multiple authors.
Licensed under the Apache License, Version 2.0, see the NOTICE file for attributions.