// if the lease is outdated or broken, it will be ignored
if (newLease.isValid()) {
// update the old lease. assume FLease will always announce lease changes in order.
Flease oldLease = null;
synchronized (this) {
oldLease = lease;
lease = newLease;
notifyAll();
}
// notify listener if the leaseholder has changed
if (oldLease == null || !newLeaseHolder.equals(oldLease.getLeaseHolder())) {
listener.updateLeaseHolder(getAddress(newLeaseHolder));
}
}
}