You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by oz...@apache.org on 2005/01/07 14:52:42 UTC
cvs commit: jakarta-commons/transaction/src/java/org/apache/commons/transaction/locking GenericLockManager.java GenericLock.java
ozeigermann 2005/01/07 05:52:42
Modified: transaction/src/java/org/apache/commons/transaction/locking
GenericLockManager.java GenericLock.java
Log:
Minor Javadoc
Revision Changes Path
1.13 +18 -13 jakarta-commons/transaction/src/java/org/apache/commons/transaction/locking/GenericLockManager.java
Index: GenericLockManager.java
===================================================================
RCS file: /home/cvs/jakarta-commons/transaction/src/java/org/apache/commons/transaction/locking/GenericLockManager.java,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -r1.12 -r1.13
--- GenericLockManager.java 7 Jan 2005 13:36:19 -0000 1.12
+++ GenericLockManager.java 7 Jan 2005 13:52:42 -0000 1.13
@@ -34,7 +34,12 @@
import org.apache.commons.transaction.util.LoggerFacade;
/**
- * Manager for {@link GenericLock}s on resources.
+ * Manager for {@link GenericLock}s on resources. This implementation includes
+ * <ul>
+ * <li>deadlock detection, which is configurable to come into effect after an initial short waiting
+ * lock request; this is useful as it is somewhat expensive
+ * <li>global transaction timeouts that actively revok granted rights from transactions
+ * </ul>
*
* @version $Revision$
*/
@@ -123,7 +128,7 @@
}
/**
- * @see LockManager#tryLock(Object, Object, int, boolean)
+ * @see LockManager2#tryLock(Object, Object, int, boolean)
*/
public boolean tryLock(Object ownerId, Object resourceId, int targetLockLevel, boolean reentrant) {
timeoutCheck(ownerId);
@@ -140,7 +145,7 @@
}
/**
- * @see LockManager#lock(Object, Object, int, boolean)
+ * @see LockManager2#lock(Object, Object, int, boolean)
*/
public void lock(Object ownerId, Object resourceId, int targetLockLevel, boolean reentrant)
throws LockException {
@@ -148,7 +153,7 @@
}
/**
- * @see LockManager#lock(Object, Object, int, boolean, long)
+ * @see LockManager2#lock(Object, Object, int, boolean, long)
*/
public void lock(Object ownerId, Object resourceId, int targetLockLevel, boolean reentrant,
long timeoutMSecs) throws LockException {
@@ -172,7 +177,7 @@
// (b) register us as a waiter before actually trying, so other threads take us into account
// XXX: This may however mean both deadlocking parts detect the deadlock simultaneously,
// and both will be rolled back. The (worse) alternative, however, is that we add us
- // as a waiter ofter deadlock check which may mean we do not detect the deadlock at all
+ // as a waiter after deadlock check which may mean we do not detect the deadlock at all
addWaiter(lock, ownerId);
try {
@@ -247,7 +252,7 @@
}
/**
- * @see LockManager#getLevel(Object, Object)
+ * @see LockManager2#getLevel(Object, Object)
*/
public int getLevel(Object ownerId, Object resourceId) {
timeoutCheck(ownerId);
@@ -260,7 +265,7 @@
}
/**
- * @see LockManager#release(Object, Object)
+ * @see LockManager2#release(Object, Object)
*/
public void release(Object ownerId, Object resourceId) {
timeoutCheck(ownerId);
@@ -270,7 +275,7 @@
}
/**
- * @see LockManager#releaseAll(Object)
+ * @see LockManager2#releaseAll(Object)
*/
public void releaseAll(Object ownerId) {
// XXX even if we are timed out we can still have
@@ -296,7 +301,7 @@
}
/**
- * @see LockManager#getAll(Object)
+ * @see LockManager2#getAll(Object)
*/
public Set getAll(Object ownerId) {
Set locks = (Set) globalOwners.get(ownerId);
1.8 +5 -14 jakarta-commons/transaction/src/java/org/apache/commons/transaction/locking/GenericLock.java
Index: GenericLock.java
===================================================================
RCS file: /home/cvs/jakarta-commons/transaction/src/java/org/apache/commons/transaction/locking/GenericLock.java,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- GenericLock.java 18 Dec 2004 20:02:05 -0000 1.7
+++ GenericLock.java 7 Jan 2005 13:52:42 -0000 1.8
@@ -106,7 +106,7 @@
*
* </p>
* <p>
- * Additionally, there are no preferences for specific locks you can pass to
+ * Additionally, there are preferences for specific locks you can pass to
* {@link #acquire(Object, int, boolean, int, boolean, long)}.
* This means whenever more thanone party
* waits for a lock you can specify which one is to be preferred. This gives you
@@ -117,15 +117,6 @@
* <li>completely random preferences
* </ul>
* </p>
- *
- * General limitations include: <br>
- * <ul>
- * <li>You are restricted to the scheme described above
- * <li>You can not specify a timeframe for the validity of a lock. This means
- * an owner of a thread can never lose a lock except when <em>actively</em>
- * releasing it. This is bad when an owner either forgets to release a lock or
- * is not able to do so due to error states or abnormal termination.
- * </ul>
*
* @version $Revision$
*/
---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org