[Mulgara-svn] r1095 - branches/mgr-121-lockrecovery/src/jar/resolver/java/org/mulgara/resolver
ronald at mulgara.org
ronald at mulgara.org
Fri Jul 18 13:51:14 UTC 2008
Author: ronald
Date: 2008-07-18 06:51:13 -0700 (Fri, 18 Jul 2008)
New Revision: 1095
Modified:
branches/mgr-121-lockrecovery/src/jar/resolver/java/org/mulgara/resolver/MulgaraTransactionFactory.java
Log:
Make mutex operations final to ensure they are not overridden by subclasses.
Modified: branches/mgr-121-lockrecovery/src/jar/resolver/java/org/mulgara/resolver/MulgaraTransactionFactory.java
===================================================================
--- branches/mgr-121-lockrecovery/src/jar/resolver/java/org/mulgara/resolver/MulgaraTransactionFactory.java 2008-07-18 13:51:09 UTC (rev 1094)
+++ branches/mgr-121-lockrecovery/src/jar/resolver/java/org/mulgara/resolver/MulgaraTransactionFactory.java 2008-07-18 13:51:13 UTC (rev 1095)
@@ -255,7 +255,7 @@
* @param T the type of exception to throw on failure
* @throws T if the mutex could not be acquired, either due to a timeout or due to an interrupt
*/
- public <T extends Throwable> void acquireMutex(long timeout, Class<T> exc) throws T {
+ public final <T extends Throwable> void acquireMutex(long timeout, Class<T> exc) throws T {
synchronized (getMutexLock()) {
if (mutexHolder == Thread.currentThread()) {
lockCnt++;
@@ -292,7 +292,7 @@
* @throws T if the mutex could not be acquired, either due to a timeout or due to an interrupt
* @see #acquireMutex
*/
- public <T extends Throwable> void acquireMutexWithInterrupt(long timeout, Class<T> exc) throws T {
+ public final <T extends Throwable> void acquireMutexWithInterrupt(long timeout, Class<T> exc) throws T {
synchronized (getMutexLock()) {
if (mutexHolder != null && mutexHolder != Thread.currentThread()) {
mutexHolder.interrupt();
@@ -307,7 +307,7 @@
*
* @throws IllegalStateException is the mutex is not held by the current thread
*/
- public void releaseMutex() {
+ public final void releaseMutex() {
synchronized (getMutexLock()) {
if (Thread.currentThread() != mutexHolder) {
throw new IllegalStateException("Attempt to release mutex without holding mutex");
@@ -325,7 +325,7 @@
* @return the lock used to protect access to and to implement the mutex; must be held as shortly
* as possible (no blocking operations)
*/
- public Object getMutexLock() {
+ public final Object getMutexLock() {
return session;
}
@@ -333,7 +333,7 @@
* @return the current holder of the mutex, or null if none. Must hold the mutex-lock while
* calling this.
*/
- public Thread getMutexHolder() {
+ public final Thread getMutexHolder() {
return mutexHolder;
}
More information about the Mulgara-svn
mailing list