blob: 7b742b1d2bdaf997a5911df04c6837da0b543a2f [file] [log] [blame]
Madan Jampanif73fb042014-11-11 10:49:05 -08001package org.onlab.onos.store.service;
2
3public interface LockService {
4
5 /**
6 * Create a new lock instance.
7 * A successful return from this method does not mean the resource guarded by the path is locked.
8 * The caller is expect to call Lock.lock() to acquire the lock.
9 * @param path unique lock name.
10 * @return
11 */
12 Lock create(String path);
13
14 /**
15 * Adds a listener to be notified of lock events.
16 * @param listener listener to be added.
17 */
18 void addListener(LockEventListener listener);
19
20 /**
21 * Removes a listener that was previously added.
22 * @param listener listener to be removed.
23 */
24 void removeListener(LockEventListener listener);
25}