Author: rwesten
Date: Mon Jul 18 21:05:53 2011
New Revision: 1148051

URL: http://svn.apache.org/viewvc?rev=1148051&view=rev
Log:
STANBOL-140: Resolves this issue by adding support for uninstalling Resources 
installed from a Bundle. For this to work I had to upgrade to a newer version 
of the Sling Installer framework.
In addition I removed the UnsupportedOperationException thrown by the 
IndexRemoveTask to avoid repeating tries to uninstall SolrIndexes until 
STANBOL-287 is implemented.

Modified:
    
incubator/stanbol/trunk/commons/installer/bundleprovider/src/main/java/org/apache/stanbol/commons/installer/provider/bundle/impl/BundleInstaller.java
    
incubator/stanbol/trunk/commons/solr/src/main/java/org/apache/stanbol/commons/solr/impl/install/IndexRemoveTask.java
    
incubator/stanbol/trunk/integration-tests/src/test/java/org/apache/stanbol/enhancer/it/DefaultConfigTest.java
    incubator/stanbol/trunk/launchers/full/src/main/bundles/list.xml
    incubator/stanbol/trunk/launchers/kres/src/main/bundles/list.xml
    incubator/stanbol/trunk/launchers/stable/src/main/bundles/list.xml
    incubator/stanbol/trunk/launchers/stateless/src/main/bundles/list.xml
    incubator/stanbol/trunk/parent/pom.xml

Modified: 
incubator/stanbol/trunk/commons/installer/bundleprovider/src/main/java/org/apache/stanbol/commons/installer/provider/bundle/impl/BundleInstaller.java
URL: 
http://svn.apache.org/viewvc/incubator/stanbol/trunk/commons/installer/bundleprovider/src/main/java/org/apache/stanbol/commons/installer/provider/bundle/impl/BundleInstaller.java?rev=1148051&r1=1148050&r2=1148051&view=diff
==============================================================================
--- 
incubator/stanbol/trunk/commons/installer/bundleprovider/src/main/java/org/apache/stanbol/commons/installer/provider/bundle/impl/BundleInstaller.java
 (original)
+++ 
incubator/stanbol/trunk/commons/installer/bundleprovider/src/main/java/org/apache/stanbol/commons/installer/provider/bundle/impl/BundleInstaller.java
 Mon Jul 18 21:05:53 2011
@@ -243,10 +243,7 @@ public class BundleInstaller implements 
             }
             path = activated.remove(bundle);
         }
