camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cschnei...@apache.org
Subject [2/2] camel git commit: [CAMEL-9048] Special handling for camel-core
Date Wed, 05 Aug 2015 15:53:03 GMT
[CAMEL-9048] Special handling for camel-core


Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/cfb6cd62
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/cfb6cd62
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/cfb6cd62

Branch: refs/heads/camel-2.15.x
Commit: cfb6cd629c6e38c6e93e810ec9a38e32685705b2
Parents: 529d590
Author: Christian Schneider <chris@die-schneider.net>
Authored: Wed Aug 5 17:52:50 2015 +0200
Committer: Christian Schneider <chris@die-schneider.net>
Committed: Wed Aug 5 17:52:50 2015 +0200

----------------------------------------------------------------------
 .../src/main/java/org/apache/camel/impl/osgi/Activator.java     | 5 +++++
 1 file changed, 5 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/cfb6cd62/camel-core/src/main/java/org/apache/camel/impl/osgi/Activator.java
----------------------------------------------------------------------
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 853dcf8..63380a4 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
@@ -92,6 +92,7 @@ public class Activator implements BundleActivator, BundleTrackerCustomizer
{
 
     public void start(BundleContext context) throws Exception {
         LOG.info("Camel activator starting");
+        bundleId = context.getBundle().getBundleId();
         tracker = new BundleTracker(context, Bundle.ACTIVE, this);
         cachePackageCapabilities(context);
         tracker.open();
@@ -210,6 +211,10 @@ public class Activator implements BundleActivator, BundleTrackerCustomizer
{
      * Check if bundle can see the given class
      */
     protected boolean canSee(Bundle bundle, Class<?> clazz) {
+        if (bundle.getBundleId() == bundleId) {
+            // Need extra handling of camel core as it does not import the api
+            return true;
+        }
         BundleCapability packageCap = packageCapabilities.get(clazz.getPackage().getName());
         BundleWiring wiring = bundle.adapt(BundleWiring.class);
         List<BundleWire> imports = wiring.getRequiredWires(PACKAGE_NAMESPACE);


Mime
View raw message