Skip to content

Commit ae5ac96

Browse files
authored
[OSGi] Don't start fragment bundles (#345)
Allow registration of fragment bundles without requiring they be started
1 parent 0c3bae2 commit ae5ac96

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

sensorhub-core-osgi/src/main/java/org/sensorhub/impl/osgi/SensorHubOsgi.java

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,9 @@ public boolean accept(File dir, String name) {
129129
for (var f: bundleJarFiles) {
130130
LOGGER.info("Installing bundle " + f);
131131
var bundle = systemCtx.installBundle(REF_PREFIX + f.toPath().toString());
132-
bundle.start();
132+
if (bundle.getHeaders().get("Fragment-Host") == null) {
133+
bundle.start();
134+
}
133135
}
134136

135137
// start all installed bundles
@@ -144,7 +146,9 @@ public boolean accept(File dir, String name) {
144146
try
145147
{
146148
var bundle = systemCtx.installBundle(REF_PREFIX + path.toString());
147-
bundle.start();
149+
if (bundle.getHeaders().get("Fragment-Host") == null) {
150+
bundle.start();
151+
}
148152
}
149153
catch (BundleException e)
150154
{

0 commit comments

Comments
 (0)