Author: rwesten
Date: Wed Jan 18 18:02:39 2012
New Revision: 1232976
URL: http://svn.apache.org/viewvc?rev=1232976&view=rev
Log:
This fixes STANBOL-464. Resources are now uninstalled if Bundles are
UNINSTALLED instead of STOPPED
Modified:
incubator/stanbol/trunk/commons/installer/bundleprovider/README.md
incubator/stanbol/trunk/commons/installer/bundleprovider/src/main/java/org/apache/stanbol/commons/installer/provider/bundle/impl/BundleInstaller.java
Modified: incubator/stanbol/trunk/commons/installer/bundleprovider/README.md
URL:
http://svn.apache.org/viewvc/incubator/stanbol/trunk/commons/installer/bundleprovider/README.md?rev=1232976&r1=1232975&r2=1232976&view=diff
==============================================================================
--- incubator/stanbol/trunk/commons/installer/bundleprovider/README.md
(original)
+++ incubator/stanbol/trunk/commons/installer/bundleprovider/README.md Wed Jan
18 18:02:39 2012
@@ -1,17 +1,19 @@
-Licensed to the Apache Software Foundation (ASF) under one or more
-contributor license agreements. See the NOTICE file distributed with
-this work for additional information regarding copyright ownership.
-The ASF licenses this file to You under the Apache License, Version 2.0
-(the "License"); you may not use this file except in compliance with
-the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing, software
-distributed under the License is distributed on an "AS IS" BASIS,
-WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-See the License for the specific language governing permissions and
-limitations under the License.
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
OSGI Bundle Provider
--------------------
@@ -40,9 +42,10 @@ sub-directories will be installed.
If a Bundle defining this key is
* STARTED: all installable resources will be installed
-* STOPED: all installable resource will be uninstalled
+* UNINSTALL: all installable resource will be uninstalled
* UPDATED: all installable resources will be first uninstalled and than
installed
+_NOTE:_ Precious versions uninstalled resources if a Bundle was STOPPED. See
[STANBOL-464](https://issues.apache.org/jira/browse/STANBOL-464) for more
information regarding the change to use UNINSTALL instead.
### Defining Manifest keys with Maven
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=1232976&r1=1232975&r2=1232976&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
Wed Jan 18 18:02:39 2012
@@ -36,6 +36,7 @@ import org.osgi.framework.Bundle;
import org.osgi.framework.BundleContext;
import org.osgi.framework.BundleEvent;
import org.osgi.framework.BundleListener;
+import org.osgi.framework.FrameworkEvent;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -135,8 +136,9 @@ public class BundleInstaller implements
case BundleEvent.STARTED:
register(event.getBundle());
break;
-
- case BundleEvent.STOPPED:
+ //use uninstalled instead of stopped so that unregister is not
called
+ //when the OSGI environment closes
+ case BundleEvent.UNINSTALLED://STOPPED:
unregister(event.getBundle());
break;