incubator-sling-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From romb...@apache.org
Subject svn commit: r1520307 - /sling/branches/tooling-ide-vlt/tooling/ide/impl-vlt/src/org/apache/sling/ide/impl/vlt/JcrCommand.java
Date Thu, 05 Sep 2013 13:40:28 GMT
Author: rombert
Date: Thu Sep  5 13:40:28 2013
New Revision: 1520307

URL: http://svn.apache.org/r1520307
Log:
SLING-2989 - [Tooling] integrate with vlt once available

JcrCommand: logout from session after work is done.

Modified:
    sling/branches/tooling-ide-vlt/tooling/ide/impl-vlt/src/org/apache/sling/ide/impl/vlt/JcrCommand.java

Modified: sling/branches/tooling-ide-vlt/tooling/ide/impl-vlt/src/org/apache/sling/ide/impl/vlt/JcrCommand.java
URL: http://svn.apache.org/viewvc/sling/branches/tooling-ide-vlt/tooling/ide/impl-vlt/src/org/apache/sling/ide/impl/vlt/JcrCommand.java?rev=1520307&r1=1520306&r2=1520307&view=diff
==============================================================================
--- sling/branches/tooling-ide-vlt/tooling/ide/impl-vlt/src/org/apache/sling/ide/impl/vlt/JcrCommand.java
(original)
+++ sling/branches/tooling-ide-vlt/tooling/ide/impl-vlt/src/org/apache/sling/ide/impl/vlt/JcrCommand.java
Thu Sep  5 13:40:28 2013
@@ -47,8 +47,9 @@ public abstract class JcrCommand<T> impl
     @Override
     public Result<T> execute() {
 
+        Session session = null;
         try {
-            Session session = repository.login(credentials);
+            session = repository.login(credentials);
 
             return JcrResult.success(execute0(session));
         } catch (LoginException e) {
@@ -57,6 +58,9 @@ public abstract class JcrCommand<T> impl
             return JcrResult.failure(e);
         } catch (IOException e) {
             return JcrResult.failure(e);
+        } finally {
+            if (session != null)
+                session.logout();
         }
     }
 



Mime
View raw message