geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jdil...@apache.org
Subject svn commit: r662994 - /geronimo/gshell/trunk/gshell-remote/gshell-whisper/src/main/java/org/apache/geronimo/gshell/whisper/request/RequestManager.java
Date Wed, 04 Jun 2008 06:14:00 GMT
Author: jdillon
Date: Tue Jun  3 23:14:00 2008
New Revision: 662994

URL: http://svn.apache.org/viewvc?rev=662994&view=rev
Log:
Prevent NPE when RM closes and processes registrations which are not active.

Modified:
    geronimo/gshell/trunk/gshell-remote/gshell-whisper/src/main/java/org/apache/geronimo/gshell/whisper/request/RequestManager.java

Modified: geronimo/gshell/trunk/gshell-remote/gshell-whisper/src/main/java/org/apache/geronimo/gshell/whisper/request/RequestManager.java
URL: http://svn.apache.org/viewvc/geronimo/gshell/trunk/gshell-remote/gshell-whisper/src/main/java/org/apache/geronimo/gshell/whisper/request/RequestManager.java?rev=662994&r1=662993&r2=662994&view=diff
==============================================================================
--- geronimo/gshell/trunk/gshell-remote/gshell-whisper/src/main/java/org/apache/geronimo/gshell/whisper/request/RequestManager.java
(original)
+++ geronimo/gshell/trunk/gshell-remote/gshell-whisper/src/main/java/org/apache/geronimo/gshell/whisper/request/RequestManager.java
Tue Jun  3 23:14:00 2008
@@ -302,18 +302,23 @@
         }
 
         public void timeout() {
-            Message.ID id = request.getId();
-
-            if (timeoutFuture.isCancelled()) {
-                throw new TimeoutAbortedException("Timeout has been canceled: " + id);
-            }
-            else if (request.isSignaled()) {
-                throw new TimeoutAbortedException("Request has been singled: " + id);
+            if (state != RegistrationState.ACTIVE) {
+                log.debug("Can not timeout; state is not ACTIVE, found: {}", state);
             }
             else {
-                request.timeout();
+                Message.ID id = request.getId();
+
+                if (timeoutFuture.isCancelled()) {
+                    throw new TimeoutAbortedException("Timeout has been canceled: " + id);
+                }
+                else if (request.isSignaled()) {
+                    throw new TimeoutAbortedException("Request has been singled: " + id);
+                }
+                else {
+                    request.timeout();
 
-                state = RegistrationState.TIMEDOUT;
+                    state = RegistrationState.TIMEDOUT;
+                }
             }
         }
 



Mime
View raw message