incubator-sling-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cziege...@apache.org
Subject svn commit: r1499459 - /sling/trunk/bundles/jcr/classloader/src/main/java/org/apache/sling/jcr/classloader/internal/ClassLoaderWriterImpl.java
Date Wed, 03 Jul 2013 16:17:44 GMT
Author: cziegeler
Date: Wed Jul  3 16:17:44 2013
New Revision: 1499459

URL: http://svn.apache.org/r1499459
Log:
SLING-2943 :  Classloader might not be invalidated in a cluster 

Modified:
    sling/trunk/bundles/jcr/classloader/src/main/java/org/apache/sling/jcr/classloader/internal/ClassLoaderWriterImpl.java

Modified: sling/trunk/bundles/jcr/classloader/src/main/java/org/apache/sling/jcr/classloader/internal/ClassLoaderWriterImpl.java
URL: http://svn.apache.org/viewvc/sling/trunk/bundles/jcr/classloader/src/main/java/org/apache/sling/jcr/classloader/internal/ClassLoaderWriterImpl.java?rev=1499459&r1=1499458&r2=1499459&view=diff
==============================================================================
--- sling/trunk/bundles/jcr/classloader/src/main/java/org/apache/sling/jcr/classloader/internal/ClassLoaderWriterImpl.java
(original)
+++ sling/trunk/bundles/jcr/classloader/src/main/java/org/apache/sling/jcr/classloader/internal/ClassLoaderWriterImpl.java
Wed Jul  3 16:17:44 2013
@@ -239,6 +239,7 @@ public class ClassLoaderWriterImpl
      */
     public boolean delete(final String name) {
         final String path = cleanPath(name);
+        this.handleChangeEvent(path);
         Session session = null;
         try {
             session = createSession();
@@ -246,7 +247,6 @@ public class ClassLoaderWriterImpl
                 Item fileItem = session.getItem(path);
                 fileItem.remove();
                 session.save();
-                this.handleChangeEvent(path);
                 return true;
             }
         } catch (final RepositoryException re) {
@@ -273,16 +273,18 @@ public class ClassLoaderWriterImpl
      * @see org.apache.sling.commons.classloader.ClassLoaderWriter#rename(java.lang.String,
java.lang.String)
      */
     public boolean rename(final String oldName, final String newName) {
+        final String oldPath = cleanPath(oldName);
+        final String newPath = cleanPath(newName);
+
         Session session = null;
         try {
-            final String oldPath = cleanPath(oldName);
-            final String newPath = cleanPath(newName);
-
             session = this.createSession();
             session.move(oldPath, newPath);
             session.save();
+
             this.handleChangeEvent(oldName);
             this.handleChangeEvent(newName);
+
             return true;
         } catch (final RepositoryException re) {
             logger.error("Cannot rename " + oldName + " to " + newName, re);



Mime
View raw message