-        //TODO: This code does not yet work correctly if the bundle is 
restarted
-        //      and the resources need to be readded. Therefore uninstalling is
-        //      currently deactivated
-/*        if (path != null) {
+        if (path != null) {
             log.info(" ... remove configurations within path " + path);
             ArrayList<String> removedResources = new ArrayList<String>();
             for (Enumeration<URL> resources = (Enumeration<URL>) 
bundle.findEntries(path, null, true); resources.hasMoreElements();) {
@@ -259,7 +256,7 @@ public class BundleInstaller implements 
             installer.updateResources(PROVIDER_SCHEME, null, 
removedResources.toArray(new String[removedResources.size()]));
         } else {
             log.info("  ... no Configuration to process");
-        }    */
+        }
     }
 
     /**

Modified: 
incubator/stanbol/trunk/commons/solr/src/main/java/org/apache/stanbol/commons/solr/impl/install/IndexRemoveTask.java
URL: 
http://svn.apache.org/viewvc/incubator/stanbol/trunk/commons/solr/src/main/java/org/apache/stanbol/commons/solr/impl/install/IndexRemoveTask.java?rev=1148051&r1=1148050&r2=1148051&view=diff
==============================================================================
--- 
incubator/stanbol/trunk/commons/solr/src/main/java/org/apache/stanbol/commons/solr/impl/install/IndexRemoveTask.java
 (original)
+++ 
incubator/stanbol/trunk/commons/solr/src/main/java/org/apache/stanbol/commons/solr/impl/install/IndexRemoveTask.java
 Mon Jul 18 21:05:53 2011
@@ -18,10 +18,13 @@ package org.apache.stanbol.commons.solr.
 
 import org.apache.sling.installer.api.tasks.InstallTask;
 import org.apache.sling.installer.api.tasks.InstallationContext;
+import org.apache.sling.installer.api.tasks.ResourceState;
 import org.apache.sling.installer.api.tasks.TaskResourceGroup;
 import org.apache.solr.client.solrj.embedded.EmbeddedSolrServer;
 import org.apache.solr.core.CoreContainer;
 import org.apache.stanbol.commons.solr.SolrDirectoryManager;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 /**
  * TODO: To remove a SolrIndex one would need first to close the SolrCore or 
shutdown the SolrContainer. This
@@ -39,6 +42,8 @@ import org.apache.stanbol.commons.solr.S
  * 
  */
 public class IndexRemoveTask extends InstallTask {
+    
+    private static final Logger log = 
LoggerFactory.getLogger(IndexRemoveTask.class);
     /**
      * Use 11 because the RemoveConfiguration uses 10 and we need to ensure 
that the files are removed after
      * the services are shut down.
@@ -51,7 +56,8 @@ public class IndexRemoveTask extends Ins
 
     @Override
     public void execute(InstallationContext ctx) {
-        throw new UnsupportedOperationException("TODO: Not yet implemented 
:(");
+        log.warn("Uninstalling of SolrIndexes not yet Implemented -> marking 
as uninstalled (see STANBOL-287)");
+        setFinishedState(ResourceState.UNINSTALLED);
     }
 
     @Override

Modified: 
incubator/stanbol/trunk/integration-tests/src/test/java/org/apache/stanbol/enhancer/it/DefaultConfigTest.java
URL: 
http://svn.apache.org/viewvc/incubator/stanbol/trunk/integration-tests/src/test/java/org/apache/stanbol/enhancer/it/DefaultConfigTest.java?rev=1148051&r1=1148050&r2=1148051&view=diff
==============================================================================
--- 
incubator/stanbol/trunk/integration-tests/src/test/java/org/apache/stanbol/enhancer/it/DefaultConfigTest.java
 (original)
+++ 
incubator/stanbol/trunk/integration-tests/src/test/java/org/apache/stanbol/enhancer/it/DefaultConfigTest.java
 Mon Jul 18 21:05:53 2011
@@ -36,7 +36,7 @@ public class DefaultConfigTest extends E
                 "PID.*org.apache.stanbol.examples.ExampleBootstrapConfig",
                 "anotherValue.*This is AnotherValue.",
                 "message.*This test config should be loaded at startup",
-                
"org.apache.sling.installer.osgi.path.*launchpad:resources/config/org.apache.stanbol.examples.ExampleBootstrapConfig.cfg"
+                
"org.apache.stanbol.examples.ExampleBootstrapConfig.*launchpad:resources/config/org.apache.stanbol.examples.ExampleBootstrapConfig.cfg"
         );
     }
 }

Modified: incubator/stanbol/trunk/launchers/full/src/main/bundles/list.xml
URL: 
http://svn.apache.org/viewvc/incubator/stanbol/trunk/launchers/full/src/main/bundles/list.xml?rev=1148051&r1=1148050&r2=1148051&view=diff
==============================================================================
--- incubator/stanbol/trunk/launchers/full/src/main/bundles/list.xml (original)
+++ incubator/stanbol/trunk/launchers/full/src/main/bundles/list.xml Mon Jul 18 
21:05:53 2011
@@ -76,7 +76,12 @@
     <bundle>
       <groupId>org.apache.sling</groupId>
       <artifactId>org.apache.sling.installer.core</artifactId>
-      <version>3.1.2</version>
+      <version>3.2.0</version>
+    </bundle>
+    <bundle>
+      <groupId>org.apache.sling</groupId>
+      <artifactId>org.apache.sling.installer.factory.configuration</artifactId>
+      <version>1.0.0</version>
     </bundle>
     <bundle>
       <groupId>org.apache.stanbol</groupId>

Modified: incubator/stanbol/trunk/launchers/kres/src/main/bundles/list.xml
URL: 
http://svn.apache.org/viewvc/incubator/stanbol/trunk/launchers/kres/src/main/bundles/list.xml?rev=1148051&r1=1148050&r2=1148051&view=diff
==============================================================================
--- incubator/stanbol/trunk/launchers/kres/src/main/bundles/list.xml (original)
+++ incubator/stanbol/trunk/launchers/kres/src/main/bundles/list.xml Mon Jul 18 
21:05:53 2011
@@ -69,16 +69,16 @@
     
     <!-- Sling installer and Stanbol extensions -->
     <startLevel level="9">
-        <bundle>
-            <groupId>org.apache.sling</groupId>
-            <artifactId>org.apache.sling.installer.core</artifactId>
-            <version>3.1.2</version>
-        </bundle>
-        <bundle>
-            <groupId>org.apache.stanbol</groupId>
-            
<artifactId>org.apache.stanbol.commons.installer.bundleprovider</artifactId>
-            <version>0.9-SNAPSHOT</version>
-        </bundle>
+                   <bundle>
+                     <groupId>org.apache.sling</groupId>
+                     <artifactId>org.apache.sling.installer.core</artifactId>
+                     <version>3.2.0</version>
+                   </bundle>
+                   <bundle>
+                     <groupId>org.apache.sling</groupId>
+                     
<artifactId>org.apache.sling.installer.factory.configuration</artifactId>
+                     <version>1.0.0</version>
+                   </bundle>
 <!--           <bundle>
                    <groupId>org.apache.sling</groupId>
                    
<artifactId>org.apache.sling.installer.provider.file</artifactId>

Modified: incubator/stanbol/trunk/launchers/stable/src/main/bundles/list.xml
URL: 
http://svn.apache.org/viewvc/incubator/stanbol/trunk/launchers/stable/src/main/bundles/list.xml?rev=1148051&r1=1148050&r2=1148051&view=diff
==============================================================================
--- incubator/stanbol/trunk/launchers/stable/src/main/bundles/list.xml 
(original)
+++ incubator/stanbol/trunk/launchers/stable/src/main/bundles/list.xml Mon Jul 
18 21:05:53 2011
@@ -76,7 +76,12 @@
     <bundle>
       <groupId>org.apache.sling</groupId>
       <artifactId>org.apache.sling.installer.core</artifactId>
-      <version>3.1.2</version>
+      <version>3.2.0</version>
+    </bundle>
+    <bundle>
+      <groupId>org.apache.sling</groupId>
+      <artifactId>org.apache.sling.installer.factory.configuration</artifactId>
+      <version>1.0.0</version>
     </bundle>
     <bundle>
       <groupId>org.apache.stanbol</groupId>

Modified: incubator/stanbol/trunk/launchers/stateless/src/main/bundles/list.xml
URL: 
http://svn.apache.org/viewvc/incubator/stanbol/trunk/launchers/stateless/src/main/bundles/list.xml?rev=1148051&r1=1148050&r2=1148051&view=diff
==============================================================================
--- incubator/stanbol/trunk/launchers/stateless/src/main/bundles/list.xml 
(original)
+++ incubator/stanbol/trunk/launchers/stateless/src/main/bundles/list.xml Mon 
Jul 18 21:05:53 2011
@@ -76,7 +76,12 @@
     <bundle>
       <groupId>org.apache.sling</groupId>
       <artifactId>org.apache.sling.installer.core</artifactId>
-      <version>3.1.2</version>
+      <version>3.2.0</version>
+    </bundle>
+    <bundle>
+      <groupId>org.apache.sling</groupId>
+      <artifactId>org.apache.sling.installer.factory.configuration</artifactId>
+      <version>1.0.0</version>
     </bundle>
     <bundle>
       <groupId>org.apache.stanbol</groupId>

Modified: incubator/stanbol/trunk/parent/pom.xml
URL: 
http://svn.apache.org/viewvc/incubator/stanbol/trunk/parent/pom.xml?rev=1148051&r1=1148050&r2=1148051&view=diff
==============================================================================
--- incubator/stanbol/trunk/parent/pom.xml (original)
+++ incubator/stanbol/trunk/parent/pom.xml Mon Jul 18 21:05:53 2011
@@ -1199,9 +1199,8 @@
       <dependency>
         <groupId>org.apache.sling</groupId>
         <artifactId>org.apache.sling.installer.core</artifactId>
-        <version>3.1.2</version>
+        <version>3.2.0</version>
       </dependency>
-
       <!-- Testing Deps -->
       <dependency>
         <groupId>org.slf4j</groupId>


Reply via email to