[jbosscache-commits] JBoss Cache SVN: r8040 - core/tags/3.1.0.GA/src/main/java/org/jboss/cache.
jbosscache-commits at lists.jboss.org
jbosscache-commits at lists.jboss.org
Fri May 1 07:07:43 EDT 2009
Author: manik.surtani at jboss.com
Date: 2009-05-01 07:07:43 -0400 (Fri, 01 May 2009)
New Revision: 8040
Modified:
core/tags/3.1.0.GA/src/main/java/org/jboss/cache/RPCManagerImpl.java
Log:
Fixed bug in RPCManager
Modified: core/tags/3.1.0.GA/src/main/java/org/jboss/cache/RPCManagerImpl.java
===================================================================
--- core/tags/3.1.0.GA/src/main/java/org/jboss/cache/RPCManagerImpl.java 2009-05-01 10:59:31 UTC (rev 8039)
+++ core/tags/3.1.0.GA/src/main/java/org/jboss/cache/RPCManagerImpl.java 2009-05-01 11:07:43 UTC (rev 8040)
@@ -231,9 +231,19 @@
public void lockProcessingLock() throws InterruptedException
{
- if (!coordinationLock.readLock().tryLock(configuration.getStateRetrievalTimeout(), TimeUnit.MILLISECONDS))
+ while (true)
{
- throw new TimeoutException("Could not obtain processing lock");
+ try
+ {
+ if (!coordinationLock.readLock().tryLock(configuration.getStateRetrievalTimeout(), TimeUnit.MILLISECONDS))
+ throw new TimeoutException("Could not obtain processing lock");
+
+ return;
+ }
+ catch (InterruptedException ie)
+ {
+ Thread.currentThread().interrupt();
+ }
}
}
@@ -244,9 +254,19 @@
public void lockSuspendProcessingLock() throws InterruptedException
{
- if (!coordinationLock.writeLock().tryLock(configuration.getStateRetrievalTimeout(), TimeUnit.MILLISECONDS))
+ while (true)
{
- throw new TimeoutException("Could not obtain processing lock");
+ try
+ {
+ if (!coordinationLock.writeLock().tryLock(configuration.getStateRetrievalTimeout(), TimeUnit.MILLISECONDS))
+ throw new TimeoutException("Could not obtain processing lock");
+
+ return;
+ }
+ catch (InterruptedException ie)
+ {
+ Thread.currentThread().interrupt();
+ }
}
}
@@ -258,22 +278,43 @@
}
}
+ @Override
public void waitForFlushCompletion(long timeout) throws InterruptedException
{
- if (!flushBlockGate.await(timeout, TimeUnit.MILLISECONDS))
+ while (true)
{
- throw new TimeoutException("State retrieval timed out waiting for flush to unblock. (timeout = " + CachePrinter.prettyPrint(timeout) + ")");
+ try
+ {
+ if (!flushBlockGate.await(timeout, TimeUnit.MILLISECONDS))
+ throw new TimeoutException("State retrieval timed out waiting for flush to unblock. (timeout = " + CachePrinter.prettyPrint(timeout) + ")");
+
+ return;
+ }
+ catch (InterruptedException ie)
+ {
+ Thread.currentThread().interrupt();
+ }
}
}
-
+
+ @Override
public void waitForFlushStart(long timeout) throws InterruptedException
{
- if (!flushWaitGate.await(timeout, TimeUnit.MILLISECONDS))
+ while (true)
{
- throw new TimeoutException("State retrieval timed out waiting for flush to block. (timeout = " + CachePrinter.prettyPrint(timeout) + " )");
+ try
+ {
+ if (!flushWaitGate.await(timeout, TimeUnit.MILLISECONDS))
+ throw new TimeoutException("State retrieval timed out waiting for flush to block. (timeout = " + CachePrinter.prettyPrint(timeout) + ")");
+
+ return;
+ }
+ catch (InterruptedException ie)
+ {
+ Thread.currentThread().interrupt();
+ }
}
}
-
}
// ------------ START: Lifecycle methods ------------
More information about the jbosscache-commits
mailing list