Skip to content

Commit

Permalink
[CAMEL-13147] Upgrade to OSGi r6
Browse files Browse the repository at this point in the history
  • Loading branch information
gnodet committed Jan 30, 2019
1 parent 819d657 commit 2405ab0
Show file tree
Hide file tree
Showing 31 changed files with 56 additions and 1,087 deletions.
2 changes: 1 addition & 1 deletion camel-base/pom.xml
Expand Up @@ -132,7 +132,7 @@
<!-- osgi support -->
<dependency>
<groupId>org.osgi</groupId>
<artifactId>org.osgi.core</artifactId>
<artifactId>osgi.core</artifactId>
<scope>provided</scope>
<optional>true</optional>
</dependency>
Expand Down
8 changes: 7 additions & 1 deletion camel-core/pom.xml
Expand Up @@ -248,7 +248,13 @@
<!-- osgi support -->
<dependency>
<groupId>org.osgi</groupId>
<artifactId>org.osgi.core</artifactId>
<artifactId>osgi.core</artifactId>
<scope>provided</scope>
<optional>true</optional>
</dependency>
<dependency>
<groupId>org.osgi</groupId>
<artifactId>osgi.cmpn</artifactId>
<scope>provided</scope>
<optional>true</optional>
</dependency>
Expand Down
Expand Up @@ -42,8 +42,6 @@
import org.apache.camel.TypeConverter;
import org.apache.camel.TypeConverterLoaderException;
import org.apache.camel.impl.converter.AnnotationTypeConverterLoader;
import org.apache.camel.impl.osgi.tracker.BundleTracker;
import org.apache.camel.impl.osgi.tracker.BundleTrackerCustomizer;
import org.apache.camel.impl.scan.AnnotatedWithPackageScanFilter;
import org.apache.camel.model.DataFormatDefinition;
import org.apache.camel.spi.ComponentResolver;
Expand All @@ -67,12 +65,14 @@
import org.osgi.framework.wiring.BundleCapability;
import org.osgi.framework.wiring.BundleWire;
import org.osgi.framework.wiring.BundleWiring;
import org.osgi.util.tracker.BundleTracker;
import org.osgi.util.tracker.BundleTrackerCustomizer;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import static org.osgi.framework.wiring.BundleRevision.PACKAGE_NAMESPACE;

public class Activator implements BundleActivator, BundleTrackerCustomizer {
public class Activator implements BundleActivator, BundleTrackerCustomizer<Object> {

public static final String META_INF_COMPONENT = "META-INF/services/org/apache/camel/component/";
public static final String META_INF_LANGUAGE = "META-INF/services/org/apache/camel/language/";
Expand All @@ -85,7 +85,7 @@ public class Activator implements BundleActivator, BundleTrackerCustomizer {

private static final Logger LOG = LoggerFactory.getLogger(Activator.class);

private BundleTracker tracker;
private BundleTracker<?> tracker;
private final Map<Long, List<BaseService>> resolvers = new ConcurrentHashMap<>();
private long bundleId;

Expand All @@ -97,7 +97,7 @@ public void start(BundleContext context) throws Exception {
cachePackageCapabilities(context);
bundleId = context.getBundle().getBundleId();
BundleContext systemBundleContext = context.getBundle(0).getBundleContext();
tracker = new BundleTracker(systemBundleContext, Bundle.ACTIVE, this);
tracker = new BundleTracker<>(systemBundleContext, Bundle.ACTIVE, this);
tracker.open();
LOG.info("Camel activator started");
}
Expand Down

0 comments on commit 2405ab0

Please sign in to comment.