Fixed javadoc comments for Lock.
diff --git a/core/api/src/main/java/org/onlab/onos/store/service/Lock.java b/core/api/src/main/java/org/onlab/onos/store/service/Lock.java
index c1eb0ff..6d68133 100644
--- a/core/api/src/main/java/org/onlab/onos/store/service/Lock.java
+++ b/core/api/src/main/java/org/onlab/onos/store/service/Lock.java
@@ -24,7 +24,7 @@
* @param leaseDurationMillis the number of milliseconds to hold the
* lock after granting it, before automatically releasing it if it hasn't
* already been released by invoking unlock(). Must be in the range
- * (0, MAX_LEASE_MILLIS]
+ * (0, LockManager.MAX_LEASE_MILLIS]
*/
void lock(long leaseDurationMillis);
@@ -33,7 +33,7 @@
* @param leaseDurationMillis the number of milliseconds the must be
* locked after it is granted, before automatically releasing it if it hasn't
* already been released by an invocation of unlock(). Must be in the range
- * (0, MAX_LEASE_MILLIS]
+ * (0, LockManager.MAX_LEASE_MILLIS]
* @return true if the lock was acquired and false otherwise
*/
boolean tryLock(long leaseDurationMillis);
@@ -45,7 +45,7 @@
* @param leaseDurationMillis the number of milliseconds to hold the
* lock after granting it, before automatically releasing it if it hasn't
* already been released by invoking unlock(Object). Must be in the range
- * (0, MAX_LEASE_MILLIS]
+ * (0, LockManager.MAX_LEASE_MILLIS]
* @return true if the lock was acquired and false if the waiting time
* elapsed before the lock was acquired
*/
@@ -63,16 +63,14 @@
void unlock();
/**
- * Extends the lease for this lock.
- * @param extensionDurationMillis is the amount of additional
- * time to add to the end of the current expiration time. For example,
- * if the lock is currently set to expire at time T, a successful call to
- * extendLease with an argument of 5000 will cause the lock to
- * now expire at 5 seconds past T.
- * @return true if the extension is successful, false otherwise. Note
- * that a failure to extend the lease does not result in unlocking. The lock
- * will be released either by an explicit call to unlock or when previously
- * acquired lease runs out.
+ * Extends the expiration time for a lock that is currently owned
+ * by a specified duration. The new expiration time is computed
+ * by adding the specified duration to the current time. If this point
+ * in time is earlier than the existing expiration time then this method
+ * has no effect.
+ * @param leaseDurationMillis extension duration.
+ * @return true if successfully extended expiration, false if attempt to
+ * extend expiration fails or if the path is currently not locked by this instance.
*/
- boolean extendLease(long extensionDurationMillis);
+ boolean extendExpiration(long leaseDurationMillis);
}
\ No newline at end of file
diff --git a/core/api/src/main/java/org/onlab/onos/store/service/LockService.java b/core/api/src/main/java/org/onlab/onos/store/service/LockService.java
index 7b742b1..a4ac30b 100644
--- a/core/api/src/main/java/org/onlab/onos/store/service/LockService.java
+++ b/core/api/src/main/java/org/onlab/onos/store/service/LockService.java
@@ -1,13 +1,16 @@
package org.onlab.onos.store.service;
+/**
+ * Service interface for mutual exclusion primitives.
+ */
public interface LockService {
/**
- * Create a new lock instance.
+ * Creates a new lock instance.
* A successful return from this method does not mean the resource guarded by the path is locked.
- * The caller is expect to call Lock.lock() to acquire the lock.
+ * The caller is expected to call Lock.lock() to acquire the lock.
* @param path unique lock name.
- * @return
+ * @return a Lock instance that can be used to acquire the lock.
*/
Lock create(String path);