}
waitForElection();
if (!isCoordinator() || entryMsg.isSync()) {
if (containsKey) {
if (key.isLockExpired()) {
EntryValue old = this.localMap.get(key.getKey());
if (old != null) {
old.getKey().setLocked(false);
}
} else {
EntryValue<V> old = null;
if (insert) {
synchronized (this.mapMutex) {
old = this.localMap.put(key.getKey(), value);
}
} else {
synchronized (this.mapMutex) {
old = this.localMap.remove(key.getKey());
value.setValue(null);
}
}
fireMapChanged(key.getOwner(), key.getKey(),
old.getValue(), value.getValue(), entryMsg
.isExpired());
}
} else {
if (insert) {
synchronized (this.mapMutex) {