Author: manik.surtani(a)jboss.com
Date: 2008-06-25 09:19:23 -0400 (Wed, 25 Jun 2008)
New Revision: 6022
Modified:
core/trunk/src/main/java/org/jboss/cache/lock/LockManager.java
Log:
* Updated javadocs
* Updated methods to throw InterruptedException
Modified: core/trunk/src/main/java/org/jboss/cache/lock/LockManager.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/lock/LockManager.java 2008-06-25 13:17:18 UTC
(rev 6021)
+++ core/trunk/src/main/java/org/jboss/cache/lock/LockManager.java 2008-06-25 13:19:23 UTC
(rev 6022)
@@ -32,7 +32,7 @@
* @param owner owner to acquire the lock for
* @return true if the lock was acquired, false otherwise.
*/
- boolean lock(Fqn fqn, LockType lockType, Object owner);
+ boolean lock(Fqn fqn, LockType lockType, Object owner) throws InterruptedException;
/**
* Acquires a lock of type lockType, for a given owner, on a specific Node in the
cache, denoted by fqn. This
@@ -44,7 +44,7 @@
* @param timeout maximum length of time to wait for (in millis)
* @return true if the lock was acquired, false otherwise.
*/
- boolean lock(Fqn fqn, LockType lockType, Object owner, long timeout);
+ boolean lock(Fqn fqn, LockType lockType, Object owner, long timeout) throws
InterruptedException;
/**
* As {@link #lock(org.jboss.cache.Fqn, LockType, Object)} except that a NodeSPI is
passed in instead of an Fqn.
@@ -54,7 +54,7 @@
* @param owner owner to acquire the lock for
* @return true if the lock was acquired, false otherwise.
*/
- boolean lock(NodeSPI node, LockType lockType, Object owner);
+ boolean lock(NodeSPI node, LockType lockType, Object owner) throws
InterruptedException;
/**
* As {@link #lock(org.jboss.cache.Fqn, LockType, Object, long)} except that a NodeSPI
is passed in instead of an Fqn.
@@ -65,7 +65,7 @@
* @param timeout maximum length of time to wait for (in millis)
* @return true if the lock was acquired, false otherwise.
*/
- boolean lock(NodeSPI node, LockType lockType, Object owner, long timeout);
+ boolean lock(NodeSPI node, LockType lockType, Object owner, long timeout) throws
InterruptedException;
/**
* Acquires a lock of type lockType, on a specific Node in the cache, denoted by fqn.
This
@@ -73,8 +73,7 @@
* is specified in {@link org.jboss.cache.config.Option#getLockAcquisitionTimeout()}
and, if this is unset, the default timeout
* set in {@link org.jboss.cache.config.Configuration#getLockAcquisitionTimeout()} is
used.
* <p/>
- * In addition, any locks acquired are added to the context using {@link
org.jboss.cache.InvocationContext#addInvocationLockAcquired(NodeLock)}
- * if you are not running in a transaction, or using {@link
org.jboss.cache.transaction.TransactionEntry#addLock(NodeLock)} if you are.
+ * In addition, any locks acquired are added to the context OR transaction entry using
{@link org.jboss.cache.InvocationContext#addLock(Object)}.
* <p/>
* The owner for the lock is determined by passing the invocation context to {@link
#getLockOwner(org.jboss.cache.InvocationContext)}.
* <p/>
@@ -84,7 +83,7 @@
* @param ctx invocation context associated with this invocation
* @return true if the lock was acquired, false otherwise.
*/
- boolean lockAndRecord(Fqn fqn, LockType lockType, InvocationContext ctx);
+ boolean lockAndRecord(Fqn fqn, LockType lockType, InvocationContext ctx) throws
InterruptedException;
/**
* Acquires a lock of type lockType, on a specific Node in the cache, denoted by fqn.
This
@@ -92,8 +91,7 @@
* is specified in {@link org.jboss.cache.config.Option#getLockAcquisitionTimeout()}
and, if this is unset, the default timeout
* set in {@link org.jboss.cache.config.Configuration#getLockAcquisitionTimeout()} is
used.
* <p/>
- * In addition, any locks acquired are added to the context using {@link
org.jboss.cache.InvocationContext#addInvocationLockAcquired(NodeLock)}
- * if you are not running in a transaction, or using {@link
org.jboss.cache.transaction.TransactionEntry#addLock(NodeLock)} if you are.
+ * In addition, any locks acquired are added to the context OR transaction entry using
{@link org.jboss.cache.InvocationContext#addLock(Object)}.
* <p/>
* The owner for the lock is determined by passing the invocation context to {@link
#getLockOwner(org.jboss.cache.InvocationContext)}.
* <p/>
@@ -103,7 +101,7 @@
* @param ctx invocation context associated with this invocation
* @return true if the lock was acquired, false otherwise.
*/
- boolean lockAndRecord(NodeSPI node, LockType lockType, InvocationContext ctx);
+ boolean lockAndRecord(NodeSPI node, LockType lockType, InvocationContext ctx) throws
InterruptedException;
/**
@@ -147,7 +145,7 @@
* @param owner owner to acquire the lock for
* @return true if the lock was acquired, false otherwise.
*/
- boolean lockAll(NodeSPI node, LockType lockType, Object owner);
+ boolean lockAll(NodeSPI node, LockType lockType, Object owner) throws
InterruptedException;
/**
* Locks the node and all child nodes, acquiring lock of type specified for the owner
specified. If only some locks are
@@ -159,7 +157,7 @@
* @param timeout maximum length of time to wait for (in millis)
* @return true if all locks were acquired, false otherwise.
*/
- boolean lockAll(NodeSPI node, LockType lockType, Object owner, long timeout);
+ boolean lockAll(NodeSPI node, LockType lockType, Object owner, long timeout) throws
InterruptedException;
/**
* Locks the node and all child nodes, acquiring lock of type specified for the owner
specified. If only some locks are
@@ -172,14 +170,13 @@
* @param excludeInternalFqns if true, any Fqns that are internal are excluded.
* @return true if all locks were acquired, false otherwise.
*/
- boolean lockAll(NodeSPI node, LockType lockType, Object owner, long timeout, boolean
excludeInternalFqns);
+ boolean lockAll(NodeSPI node, LockType lockType, Object owner, long timeout, boolean
excludeInternalFqns) throws InterruptedException;
/**
* Locks the node and all child nodes, acquiring lock of type specified for the owner
specified. If only some locks are
* acquired, all locks are released and the method returns false.
* <p/>
- * In addition, any locks acquired are added to the context using {@link
org.jboss.cache.InvocationContext#addInvocationLockAcquired(NodeLock)}
- * if you are not running in a transaction, or using {@link
org.jboss.cache.transaction.TransactionEntry#addLock(NodeLock)} if you are.
+ * In addition, any locks acquired are added to the context OR transaction entry using
{@link org.jboss.cache.InvocationContext#addLock(Object)}.
* <p/>
* The owner for the lock is determined by passing the invocation context to {@link
#getLockOwner(org.jboss.cache.InvocationContext)}.
* <p/>
@@ -189,14 +186,13 @@
* @param ctx invocation context associated with this invocation
* @return true if all locks were acquired, false otherwise.
*/
- boolean lockAllAndRecord(NodeSPI node, LockType lockType, InvocationContext ctx);
+ boolean lockAllAndRecord(NodeSPI node, LockType lockType, InvocationContext ctx)
throws InterruptedException;
/**
* Locks the node and all child nodes, acquiring lock of type specified for the owner
specified. If only some locks are
* acquired, all locks are released and the method returns false.
* <p/>
- * In addition, any locks acquired are added to the context using {@link
org.jboss.cache.InvocationContext#addInvocationLockAcquired(NodeLock)}
- * if you are not running in a transaction, or using {@link
org.jboss.cache.transaction.TransactionEntry#addLock(NodeLock)} if you are.
+ * In addition, any locks acquired are added to the context OR transaction entry using
{@link org.jboss.cache.InvocationContext#addLock(Object)}.
* <p/>
* The owner for the lock is determined by passing the invocation context to {@link
#getLockOwner(org.jboss.cache.InvocationContext)}.
* <p/>
@@ -206,7 +202,7 @@
* @param ctx invocation context associated with this invocation
* @return true if all locks were acquired, false otherwise.
*/
- boolean lockAllAndRecord(Fqn fqn, LockType lockType, InvocationContext ctx);
+ boolean lockAllAndRecord(Fqn fqn, LockType lockType, InvocationContext ctx) throws
InterruptedException;
/**
* Releases locks on a given node and all children for a given owner.