incubator-sling-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cziege...@apache.org
Subject svn commit: r1055855 - in /sling/trunk/installer/core/src/main/java/org/apache/sling/installer/core/impl: EntityResourceList.java RegisteredResource.java RegisteredResourceImpl.java
Date Thu, 06 Jan 2011 12:46:10 GMT
Author: cziegeler
Date: Thu Jan  6 12:46:09 2011
New Revision: 1055855

URL: http://svn.apache.org/viewvc?rev=1055855&view=rev
Log:
SLING-1920 : Make installers pluggable
Don't expose cleanup method in registered resource interface

Modified:
    sling/trunk/installer/core/src/main/java/org/apache/sling/installer/core/impl/EntityResourceList.java
    sling/trunk/installer/core/src/main/java/org/apache/sling/installer/core/impl/RegisteredResource.java
    sling/trunk/installer/core/src/main/java/org/apache/sling/installer/core/impl/RegisteredResourceImpl.java

Modified: sling/trunk/installer/core/src/main/java/org/apache/sling/installer/core/impl/EntityResourceList.java
URL: http://svn.apache.org/viewvc/sling/trunk/installer/core/src/main/java/org/apache/sling/installer/core/impl/EntityResourceList.java?rev=1055855&r1=1055854&r2=1055855&view=diff
==============================================================================
--- sling/trunk/installer/core/src/main/java/org/apache/sling/installer/core/impl/EntityResourceList.java
(original)
+++ sling/trunk/installer/core/src/main/java/org/apache/sling/installer/core/impl/EntityResourceList.java
Thu Jan  6 12:46:09 2011
@@ -136,6 +136,12 @@ public class EntityResourceList implemen
         }
     }
 
+    private void cleanup(final RegisteredResource rr) {
+        if ( rr instanceof RegisteredResourceImpl ) {
+            ((RegisteredResourceImpl)rr).cleanup();
+        }
+    }
+
     public Collection<RegisteredResource> getResources() {
         return resources;
     }
@@ -148,7 +154,7 @@ public class EntityResourceList implemen
         for(final RegisteredResource rr : resources) {
             if ( rr.getURL().equals(r.getURL()) ) {
                 LOGGER.debug("Cleanup obsolete resource: {}", rr);
-                rr.cleanup();
+                this.cleanup(rr);
                 resources.remove(rr);
                 if ( first && rr.equals(r) ) {
                     r.setState(rr.getState());
@@ -173,7 +179,7 @@ public class EntityResourceList implemen
                 } else {
                     LOGGER.debug("Removing unused: {}", r);
                     i.remove();
-                    r.cleanup();
+                    this.cleanup(r);
                 }
             }
             first = false;
@@ -183,7 +189,7 @@ public class EntityResourceList implemen
     public void remove(final RegisteredResource r) {
         if ( resources.remove(r) ) {
             LOGGER.debug("Removing unused: {}", r);
-            r.cleanup();
+            this.cleanup(r);
         }
     }
 
@@ -198,7 +204,7 @@ public class EntityResourceList implemen
         for(final RegisteredResource r : toDelete) {
             changed = true;
             resources.remove(r);
-            r.cleanup();
+            this.cleanup(r);
             LOGGER.debug("Removing uninstalled from list: {}", r);
         }
         return changed;

Modified: sling/trunk/installer/core/src/main/java/org/apache/sling/installer/core/impl/RegisteredResource.java
URL: http://svn.apache.org/viewvc/sling/trunk/installer/core/src/main/java/org/apache/sling/installer/core/impl/RegisteredResource.java?rev=1055855&r1=1055854&r2=1055855&view=diff
==============================================================================
--- sling/trunk/installer/core/src/main/java/org/apache/sling/installer/core/impl/RegisteredResource.java
(original)
+++ sling/trunk/installer/core/src/main/java/org/apache/sling/installer/core/impl/RegisteredResource.java
Thu Jan  6 12:46:09 2011
@@ -41,6 +41,7 @@ public interface RegisteredResource exte
         IGNORED
     }
 
+    /** Return the scheme from where the artifact is orginated. */
     String getScheme();
 
     /**
@@ -87,7 +88,6 @@ public interface RegisteredResource exte
      * (bundle, config, etc.)
      */
     int getPriority();
-    void cleanup();
 
 	/** Attributes include the bundle symbolic name, bundle version, etc. */
 	Map<String, Object> getAttributes();

Modified: sling/trunk/installer/core/src/main/java/org/apache/sling/installer/core/impl/RegisteredResourceImpl.java
URL: http://svn.apache.org/viewvc/sling/trunk/installer/core/src/main/java/org/apache/sling/installer/core/impl/RegisteredResourceImpl.java?rev=1055855&r1=1055854&r2=1055855&view=diff
==============================================================================
--- sling/trunk/installer/core/src/main/java/org/apache/sling/installer/core/impl/RegisteredResourceImpl.java
(original)
+++ sling/trunk/installer/core/src/main/java/org/apache/sling/installer/core/impl/RegisteredResourceImpl.java
Thu Jan  6 12:46:09 2011
@@ -267,7 +267,7 @@ public class RegisteredResourceImpl
 	}
 
 	/**
-	 * @see org.apache.sling.installer.core.impl.RegisteredResource#cleanup()
+	 * Clean up used data files.
 	 */
 	public void cleanup() {
 	    if ( this.dataFile != null && this.dataFile.exists() ) {



Mime
View raw message