+/*
+ * Copyright (c) 2014 Cisco Systems, Inc. and others. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
package org.opendaylight.controller.md.sal.common.impl.util;
import java.util.concurrent.locks.Lock;
-import java.util.concurrent.locks.ReadWriteLock;
-import java.util.concurrent.locks.ReentrantLock;
import java.util.concurrent.locks.ReentrantReadWriteLock;
import java.util.concurrent.locks.ReentrantReadWriteLock.ReadLock;
import java.util.concurrent.locks.ReentrantReadWriteLock.WriteLock;
private final ReentrantReadWriteLock delegateLock = new ReentrantReadWriteLock();
private final ReadLock delegateReadLock = delegateLock.readLock();
private final WriteLock delegateWriteLock = delegateLock.writeLock();
-
-
+
+
protected Lock getDelegateReadLock() {
return delegateReadLock;
}
}
/**
- *
+ *
* @param newDelegate
* @return oldDelegate
*/
delegateWriteLock.unlock();
}
}
-
-
+
+
protected void onDelegateChanged(T oldDelegate, T newDelegate) {
// NOOP in abstract calss;
}