jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ju...@apache.org
Subject svn commit: r747337 - /jackrabbit/commons/jcr-rmi/trunk/src/main/java/org/apache/jackrabbit/rmi/client/ClientSession.java
Date Tue, 24 Feb 2009 10:53:33 GMT
Author: jukka
Date: Tue Feb 24 10:53:33 2009
New Revision: 747337

URL: http://svn.apache.org/viewvc?rev=747337&view=rev
Log:
JCRRMI-3: Session.isLive() and logout() throw exceptions

Modified:
    jackrabbit/commons/jcr-rmi/trunk/src/main/java/org/apache/jackrabbit/rmi/client/ClientSession.java

Modified: jackrabbit/commons/jcr-rmi/trunk/src/main/java/org/apache/jackrabbit/rmi/client/ClientSession.java
URL: http://svn.apache.org/viewvc/jackrabbit/commons/jcr-rmi/trunk/src/main/java/org/apache/jackrabbit/rmi/client/ClientSession.java?rev=747337&r1=747336&r2=747337&view=diff
==============================================================================
--- jackrabbit/commons/jcr-rmi/trunk/src/main/java/org/apache/jackrabbit/rmi/client/ClientSession.java
(original)
+++ jackrabbit/commons/jcr-rmi/trunk/src/main/java/org/apache/jackrabbit/rmi/client/ClientSession.java
Tue Feb 24 10:53:33 2009
@@ -45,6 +45,8 @@
 import org.apache.jackrabbit.commons.xml.SerializingContentHandler;
 import org.apache.jackrabbit.rmi.remote.RemoteSession;
 import org.apache.jackrabbit.rmi.value.SerialValueFactory;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 import org.xml.sax.ContentHandler;
 import org.xml.sax.SAXException;
 
@@ -59,6 +61,12 @@
  */
 public class ClientSession extends ClientObject implements Session {
 
+    /**
+     * Logger instance.
+     */
+    private static final Logger log =
+        LoggerFactory.getLogger(ClientSession.class);
+
     /** The current repository. */
     private Repository repository;
 
@@ -333,7 +341,8 @@
         try {
             remote.logout();
         } catch (RemoteException ex) {
-            throw new RemoteRuntimeException(ex);
+            // JCRRMI-3: Just log a warning, the connection is dead anyway
+            log.warn("Remote logout failed", ex);
         } finally {
             // mark "dead"
             live = false;
@@ -480,7 +489,8 @@
         try {
             return live && remote.isLive();
         } catch (RemoteException e) {
-            throw new RemoteRuntimeException(e);
+            log.warn("Failed to test remote session state", e);
+            return false;
         }
     }
 }



Mime
View raw message