You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by gn...@apache.org on 2019/01/30 21:54:23 UTC
[camel] branch master updated: [CAMEL-13147] Upgrade to OSGi r6
This is an automated email from the ASF dual-hosted git repository.
gnodet pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/camel.git
The following commit(s) were added to refs/heads/master by this push:
new 2405ab0 [CAMEL-13147] Upgrade to OSGi r6
2405ab0 is described below
commit 2405ab0842483c68bf30bae7cd80e3c47728268d
Author: Guillaume Nodet <gn...@gmail.com>
AuthorDate: Wed Jan 30 22:38:49 2019 +0100
[CAMEL-13147] Upgrade to OSGi r6
---
camel-base/pom.xml | 2 +-
camel-core/pom.xml | 8 +-
.../java/org/apache/camel/impl/osgi/Activator.java | 10 +-
.../camel/impl/osgi/tracker/AbstractTracked.java | 438 --------------------
.../camel/impl/osgi/tracker/BundleTracker.java | 457 ---------------------
.../impl/osgi/tracker/BundleTrackerCustomizer.java | 115 ------
.../apache/camel/impl/osgi/tracker/package.html | 27 --
components/camel-blueprint/pom.xml | 4 +-
components/camel-cdi/pom.xml | 2 +-
components/camel-cmis/pom.xml | 2 +-
components/camel-corda/pom.xml | 2 +-
components/camel-core-osgi/pom.xml | 4 +-
components/camel-cxf-transport/pom.xml | 4 +-
components/camel-cxf/pom.xml | 4 +-
components/camel-eventadmin/pom.xml | 4 +-
components/camel-hdfs2/pom.xml | 2 +-
components/camel-jcache/pom.xml | 2 +-
components/camel-paxlogging/pom.xml | 2 +-
components/camel-script/pom.xml | 2 +-
.../org/apache/camel/script/osgi/Activator.java | 4 +-
components/camel-servlet/pom.xml | 2 +-
components/camel-test-blueprint/pom.xml | 12 +-
components/camel-test-karaf/pom.xml | 4 +-
components/camel-zookeeper-master/pom.xml | 4 +-
examples/camel-example-fhir-osgi/pom.xml | 4 +-
parent/pom.xml | 6 +-
platforms/karaf/commands/pom.xml | 2 +-
platforms/karaf/features/pom.xml | 2 +-
tests/camel-blueprint-cxf-test/pom.xml | 4 +-
tests/camel-itest-karaf/pom.xml | 4 +-
tests/camel-performance/pom.xml | 4 +-
31 files changed, 56 insertions(+), 1087 deletions(-)
diff --git a/camel-base/pom.xml b/camel-base/pom.xml
index 23e484d..b1f2aa4 100644
--- a/camel-base/pom.xml
+++ b/camel-base/pom.xml
@@ -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>
diff --git a/camel-core/pom.xml b/camel-core/pom.xml
index 873a048..1ed38f4 100644
--- a/camel-core/pom.xml
+++ b/camel-core/pom.xml
@@ -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>
diff --git a/camel-core/src/main/java/org/apache/camel/impl/osgi/Activator.java b/camel-core/src/main/java/org/apache/camel/impl/osgi/Activator.java
index 296b78e..27b0f45 100644
--- a/camel-core/src/main/java/org/apache/camel/impl/osgi/Activator.java
+++ b/camel-core/src/main/java/org/apache/camel/impl/osgi/Activator.java
@@ -42,8 +42,6 @@ import org.apache.camel.Converter;
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;
@@ -67,12 +65,14 @@ import org.osgi.framework.ServiceRegistration;
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/";
@@ -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;
@@ -97,7 +97,7 @@ public class Activator implements BundleActivator, BundleTrackerCustomizer {
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");
}
diff --git a/camel-core/src/main/java/org/apache/camel/impl/osgi/tracker/AbstractTracked.java b/camel-core/src/main/java/org/apache/camel/impl/osgi/tracker/AbstractTracked.java
deleted file mode 100644
index f58a91f..0000000
--- a/camel-core/src/main/java/org/apache/camel/impl/osgi/tracker/AbstractTracked.java
+++ /dev/null
@@ -1,438 +0,0 @@
-/**
- * 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.
- */
-
-/*
- * Copyright (c) OSGi Alliance (2007, 2008). All Rights Reserved.
- *
- * Licensed 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.
- */
-
-package org.apache.camel.impl.osgi.tracker;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.LinkedList;
-import java.util.List;
-import java.util.Map;
-
-/**
- * Abstract class to track items. If a Tracker is reused (closed then reopened),
- * then a new AbstractTracked object is used. This class acts a map of tracked
- * item -> customized object. Subclasses of this class will act as the listener
- * object for the tracker. This class is used to synchronize access to the
- * tracked items. This is not a public class. It is only for use by the
- * implementation of the Tracker class.
- *
- * @ThreadSafe
- * @since 1.4
- */
-abstract class AbstractTracked {
- /* set this to true to compile in debug messages */
- static final boolean DEBUG = false;
-
- /**
- * true if the tracked object is closed. This field is volatile because it
- * is set by one thread and read by another.
- */
- volatile boolean closed;
-
- /**
- * Map of tracked items to customized objects.
- *
- * @GuardedBy this
- */
- private final Map<Object, Object> tracked;
-
- /**
- * Modification count. This field is initialized to zero and incremented by
- * modified.
- *
- * @GuardedBy this
- */
- private int trackingCount;
-
- /**
- * List of items in the process of being added. This is used to deal with
- * nesting of events. Since events may be synchronously delivered, events
- * can be nested. For example, when processing the adding of a service and
- * the customizer causes the service to be unregistered, notification to the
- * nested call to untrack that the service was unregistered can be made to
- * the track method. Since the ArrayList implementation is not synchronized,
- * all access to this list must be protected by the same synchronized object
- * for thread-safety.
- *
- * @GuardedBy this
- */
- private final List<Object> adding;
-
- /**
- * Initial list of items for the tracker. This is used to correctly process
- * the initial items which could be modified before they are tracked. This
- * is necessary since the initial set of tracked items are not "announced"
- * by events and therefore the event which makes the item untracked could be
- * delivered before we track the item. An item must not be in both the
- * initial and adding lists at the same time. An item must be moved from the
- * initial list to the adding list "atomically" before we begin tracking it.
- * Since the LinkedList implementation is not synchronized, all access to
- * this list must be protected by the same synchronized object for
- * thread-safety.
- *
- * @GuardedBy this
- */
- private final LinkedList<Object> initial;
-
- /**
- * AbstractTracked constructor.
- */
- AbstractTracked() {
- tracked = new HashMap<>();
- trackingCount = 0;
- adding = new ArrayList<>(6);
- initial = new LinkedList<>();
- closed = false;
- }
-
- /**
- * Set initial list of items into tracker before events begin to be
- * received. This method must be called from Tracker's open method while
- * synchronized on this object in the same synchronized block as the add
- * listener call.
- *
- * @param list The initial list of items to be tracked. <code>null</code>
- * entries in the list are ignored.
- * @GuardedBy this
- */
- void setInitial(Object[] list) {
- if (list == null) {
- return;
- }
- int size = list.length;
- for (int i = 0; i < size; i++) {
- Object item = list[i];
- if (item == null) {
- continue;
- }
- if (DEBUG) {
- System.out.println("AbstractTracked.setInitial: " + item);
- }
- initial.add(item);
- }
- }
-
- /**
- * Track the initial list of items. This is called after events can begin to
- * be received. This method must be called from Tracker's open method while
- * not synchronized on this object after the add listener call.
- */
- void trackInitial() {
- while (true) {
- Object item;
- synchronized (this) {
- if (closed || (initial.size() == 0)) {
- /*
- * if there are no more initial items
- */
- return; /* we are done */
- }
- /*
- * move the first item from the initial list to the adding list
- * within this synchronized block.
- */
- item = initial.removeFirst();
- if (tracked.get(item) != null) {
- /* if we are already tracking this item */
- if (DEBUG) {
- System.out.println("AbstractTracked.trackInitial[already tracked]: " + item);
- }
- continue; /* skip this item */
- }
- if (adding.contains(item)) {
- /*
- * if this item is already in the process of being added.
- */
- if (DEBUG) {
- System.out.println("AbstractTracked.trackInitial[already adding]: " + item);
- }
- continue; /* skip this item */
- }
- adding.add(item);
- }
- if (DEBUG) {
- System.out.println("AbstractTracked.trackInitial: " + item);
- }
- trackAdding(item, null); /*
- * Begin tracking it. We call trackAdding
- * since we have already put the item in
- * the adding list.
- */
- }
- }
-
- /**
- * Called by the owning Tracker object when it is closed.
- */
- void close() {
- closed = true;
- }
-
- /**
- * Begin to track an item.
- *
- * @param item Item to be tracked.
- * @param related Action related object.
- */
- void track(final Object item, final Object related) {
- final Object object;
- synchronized (this) {
- if (closed) {
- return;
- }
- object = tracked.get(item);
- if (object == null) { /* we are not tracking the item */
- if (adding.contains(item)) {
- /* if this item is already in the process of being added. */
- if (DEBUG) {
- System.out.println("AbstractTracked.track[already adding]: " + item);
- }
- return;
- }
- adding.add(item); /* mark this item is being added */
- } else { /* we are currently tracking this item */
- if (DEBUG) {
- System.out.println("AbstractTracked.track[modified]: " + item);
- }
- modified(); /* increment modification count */
- }
- }
-
- if (object == null) { /* we are not tracking the item */
- trackAdding(item, related);
- } else {
- /* Call customizer outside of synchronized region */
- customizerModified(item, related, object);
- /*
- * If the customizer throws an unchecked exception, it is safe to
- * let it propagate
- */
- }
- }
-
- /**
- * Common logic to add an item to the tracker used by track and
- * trackInitial. The specified item must have been placed in the adding list
- * before calling this method.
- *
- * @param item Item to be tracked.
- * @param related Action related object.
- */
- private void trackAdding(final Object item, final Object related) {
- if (DEBUG) {
- System.out.println("AbstractTracked.trackAdding: " + item);
- }
- Object object = null;
- boolean becameUntracked = false;
- /* Call customizer outside of synchronized region */
- try {
- object = customizerAdding(item, related);
- /*
- * If the customizer throws an unchecked exception, it will
- * propagate after the finally
- */
- } finally {
- synchronized (this) {
- if (adding.remove(item) && !closed) {
- /*
- * if the item was not untracked during the customizer
- * callback
- */
- if (object != null) {
- tracked.put(item, object);
- modified(); /* increment modification count */
- notifyAll(); /* notify any waiters */
- }
- } else {
- becameUntracked = true;
- }
- }
- }
- /*
- * The item became untracked during the customizer callback.
- */
- if (becameUntracked && (object != null)) {
- if (DEBUG) {
- System.out.println("AbstractTracked.trackAdding[removed]: " + item);
- }
- /* Call customizer outside of synchronized region */
- customizerRemoved(item, related, object);
- /*
- * If the customizer throws an unchecked exception, it is safe to
- * let it propagate
- */
- }
- }
-
- /**
- * Discontinue tracking the item.
- *
- * @param item Item to be untracked.
- * @param related Action related object.
- */
- void untrack(final Object item, final Object related) {
- final Object object;
- synchronized (this) {
- if (initial.remove(item)) { /*
- * if this item is already in the list
- * of initial references to process
- */
- if (DEBUG) {
- System.out.println("AbstractTracked.untrack[removed from initial]: " + item);
- }
- return; /*
- * we have removed it from the list and it will not be
- * processed
- */
- }
-
- if (adding.remove(item)) { /*
- * if the item is in the process of being
- * added
- */
- if (DEBUG) {
- System.out.println("AbstractTracked.untrack[being added]: " + item);
- }
- return; /*
- * in case the item is untracked while in the process of
- * adding
- */
- }
- object = tracked.remove(item); /*
- * must remove from tracker before
- * calling customizer callback
- */
- if (object == null) { /* are we actually tracking the item */
- return;
- }
- modified(); /* increment modification count */
- }
- if (DEBUG) {
- System.out.println("AbstractTracked.untrack[removed]: " + item);
- }
- /* Call customizer outside of synchronized region */
- customizerRemoved(item, related, object);
- /*
- * If the customizer throws an unchecked exception, it is safe to let it
- * propagate
- */
- }
-
- /**
- * Returns the number of tracked items.
- *
- * @return The number of tracked items.
- * @GuardedBy this
- */
- int size() {
- return tracked.size();
- }
-
- /**
- * Return the customized object for the specified item
- *
- * @param item The item to lookup in the map
- * @return The customized object for the specified item.
- * @GuardedBy this
- */
- Object getCustomizedObject(final Object item) {
- return tracked.get(item);
- }
-
- /**
- * Return the list of tracked items.
- *
- * @param list An array to contain the tracked items.
- * @return The specified list if it is large enough to hold the tracked
- * items or a new array large enough to hold the tracked items.
- * @GuardedBy this
- */
- Object[] getTracked(final Object[] list) {
- return tracked.keySet().toArray(list);
- }
-
- /**
- * Increment the modification count. If this method is overridden, the
- * overriding method MUST call this method to increment the tracking count.
- *
- * @GuardedBy this
- */
- void modified() {
- trackingCount++;
- }
-
- /**
- * Returns the tracking count for this <code>ServiceTracker</code> object.
- * The tracking count is initialized to 0 when this object is opened. Every
- * time an item is added, modified or removed from this object the tracking
- * count is incremented.
- *
- * @GuardedBy this
- * @return The tracking count for this object.
- */
- int getTrackingCount() {
- return trackingCount;
- }
-
- /**
- * Call the specific customizer adding method. This method must not be
- * called while synchronized on this object.
- *
- * @param item Item to be tracked.
- * @param related Action related object.
- * @return Customized object for the tracked item or <code>null</code> if
- * the item is not to be tracked.
- */
- abstract Object customizerAdding(Object item, Object related);
-
- /**
- * Call the specific customizer modified method. This method must not be
- * called while synchronized on this object.
- *
- * @param item Tracked item.
- * @param related Action related object.
- * @param object Customized object for the tracked item.
- */
- abstract void customizerModified(Object item, Object related, Object object);
-
- /**
- * Call the specific customizer removed method. This method must not be
- * called while synchronized on this object.
- *
- * @param item Tracked item.
- * @param related Action related object.
- * @param object Customized object for the tracked item.
- */
- abstract void customizerRemoved(Object item, Object related, Object object);
-}
diff --git a/camel-core/src/main/java/org/apache/camel/impl/osgi/tracker/BundleTracker.java b/camel-core/src/main/java/org/apache/camel/impl/osgi/tracker/BundleTracker.java
deleted file mode 100644
index 0637e77..0000000
--- a/camel-core/src/main/java/org/apache/camel/impl/osgi/tracker/BundleTracker.java
+++ /dev/null
@@ -1,457 +0,0 @@
-/**
- * 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.
- */
-
-/*
- * Copyright (c) OSGi Alliance (2007, 2008). All Rights Reserved.
- *
- * Licensed 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.
- */
-
-package org.apache.camel.impl.osgi.tracker;
-
-import org.osgi.framework.Bundle;
-import org.osgi.framework.BundleContext;
-import org.osgi.framework.BundleEvent;
-import org.osgi.framework.SynchronousBundleListener;
-
-/**
- * The <code>BundleTracker</code> class simplifies tracking bundles much like
- * the <code>ServiceTracker</code> simplifies tracking services.
- * <p>
- * A <code>BundleTracker</code> is constructed with state criteria and a
- * <code>BundleTrackerCustomizer</code> object. A <code>BundleTracker</code> can
- * use the <code>BundleTrackerCustomizer</code> to select which bundles are
- * tracked and to create a customized object to be tracked with the bundle. The
- * <code>BundleTracker</code> can then be opened to begin tracking all bundles
- * whose state matches the specified state criteria.
- * <p>
- * The <code>getBundles</code> method can be called to get the
- * <code>Bundle</code> objects of the bundles being tracked. The
- * <code>getObject</code> method can be called to get the customized object for
- * a tracked bundle.
- * <p>
- * The <code>BundleTracker</code> class is thread-safe. It does not call a
- * <code>BundleTrackerCustomizer</code> while holding any locks.
- * <code>BundleTrackerCustomizer</code> implementations must also be
- * thread-safe.
- *
- * @ThreadSafe
- * @since 1.4
- */
-public class BundleTracker implements BundleTrackerCustomizer {
- /* set this to true to compile in debug messages */
- static final boolean DEBUG = false;
-
- /**
- * The Bundle Context used by this <code>BundleTracker</code>.
- */
- protected final BundleContext context;
-
- /**
- * State mask for bundles being tracked. This field contains the ORed values
- * of the bundle states being tracked.
- */
- final int mask;
-
- /**
- * The <code>BundleTrackerCustomizer</code> object for this tracker.
- */
- final BundleTrackerCustomizer customizer;
-
- /**
- * Tracked bundles: <code>Bundle</code> object -> customized Object and
- * <code>BundleListener</code> object
- */
- private volatile Tracked tracked;
-
- /**
- * Create a <code>BundleTracker</code> for bundles whose state is present in
- * the specified state mask.
- * <p>
- * Bundles whose state is present on the specified state mask will be
- * tracked by this <code>BundleTracker</code>.
- *
- * @param context The <code>BundleContext</code> against which the tracking
- * is done.
- * @param stateMask The bit mask of the <code>OR</code>ing of the bundle
- * states to be tracked.
- * @param customizer The customizer object to call when bundles are added,
- * modified, or removed in this <code>BundleTracker</code>. If
- * customizer is <code>null</code>, then this
- * <code>BundleTracker</code> will be used as the
- * <code>BundleTrackerCustomizer</code> and this
- * <code>BundleTracker</code> will call the
- * <code>BundleTrackerCustomizer</code> methods on itself.
- * @see Bundle#getState()
- */
- public BundleTracker(BundleContext context, int stateMask, BundleTrackerCustomizer customizer) {
- this.context = context;
- this.mask = stateMask;
- this.customizer = (customizer == null) ? this : customizer;
- }
-
- /**
- * Accessor method for the current Tracked object. This method is only
- * intended to be used by the unsynchronized methods which do not modify the
- * tracked field.
- *
- * @return The current Tracked object.
- */
- private Tracked tracked() {
- return tracked;
- }
-
-
- /**
- * Open this <code>BundleTracker</code> and begin tracking bundles.
- * <p>
- * Bundle which match the state criteria specified when this
- * <code>BundleTracker</code> was created are now tracked by this
- * <code>BundleTracker</code>.
- *
- * @throws java.lang.IllegalStateException If the <code>BundleContext</code>
- * with which this <code>BundleTracker</code> was created is no
- * longer valid.
- * @throws java.lang.SecurityException If the caller and this class do not
- * have the appropriate
- * <code>AdminPermission[context bundle,LISTENER]</code>, and
- * the Java Runtime Environment supports permissions.
- */
- public void open() {
- final Tracked t;
- synchronized (this) {
- if (tracked != null) {
- return;
- }
- if (DEBUG) {
- System.out.println("BundleTracker.open");
- }
- t = new Tracked();
- synchronized (t) {
- context.addBundleListener(t);
- Bundle[] bundles = context.getBundles();
- if (bundles != null) {
- int length = bundles.length;
- for (int i = 0; i < length; i++) {
- int state = bundles[i].getState();
- if ((state & mask) == 0) {
- /* null out bundles whose states are not interesting */
- bundles[i] = null;
- }
- }
- /* set tracked with the initial bundles */
- t.setInitial(bundles);
- }
- }
- tracked = t;
- }
- /* Call tracked outside of synchronized region */
- t.trackInitial(); /* process the initial references */
- }
-
- /**
- * Close this <code>BundleTracker</code>.
- * <p>
- * This method should be called when this <code>BundleTracker</code> should
- * end the tracking of bundles.
- * <p>
- * This implementation calls {@link #getBundles()} to get the list of
- * tracked bundles to remove.
- */
- public void close() {
- final Bundle[] bundles;
- final Tracked outgoing;
- synchronized (this) {
- outgoing = tracked;
- if (outgoing == null) {
- return;
- }
- if (DEBUG) {
- System.out.println("BundleTracker.close");
- }
- outgoing.close();
- bundles = getBundles();
- tracked = null;
- try {
- context.removeBundleListener(outgoing);
- } catch (IllegalStateException e) {
- /* In case the context was stopped. */
- }
- }
- if (bundles != null) {
- for (Bundle bundle : bundles) {
- outgoing.untrack(bundle, null);
- }
- }
- }
-
- /**
- * Default implementation of the
- * <code>BundleTrackerCustomizer.addingBundle</code> method.
- * <p>
- * This method is only called when this <code>BundleTracker</code> has been
- * constructed with a <code>null BundleTrackerCustomizer</code> argument.
- * <p>
- * This implementation simply returns the specified <code>Bundle</code>.
- * <p>
- * This method can be overridden in a subclass to customize the object to be
- * tracked for the bundle being added.
- *
- * @param bundle The <code>Bundle</code> being added to this
- * <code>BundleTracker</code> object.
- * @param event The bundle event which caused this customizer method to be
- * called or <code>null</code> if there is no bundle event
- * associated with the call to this method.
- * @return The specified bundle.
- * @see BundleTrackerCustomizer#addingBundle(Bundle, BundleEvent)
- */
- public Object addingBundle(Bundle bundle, BundleEvent event) {
- return bundle;
- }
-
- /**
- * Default implementation of the
- * <code>BundleTrackerCustomizer.modifiedBundle</code> method.
- * <p>
- * This method is only called when this <code>BundleTracker</code> has been
- * constructed with a <code>null BundleTrackerCustomizer</code> argument.
- * <p>
- * This implementation does nothing.
- *
- * @param bundle The <code>Bundle</code> whose state has been modified.
- * @param event The bundle event which caused this customizer method to be
- * called or <code>null</code> if there is no bundle event
- * associated with the call to this method.
- * @param object The customized object for the specified Bundle.
- * @see BundleTrackerCustomizer#modifiedBundle(Bundle, BundleEvent, Object)
- */
- public void modifiedBundle(Bundle bundle, BundleEvent event, Object object) {
- /* do nothing */
- }
-
- /**
- * Default implementation of the
- * <code>BundleTrackerCustomizer.removedBundle</code> method.
- * <p>
- * This method is only called when this <code>BundleTracker</code> has been
- * constructed with a <code>null BundleTrackerCustomizer</code> argument.
- * <p>
- * This implementation does nothing.
- *
- * @param bundle The <code>Bundle</code> being removed.
- * @param event The bundle event which caused this customizer method to be
- * called or <code>null</code> if there is no bundle event
- * associated with the call to this method.
- * @param object The customized object for the specified bundle.
- * @see BundleTrackerCustomizer#removedBundle(Bundle, BundleEvent, Object)
- */
- public void removedBundle(Bundle bundle, BundleEvent event, Object object) {
- /* do nothing */
- }
-
- /**
- * Return an array of <code>Bundle</code>s for all bundles being tracked by
- * this <code>BundleTracker</code>.
- *
- * @return An array of <code>Bundle</code>s or <code>null</code> if no
- * bundles are being tracked.
- */
- public Bundle[] getBundles() {
- final Tracked t = tracked();
- if (t == null) { /* if BundleTracker is not open */
- return null;
- }
- synchronized (t) {
- int length = t.size();
- if (length == 0) {
- return null;
- }
- return (Bundle[])t.getTracked(new Bundle[length]);
- }
- }
-
- /**
- * Returns the customized object for the specified <code>Bundle</code> if
- * the specified bundle is being tracked by this <code>BundleTracker</code>.
- *
- * @param bundle The <code>Bundle</code> being tracked.
- * @return The customized object for the specified <code>Bundle</code> or
- * <code>null</code> if the specified <code>Bundle</code> is not
- * being tracked.
- */
- public Object getObject(Bundle bundle) {
- final Tracked t = tracked();
- if (t == null) { /* if BundleTracker is not open */
- return null;
- }
- synchronized (t) {
- return t.getCustomizedObject(bundle);
- }
- }
-
- /**
- * Remove a bundle from this <code>BundleTracker</code>. The specified
- * bundle will be removed from this <code>BundleTracker</code> . If the
- * specified bundle was being tracked then the
- * <code>BundleTrackerCustomizer.removedBundle</code> method will be called
- * for that bundle.
- *
- * @param bundle The <code>Bundle</code> to be removed.
- */
- public void remove(Bundle bundle) {
- final Tracked t = tracked();
- if (t == null) { /* if BundleTracker is not open */
- return;
- }
- t.untrack(bundle, null);
- }
-
- /**
- * Return the number of bundles being tracked by this
- * <code>BundleTracker</code>.
- *
- * @return The number of bundles being tracked.
- */
- public int size() {
- final Tracked t = tracked();
- if (t == null) { /* if BundleTracker is not open */
- return 0;
- }
- synchronized (t) {
- return t.size();
- }
- }
-
- /**
- * Returns the tracking count for this <code>BundleTracker</code>. The
- * tracking count is initialized to 0 when this <code>BundleTracker</code>
- * is opened. Every time a bundle is added, modified or removed from this
- * <code>BundleTracker</code> the tracking count is incremented.
- * <p>
- * The tracking count can be used to determine if this
- * <code>BundleTracker</code> has added, modified or removed a bundle by
- * comparing a tracking count value previously collected with the current
- * tracking count value. If the value has not changed, then no bundle has
- * been added, modified or removed from this <code>BundleTracker</code>
- * since the previous tracking count was collected.
- *
- * @return The tracking count for this <code>BundleTracker</code> or -1 if
- * this <code>BundleTracker</code> is not open.
- */
- public int getTrackingCount() {
- final Tracked t = tracked();
- if (t == null) { /* if BundleTracker is not open */
- return -1;
- }
- synchronized (t) {
- return t.getTrackingCount();
- }
- }
-
- /**
- * Inner class which subclasses AbstractTracked. This class is the
- * <code>SynchronousBundleListener</code> object for the tracker.
- *
- * @ThreadSafe
- * @since 1.4
- */
- class Tracked extends AbstractTracked implements SynchronousBundleListener {
-
- /**
- * <code>BundleListener</code> method for the <code>BundleTracker</code>
- * class. This method must NOT be synchronized to avoid deadlock
- * potential.
- *
- * @param event <code>BundleEvent</code> object from the framework.
- */
- public void bundleChanged(final BundleEvent event) {
- /*
- * Check if we had a delayed call (which could happen when we
- * close).
- */
- if (closed) {
- return;
- }
- final Bundle bundle = event.getBundle();
- final int state = bundle.getState();
- if (DEBUG) {
- System.out.println("BundleTracker.Tracked.bundleChanged[" + state + "]: " + bundle);
- }
-
- if ((state & mask) != 0) {
- track(bundle, event);
- /*
- * If the customizer throws an unchecked exception, it is safe
- * to let it propagate
- */
- } else {
- untrack(bundle, event);
- /*
- * If the customizer throws an unchecked exception, it is safe
- * to let it propagate
- */
- }
- }
-
- /**
- * Call the specific customizer adding method. This method must not be
- * called while synchronized on this object.
- *
- * @param item Item to be tracked.
- * @param related Action related object.
- * @return Customized object for the tracked item or <code>null</code>
- * if the item is not to be tracked.
- */
- Object customizerAdding(final Object item, final Object related) {
- return customizer.addingBundle((Bundle)item, (BundleEvent)related);
- }
-
- /**
- * Call the specific customizer modified method. This method must not be
- * called while synchronized on this object.
- *
- * @param item Tracked item.
- * @param related Action related object.
- * @param object Customized object for the tracked item.
- */
- void customizerModified(final Object item, final Object related, final Object object) {
- customizer.modifiedBundle((Bundle)item, (BundleEvent)related, object);
- }
-
- /**
- * Call the specific customizer removed method. This method must not be
- * called while synchronized on this object.
- *
- * @param item Tracked item.
- * @param related Action related object.
- * @param object Customized object for the tracked item.
- */
- void customizerRemoved(final Object item, final Object related, final Object object) {
- customizer.removedBundle((Bundle)item, (BundleEvent)related, object);
- }
- }
-}
diff --git a/camel-core/src/main/java/org/apache/camel/impl/osgi/tracker/BundleTrackerCustomizer.java b/camel-core/src/main/java/org/apache/camel/impl/osgi/tracker/BundleTrackerCustomizer.java
deleted file mode 100644
index 4221a30..0000000
--- a/camel-core/src/main/java/org/apache/camel/impl/osgi/tracker/BundleTrackerCustomizer.java
+++ /dev/null
@@ -1,115 +0,0 @@
-/**
- * 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.
- */
-
-/*
- * Copyright (c) OSGi Alliance (2007, 2008). All Rights Reserved.
- *
- * Licensed 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.
- */
-
-package org.apache.camel.impl.osgi.tracker;
-
-import org.osgi.framework.Bundle;
-import org.osgi.framework.BundleEvent;
-
-/**
- * The <code>BundleTrackerCustomizer</code> interface allows a
- * <code>BundleTracker</code> to customize the <code>Bundle</code>s that are
- * tracked. A <code>BundleTrackerCustomizer</code> is called when a bundle is
- * being added to a <code>BundleTracker</code>. The
- * <code>BundleTrackerCustomizer</code> can then return an object for the
- * tracked bundle. A <code>BundleTrackerCustomizer</code> is also called when a
- * tracked bundle is modified or has been removed from a
- * <code>BundleTracker</code>.
- *
- * <p>
- * The methods in this interface may be called as the result of a
- * <code>BundleEvent</code> being received by a <code>BundleTracker</code>.
- * Since <code>BundleEvent</code>s are received synchronously by the
- * <code>BundleTracker</code>, it is highly recommended that implementations of
- * these methods do not alter bundle states while being synchronized on any
- * object.
- *
- * <p>
- * The <code>BundleTracker</code> class is thread-safe. It does not call a
- * <code>BundleTrackerCustomizer</code> while holding any locks.
- * <code>BundleTrackerCustomizer</code> implementations must also be
- * thread-safe.
- *
- * @ThreadSafe
- * @since 1.4
- */
-public interface BundleTrackerCustomizer {
- /**
- * A bundle is being added to the <code>BundleTracker</code>.
- * <p>
- * This method is called before a bundle which matched the search parameters
- * of the <code>BundleTracker</code> is added to the
- * <code>BundleTracker</code>. This method should return the object to be
- * tracked for the specified <code>Bundle</code>. The returned object is
- * stored in the <code>BundleTracker</code> and is available from the
- * {@link BundleTracker#getObject(Bundle) getObject} method.
- *
- * @param bundle The <code>Bundle</code> being added to the
- * <code>BundleTracker</code>.
- * @param event The bundle event which caused this customizer method to be
- * called or <code>null</code> if there is no bundle event
- * associated with the call to this method.
- * @return The object to be tracked for the specified <code>Bundle</code>
- * object or <code>null</code> if the specified <code>Bundle</code>
- * object should not be tracked.
- */
- Object addingBundle(Bundle bundle, BundleEvent event);
-
- /**
- * A bundle tracked by the <code>BundleTracker</code> has been modified.
- * <p>
- * This method is called when a bundle being tracked by the
- * <code>BundleTracker</code> has had its state modified.
- *
- * @param bundle The <code>Bundle</code> whose state has been modified.
- * @param event The bundle event which caused this customizer method to be
- * called or <code>null</code> if there is no bundle event
- * associated with the call to this method.
- * @param object The tracked object for the specified bundle.
- */
- void modifiedBundle(Bundle bundle, BundleEvent event, Object object);
-
- /**
- * A bundle tracked by the <code>BundleTracker</code> has been removed.
- * <p>
- * This method is called after a bundle is no longer being tracked by the
- * <code>BundleTracker</code>.
- *
- * @param bundle The <code>Bundle</code> that has been removed.
- * @param event The bundle event which caused this customizer method to be
- * called or <code>null</code> if there is no bundle event
- * associated with the call to this method.
- * @param object The tracked object for the specified bundle.
- */
- void removedBundle(Bundle bundle, BundleEvent event, Object object);
-}
diff --git a/camel-core/src/main/java/org/apache/camel/impl/osgi/tracker/package.html b/camel-core/src/main/java/org/apache/camel/impl/osgi/tracker/package.html
deleted file mode 100644
index b880b2d..0000000
--- a/camel-core/src/main/java/org/apache/camel/impl/osgi/tracker/package.html
+++ /dev/null
@@ -1,27 +0,0 @@
-<!--
-
- 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.
-
--->
-<html>
-<head>
-</head>
-<body>
-
-Camel OSGi Bundle Tracker.
-
-</body>
-</html>
diff --git a/components/camel-blueprint/pom.xml b/components/camel-blueprint/pom.xml
index e172ae8..1df6410 100644
--- a/components/camel-blueprint/pom.xml
+++ b/components/camel-blueprint/pom.xml
@@ -74,12 +74,12 @@
</dependency>
<dependency>
<groupId>org.osgi</groupId>
- <artifactId>org.osgi.core</artifactId>
+ <artifactId>osgi.core</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.osgi</groupId>
- <artifactId>org.osgi.compendium</artifactId>
+ <artifactId>osgi.cmpn</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
diff --git a/components/camel-cdi/pom.xml b/components/camel-cdi/pom.xml
index c5b4387..55c2d22 100644
--- a/components/camel-cdi/pom.xml
+++ b/components/camel-cdi/pom.xml
@@ -108,7 +108,7 @@
<dependency>
<groupId>org.osgi</groupId>
- <artifactId>org.osgi.core</artifactId>
+ <artifactId>osgi.core</artifactId>
<version>${osgi-version}</version>
<scope>provided</scope>
<optional>true</optional>
diff --git a/components/camel-cmis/pom.xml b/components/camel-cmis/pom.xml
index 50d8b2d..7caa60d 100644
--- a/components/camel-cmis/pom.xml
+++ b/components/camel-cmis/pom.xml
@@ -52,7 +52,7 @@
<!-- osgi support -->
<dependency>
<groupId>org.osgi</groupId>
- <artifactId>org.osgi.core</artifactId>
+ <artifactId>osgi.core</artifactId>
<scope>provided</scope>
<optional>true</optional>
</dependency>
diff --git a/components/camel-corda/pom.xml b/components/camel-corda/pom.xml
index 479e4e8..8b93b46 100644
--- a/components/camel-corda/pom.xml
+++ b/components/camel-corda/pom.xml
@@ -46,7 +46,7 @@
</dependency>
<dependency>
<groupId>org.osgi</groupId>
- <artifactId>org.osgi.core</artifactId>
+ <artifactId>osgi.core</artifactId>
<scope>provided</scope>
<optional>true</optional>
</dependency>
diff --git a/components/camel-core-osgi/pom.xml b/components/camel-core-osgi/pom.xml
index 4c3d7a7..7c263e5 100644
--- a/components/camel-core-osgi/pom.xml
+++ b/components/camel-core-osgi/pom.xml
@@ -46,12 +46,12 @@
</dependency>
<dependency>
<groupId>org.osgi</groupId>
- <artifactId>org.osgi.compendium</artifactId>
+ <artifactId>osgi.cmpn</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.osgi</groupId>
- <artifactId>org.osgi.core</artifactId>
+ <artifactId>osgi.core</artifactId>
<scope>provided</scope>
</dependency>
diff --git a/components/camel-cxf-transport/pom.xml b/components/camel-cxf-transport/pom.xml
index 28aaf16..631fecf 100644
--- a/components/camel-cxf-transport/pom.xml
+++ b/components/camel-cxf-transport/pom.xml
@@ -93,12 +93,12 @@
</dependency>
<dependency>
<groupId>org.osgi</groupId>
- <artifactId>org.osgi.core</artifactId>
+ <artifactId>osgi.core</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.osgi</groupId>
- <artifactId>org.osgi.compendium</artifactId>
+ <artifactId>osgi.cmpn</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
diff --git a/components/camel-cxf/pom.xml b/components/camel-cxf/pom.xml
index 4cbbe2e..928db66 100644
--- a/components/camel-cxf/pom.xml
+++ b/components/camel-cxf/pom.xml
@@ -127,12 +127,12 @@
</dependency>
<dependency>
<groupId>org.osgi</groupId>
- <artifactId>org.osgi.core</artifactId>
+ <artifactId>osgi.core</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.osgi</groupId>
- <artifactId>org.osgi.compendium</artifactId>
+ <artifactId>osgi.cmpn</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
diff --git a/components/camel-eventadmin/pom.xml b/components/camel-eventadmin/pom.xml
index 651834a..447d488 100644
--- a/components/camel-eventadmin/pom.xml
+++ b/components/camel-eventadmin/pom.xml
@@ -44,12 +44,12 @@
<dependency>
<groupId>org.osgi</groupId>
- <artifactId>org.osgi.core</artifactId>
+ <artifactId>osgi.core</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.osgi</groupId>
- <artifactId>org.osgi.compendium</artifactId>
+ <artifactId>osgi.cmpn</artifactId>
<scope>provided</scope>
</dependency>
diff --git a/components/camel-hdfs2/pom.xml b/components/camel-hdfs2/pom.xml
index 79c73a1..a454526 100644
--- a/components/camel-hdfs2/pom.xml
+++ b/components/camel-hdfs2/pom.xml
@@ -160,7 +160,7 @@
<dependency>
<groupId>org.osgi</groupId>
- <artifactId>org.osgi.core</artifactId>
+ <artifactId>osgi.core</artifactId>
<scope>provided</scope>
<optional>true</optional>
</dependency>
diff --git a/components/camel-jcache/pom.xml b/components/camel-jcache/pom.xml
index 0b3eb2e..262d4ce 100644
--- a/components/camel-jcache/pom.xml
+++ b/components/camel-jcache/pom.xml
@@ -50,7 +50,7 @@
<!-- osgi -->
<dependency>
<groupId>org.osgi</groupId>
- <artifactId>org.osgi.core</artifactId>
+ <artifactId>osgi.core</artifactId>
<scope>provided</scope>
</dependency>
diff --git a/components/camel-paxlogging/pom.xml b/components/camel-paxlogging/pom.xml
index b875cdf..4ebec08 100644
--- a/components/camel-paxlogging/pom.xml
+++ b/components/camel-paxlogging/pom.xml
@@ -55,7 +55,7 @@
<dependency>
<groupId>org.osgi</groupId>
- <artifactId>org.osgi.core</artifactId>
+ <artifactId>osgi.core</artifactId>
<scope>provided</scope>
</dependency>
diff --git a/components/camel-script/pom.xml b/components/camel-script/pom.xml
index a5f015d..aa71d5d 100644
--- a/components/camel-script/pom.xml
+++ b/components/camel-script/pom.xml
@@ -51,7 +51,7 @@
<dependency>
<groupId>org.osgi</groupId>
- <artifactId>org.osgi.core</artifactId>
+ <artifactId>osgi.core</artifactId>
<scope>provided</scope>
<optional>true</optional>
</dependency>
diff --git a/components/camel-script/src/main/java/org/apache/camel/script/osgi/Activator.java b/components/camel-script/src/main/java/org/apache/camel/script/osgi/Activator.java
index d2b913c..1b495c4 100644
--- a/components/camel-script/src/main/java/org/apache/camel/script/osgi/Activator.java
+++ b/components/camel-script/src/main/java/org/apache/camel/script/osgi/Activator.java
@@ -35,8 +35,6 @@ import java.util.concurrent.ConcurrentHashMap;
import javax.script.ScriptEngine;
import javax.script.ScriptEngineFactory;
-import org.apache.camel.impl.osgi.tracker.BundleTracker;
-import org.apache.camel.impl.osgi.tracker.BundleTrackerCustomizer;
import org.apache.camel.spi.LanguageResolver;
import org.apache.camel.util.IOHelper;
import org.osgi.framework.Bundle;
@@ -49,6 +47,8 @@ import org.osgi.framework.ServiceListener;
import org.osgi.framework.ServiceReference;
import org.osgi.framework.ServiceRegistration;
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;
diff --git a/components/camel-servlet/pom.xml b/components/camel-servlet/pom.xml
index a0eae5f..6be603d 100644
--- a/components/camel-servlet/pom.xml
+++ b/components/camel-servlet/pom.xml
@@ -64,7 +64,7 @@
</dependency>
<dependency>
<groupId>org.osgi</groupId>
- <artifactId>org.osgi.compendium</artifactId>
+ <artifactId>osgi.cmpn</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
diff --git a/components/camel-test-blueprint/pom.xml b/components/camel-test-blueprint/pom.xml
index 45b6279..6a265db 100644
--- a/components/camel-test-blueprint/pom.xml
+++ b/components/camel-test-blueprint/pom.xml
@@ -93,11 +93,11 @@
<!-- felix-connect includes osgi.core and osgi.compendium version 5.0.0 -->
<exclusion>
<groupId>org.osgi</groupId>
- <artifactId>org.osgi.core</artifactId>
+ <artifactId>osgi.core</artifactId>
</exclusion>
<exclusion>
<groupId>org.osgi</groupId>
- <artifactId>org.osgi.compendium</artifactId>
+ <artifactId>osgi.cmpn</artifactId>
</exclusion>
</exclusions>
</dependency>
@@ -125,11 +125,11 @@
</exclusion>
<exclusion>
<groupId>org.apache.felix</groupId>
- <artifactId>org.osgi.core</artifactId>
+ <artifactId>osgi.core</artifactId>
</exclusion>
<exclusion>
<groupId>org.apache.felix</groupId>
- <artifactId>org.osgi.compendium</artifactId>
+ <artifactId>osgi.cmpn</artifactId>
</exclusion>
</exclusions>
</dependency>
@@ -146,11 +146,11 @@
</exclusion>
<exclusion>
<groupId>org.apache.felix</groupId>
- <artifactId>org.osgi.core</artifactId>
+ <artifactId>osgi.core</artifactId>
</exclusion>
<exclusion>
<groupId>org.apache.felix</groupId>
- <artifactId>org.osgi.compendium</artifactId>
+ <artifactId>osgi.cmpn</artifactId>
</exclusion>
</exclusions>
</dependency>
diff --git a/components/camel-test-karaf/pom.xml b/components/camel-test-karaf/pom.xml
index 4fcf7a4..002f9bc 100644
--- a/components/camel-test-karaf/pom.xml
+++ b/components/camel-test-karaf/pom.xml
@@ -88,11 +88,11 @@
</dependency>
<dependency>
<groupId>org.osgi</groupId>
- <artifactId>org.osgi.core</artifactId>
+ <artifactId>osgi.core</artifactId>
</dependency>
<dependency>
<groupId>org.osgi</groupId>
- <artifactId>org.osgi.compendium</artifactId>
+ <artifactId>osgi.cmpn</artifactId>
</dependency>
<dependency>
<groupId>org.apache.camel</groupId>
diff --git a/components/camel-zookeeper-master/pom.xml b/components/camel-zookeeper-master/pom.xml
index 478969a..4467a18 100644
--- a/components/camel-zookeeper-master/pom.xml
+++ b/components/camel-zookeeper-master/pom.xml
@@ -102,13 +102,13 @@
<!-- optional 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>org.osgi.compendium</artifactId>
+ <artifactId>osgi.cmpn</artifactId>
<scope>provided</scope>
<optional>true</optional>
</dependency>
diff --git a/examples/camel-example-fhir-osgi/pom.xml b/examples/camel-example-fhir-osgi/pom.xml
index 58fe10f..4015d97 100644
--- a/examples/camel-example-fhir-osgi/pom.xml
+++ b/examples/camel-example-fhir-osgi/pom.xml
@@ -70,12 +70,12 @@
<!-- OSGi API -->
<dependency>
<groupId>org.osgi</groupId>
- <artifactId>org.osgi.core</artifactId>
+ <artifactId>osgi.core</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.osgi</groupId>
- <artifactId>org.osgi.compendium</artifactId>
+ <artifactId>osgi.cmpn</artifactId>
<scope>provided</scope>
</dependency>
diff --git a/parent/pom.xml b/parent/pom.xml
index 1447cc8..984c0da 100644
--- a/parent/pom.xml
+++ b/parent/pom.xml
@@ -545,7 +545,7 @@
<oro-bundle-version>2.0.8_6</oro-bundle-version>
<os-maven-plugin-version>1.6.0</os-maven-plugin-version>
<oscache-bundle-version>2.4_5</oscache-bundle-version>
- <osgi-version>4.3.1</osgi-version>
+ <osgi-version>6.0.0</osgi-version>
<paho-version>1.2.0</paho-version>
<paranamer-bundle-version>2.8_1</paranamer-bundle-version>
<pax-cdi-version>1.0.0</pax-cdi-version>
@@ -4069,12 +4069,12 @@
<!-- optional dependencies for osgi -->
<dependency>
<groupId>org.osgi</groupId>
- <artifactId>org.osgi.core</artifactId>
+ <artifactId>osgi.core</artifactId>
<version>${osgi-version}</version>
</dependency>
<dependency>
<groupId>org.osgi</groupId>
- <artifactId>org.osgi.compendium</artifactId>
+ <artifactId>osgi.cmpn</artifactId>
<version>${osgi-version}</version>
</dependency>
diff --git a/platforms/karaf/commands/pom.xml b/platforms/karaf/commands/pom.xml
index 3de7598..6b95359 100644
--- a/platforms/karaf/commands/pom.xml
+++ b/platforms/karaf/commands/pom.xml
@@ -60,7 +60,7 @@
</dependency>
<dependency>
<groupId>org.osgi</groupId>
- <artifactId>org.osgi.core</artifactId>
+ <artifactId>osgi.core</artifactId>
<scope>provided</scope>
<optional>true</optional>
</dependency>
diff --git a/platforms/karaf/features/pom.xml b/platforms/karaf/features/pom.xml
index bd85bd5..2646e10 100644
--- a/platforms/karaf/features/pom.xml
+++ b/platforms/karaf/features/pom.xml
@@ -41,7 +41,7 @@
<dependencies>
<dependency>
<groupId>org.osgi</groupId>
- <artifactId>org.osgi.core</artifactId>
+ <artifactId>osgi.core</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
diff --git a/tests/camel-blueprint-cxf-test/pom.xml b/tests/camel-blueprint-cxf-test/pom.xml
index f205c05..baceb81 100644
--- a/tests/camel-blueprint-cxf-test/pom.xml
+++ b/tests/camel-blueprint-cxf-test/pom.xml
@@ -163,12 +163,12 @@
<!-- osgi -->
<dependency>
<groupId>org.osgi</groupId>
- <artifactId>org.osgi.core</artifactId>
+ <artifactId>osgi.core</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.osgi</groupId>
- <artifactId>org.osgi.compendium</artifactId>
+ <artifactId>osgi.cmpn</artifactId>
<scope>test</scope>
</dependency>
diff --git a/tests/camel-itest-karaf/pom.xml b/tests/camel-itest-karaf/pom.xml
index 2164cf3..bd73b0f 100644
--- a/tests/camel-itest-karaf/pom.xml
+++ b/tests/camel-itest-karaf/pom.xml
@@ -101,12 +101,12 @@
</dependency>
<dependency>
<groupId>org.osgi</groupId>
- <artifactId>org.osgi.core</artifactId>
+ <artifactId>osgi.core</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.osgi</groupId>
- <artifactId>org.osgi.compendium</artifactId>
+ <artifactId>osgi.cmpn</artifactId>
<scope>test</scope>
</dependency>
<dependency>
diff --git a/tests/camel-performance/pom.xml b/tests/camel-performance/pom.xml
index 424db6e..f6ca683 100644
--- a/tests/camel-performance/pom.xml
+++ b/tests/camel-performance/pom.xml
@@ -41,12 +41,12 @@
</dependency>
<dependency>
<groupId>org.osgi</groupId>
- <artifactId>org.osgi.core</artifactId>
+ <artifactId>osgi.core</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.osgi</groupId>
- <artifactId>org.osgi.compendium</artifactId>
+ <artifactId>osgi.cmpn</artifactId>
<scope>test</scope>
</dependency>
<dependency>