class LRMEventListener extends InterruptedStatusThread implements DesiredExpirationListener
| Modifier and Type | Class and Description |
|---|---|
private static class |
LRMEventListener.Discriminator
Trivial container class to tell us if we are processing the given
wrapper because of a failure event or a desired expiration
reached event.
|
InterruptedStatusThread.InterruptableThread.State, Thread.UncaughtExceptionHandler| Modifier and Type | Field and Description |
|---|---|
(package private) static LeaseDeniedException |
EXPIRED_SET_EXCEPTION
Any events that hold this object are ignored
|
private static Logger |
logger
Logger for logging messages for this class
|
private Queue |
queue
Queue we use to decouple the reception of events from the lease
renewal manager from the scheduling of the sending of remote
events and modifying our internal tables (which both require
obtaining serious locks).
|
private NormServerBaseImpl |
server
Ref to the main server object which has all the top level methods
|
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY| Constructor and Description |
|---|
LRMEventListener()
Simple constructor
|
| Modifier and Type | Method and Description |
|---|---|
void |
expirationReached(LeaseRenewalEvent e)
Method used to delivered desired expiration reached events.
|
void |
notify(LeaseRenewalEvent e)
Called by the
LeaseRenewalManager when it cannot
renew a lease that it is managing, and the lease's desired
expiration time has not yet been reached. |
void |
run() |
(package private) void |
setServer(NormServerBaseImpl server)
Set only once after construction.
|
hasBeenInterrupted, interruptactiveCount, checkAccess, clone, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yieldprivate static final Logger logger
private volatile NormServerBaseImpl server
private final Queue queue
static final LeaseDeniedException EXPIRED_SET_EXCEPTION
void setServer(NormServerBaseImpl server)
server - Object that will make the actual internal updates and
schedule the sending of remote eventspublic void notify(LeaseRenewalEvent e)
LeaseListenerLeaseRenewalManager when it cannot
renew a lease that it is managing, and the lease's desired
expiration time has not yet been reached.
Note that, prior to invoking this method, the
LeaseRenewalManager removes the affected lease from
the managed set of leases. Note also that, because of the
reentrancy guarantee made by the
LeaseRenewalManager, new leases can be safely added
by this method.
notify in interface LeaseListenere - instance of LeaseRenewalEvent containing
information about the lease that the
LeaseRenewalManager was unable to renew, as
well as information about the condition that made the
LeaseRenewalManager fail to renew the leasepublic void expirationReached(LeaseRenewalEvent e)
DesiredExpirationListenergetException method of the passed event will always
return null.
Note that, prior to invoking this method, the
LeaseRenewalManager removes the affected lease from
the managed set of leases. Note also that, because of the
reentrancy guarantee made by the
LeaseRenewalManager, it is safe to call back into
the renewal manager from this method.
expirationReached in interface DesiredExpirationListenere - instance of LeaseRenewalEvent containing
information about the lease that was removed from the
LeaseRenewalManager because its desired
expiration was reachedCopyright 2007-2013, multiple authors.
Licensed under the Apache License, Version 2.0, see the NOTICE file for attributions.