You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sling.apache.org by pa...@apache.org on 2018/05/08 14:05:05 UTC
[sling-org-apache-sling-feature-launcher] branch master updated:
Don't refresh for fragment attach.
This is an automated email from the ASF dual-hosted git repository.
pauls pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-feature-launcher.git
The following commit(s) were added to refs/heads/master by this push:
new 4648f5d Don't refresh for fragment attach.
4648f5d is described below
commit 4648f5d5787d1f92fe2850b99b37f790a9b87019
Author: Karl Pauls <ka...@gmail.com>
AuthorDate: Tue May 8 16:04:52 2018 +0200
Don't refresh for fragment attach.
---
.../launcher/impl/launchers/AbstractRunner.java | 21 ++++-----------------
1 file changed, 4 insertions(+), 17 deletions(-)
diff --git a/src/main/java/org/apache/sling/feature/launcher/impl/launchers/AbstractRunner.java b/src/main/java/org/apache/sling/feature/launcher/impl/launchers/AbstractRunner.java
index 0be1804..4a3976b 100644
--- a/src/main/java/org/apache/sling/feature/launcher/impl/launchers/AbstractRunner.java
+++ b/src/main/java/org/apache/sling/feature/launcher/impl/launchers/AbstractRunner.java
@@ -24,7 +24,6 @@ import org.osgi.framework.Constants;
import org.osgi.framework.ServiceReference;
import org.osgi.framework.launch.Framework;
import org.osgi.framework.startlevel.BundleStartLevel;
-import org.osgi.framework.wiring.FrameworkWiring;
import org.osgi.util.tracker.ServiceTracker;
import org.osgi.util.tracker.ServiceTrackerCustomizer;
@@ -191,25 +190,13 @@ public class AbstractRunner {
// use reference protocol. This avoids copying the binary to the cache directory
// of the framework
final Bundle bundle = bc.installBundle("reference:" + file.toURI().toURL(), null);
- if ( startLevel > 0 ) {
- bundle.adapt(BundleStartLevel.class).setStartLevel(startLevel);
- }
// fragment?
- if ( !isSystemBundleFragment(bundle) ) {
- final String fragmentHostHeader = getFragmentHostHeader(bundle);
- if (fragmentHostHeader != null) {
- for (final Bundle b : bc.getBundles()) {
- if (fragmentHostHeader.equals(b.getSymbolicName())) {
- final FrameworkWiring fw = framework.adapt(FrameworkWiring.class);
- fw.refreshBundles(Collections.singleton(b));
- break;
- }
- }
-
- } else {
- bundle.start();
+ if ( !isSystemBundleFragment(bundle) && getFragmentHostHeader(bundle) == null ) {
+ if ( startLevel > 0 ) {
+ bundle.adapt(BundleStartLevel.class).setStartLevel(startLevel);
}
+ bundle.start();
}
}
}
--
To stop receiving notification emails like this one, please contact
pauls@apache.org.