You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by da...@apache.org on 2014/06/26 17:05:01 UTC

[1/3] git commit: CAMEL-7545: Fixed camel osgi to regsiter all CamelContext from the same bundle in OSGi service registry. This also fixes the camel karaf commands to show em all.

Repository: camel
Updated Branches:
  refs/heads/camel-2.12.x c25146502 -> 741b0cab2
  refs/heads/camel-2.13.x b69abf49e -> 0164fbcfc
  refs/heads/master 1b07210d6 -> d49bf78e1


CAMEL-7545: Fixed camel osgi to regsiter all CamelContext from the same bundle in OSGi service registry. This also fixes the camel karaf commands to show em all.


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

Branch: refs/heads/master
Commit: d49bf78e1f62306cc1b448527ebb3ab8f3b82d47
Parents: 1b07210
Author: Claus Ibsen <da...@apache.org>
Authored: Thu Jun 26 17:04:05 2014 +0200
Committer: Claus Ibsen <da...@apache.org>
Committed: Thu Jun 26 17:04:05 2014 +0200

----------------------------------------------------------------------
 .../org/apache/camel/core/osgi/OsgiCamelContextPublisher.java | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/d49bf78e/components/camel-core-osgi/src/main/java/org/apache/camel/core/osgi/OsgiCamelContextPublisher.java
----------------------------------------------------------------------
diff --git a/components/camel-core-osgi/src/main/java/org/apache/camel/core/osgi/OsgiCamelContextPublisher.java b/components/camel-core-osgi/src/main/java/org/apache/camel/core/osgi/OsgiCamelContextPublisher.java
index dd45c19..d932550 100644
--- a/components/camel-core-osgi/src/main/java/org/apache/camel/core/osgi/OsgiCamelContextPublisher.java
+++ b/components/camel-core-osgi/src/main/java/org/apache/camel/core/osgi/OsgiCamelContextPublisher.java
@@ -93,7 +93,10 @@ public class OsgiCamelContextPublisher extends EventNotifierSupport {
 
     public ServiceRegistration registerCamelContext(CamelContext camelContext) throws InvalidSyntaxException {
         // avoid registering the same service again
-        String symbolicName = bundleContext.getBundle().getSymbolicName();
+        // we must include unique camel management name so the symbolic name becomes unique,
+        // in case the bundle has more than one CamelContext
+        String name = camelContext.getName();
+        String symbolicName = bundleContext.getBundle().getSymbolicName() + "-" + name;
         Version bundleVersion = getBundleVersion(bundleContext.getBundle());
         ServiceReference[] refs = bundleContext.getServiceReferences(CamelContext.class.getName(),
                 "(&(" + CONTEXT_SYMBOLIC_NAME_PROPERTY + "=" + symbolicName + ")(" + CONTEXT_VERSION_PROPERTY + "=" + bundleVersion + "))");
@@ -102,7 +105,7 @@ public class OsgiCamelContextPublisher extends EventNotifierSupport {
             Dictionary<String, Object > props = new Hashtable<String, Object>();
             props.put(CONTEXT_SYMBOLIC_NAME_PROPERTY, symbolicName);
             props.put(CONTEXT_VERSION_PROPERTY, bundleVersion);
-            props.put(CONTEXT_NAME_PROPERTY, camelContext.getName());
+            props.put(CONTEXT_NAME_PROPERTY, name);
 
             if (log.isDebugEnabled()) {
                 log.debug("Registering CamelContext [{}] of in OSGi registry", camelContext.getName());


[3/3] git commit: CAMEL-7545: Fixed camel osgi to regsiter all CamelContext from the same bundle in OSGi service registry. This also fixes the camel karaf commands to show em all.

Posted by da...@apache.org.
CAMEL-7545: Fixed camel osgi to regsiter all CamelContext from the same bundle in OSGi service registry. This also fixes the camel karaf commands to show em all.


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

Branch: refs/heads/camel-2.12.x
Commit: 741b0cab2f285de01d3979b77882d93ca2df5dfe
Parents: c251465
Author: Claus Ibsen <da...@apache.org>
Authored: Thu Jun 26 17:04:05 2014 +0200
Committer: Claus Ibsen <da...@apache.org>
Committed: Thu Jun 26 17:04:44 2014 +0200

----------------------------------------------------------------------
 .../org/apache/camel/core/osgi/OsgiCamelContextPublisher.java | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/741b0cab/components/camel-core-osgi/src/main/java/org/apache/camel/core/osgi/OsgiCamelContextPublisher.java
----------------------------------------------------------------------
diff --git a/components/camel-core-osgi/src/main/java/org/apache/camel/core/osgi/OsgiCamelContextPublisher.java b/components/camel-core-osgi/src/main/java/org/apache/camel/core/osgi/OsgiCamelContextPublisher.java
index 4b0f42d..69c74f9 100644
--- a/components/camel-core-osgi/src/main/java/org/apache/camel/core/osgi/OsgiCamelContextPublisher.java
+++ b/components/camel-core-osgi/src/main/java/org/apache/camel/core/osgi/OsgiCamelContextPublisher.java
@@ -94,7 +94,10 @@ public class OsgiCamelContextPublisher extends EventNotifierSupport {
 
     public ServiceRegistration registerCamelContext(CamelContext camelContext) throws InvalidSyntaxException {
         // avoid registering the same service again
-        String symbolicName = bundleContext.getBundle().getSymbolicName();
+        // we must include unique camel management name so the symbolic name becomes unique,
+        // in case the bundle has more than one CamelContext
+        String name = camelContext.getName();
+        String symbolicName = bundleContext.getBundle().getSymbolicName() + "-" + name;
         Version bundleVersion = getBundleVersion(bundleContext.getBundle());
         ServiceReference[] refs = bundleContext.getServiceReferences(CamelContext.class.getName(),
                 "(&(" + CONTEXT_SYMBOLIC_NAME_PROPERTY + "=" + symbolicName + ")(" + CONTEXT_VERSION_PROPERTY + "=" + bundleVersion + "))");
@@ -103,7 +106,7 @@ public class OsgiCamelContextPublisher extends EventNotifierSupport {
             Dictionary<String, Object > props = new Hashtable<String, Object>();
             props.put(CONTEXT_SYMBOLIC_NAME_PROPERTY, symbolicName);
             props.put(CONTEXT_VERSION_PROPERTY, bundleVersion);
-            props.put(CONTEXT_NAME_PROPERTY, camelContext.getName());
+            props.put(CONTEXT_NAME_PROPERTY, name);
 
             if (log.isDebugEnabled()) {
                 log.debug("Registering CamelContext [{}] of in OSGi registry", camelContext.getName());


[2/3] git commit: CAMEL-7545: Fixed camel osgi to regsiter all CamelContext from the same bundle in OSGi service registry. This also fixes the camel karaf commands to show em all.

Posted by da...@apache.org.
CAMEL-7545: Fixed camel osgi to regsiter all CamelContext from the same bundle in OSGi service registry. This also fixes the camel karaf commands to show em all.


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

Branch: refs/heads/camel-2.13.x
Commit: 0164fbcfc095c7270aed8808b45059b97570ec24
Parents: b69abf4
Author: Claus Ibsen <da...@apache.org>
Authored: Thu Jun 26 17:04:05 2014 +0200
Committer: Claus Ibsen <da...@apache.org>
Committed: Thu Jun 26 17:04:27 2014 +0200

----------------------------------------------------------------------
 .../org/apache/camel/core/osgi/OsgiCamelContextPublisher.java | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/0164fbcf/components/camel-core-osgi/src/main/java/org/apache/camel/core/osgi/OsgiCamelContextPublisher.java
----------------------------------------------------------------------
diff --git a/components/camel-core-osgi/src/main/java/org/apache/camel/core/osgi/OsgiCamelContextPublisher.java b/components/camel-core-osgi/src/main/java/org/apache/camel/core/osgi/OsgiCamelContextPublisher.java
index dd45c19..d932550 100644
--- a/components/camel-core-osgi/src/main/java/org/apache/camel/core/osgi/OsgiCamelContextPublisher.java
+++ b/components/camel-core-osgi/src/main/java/org/apache/camel/core/osgi/OsgiCamelContextPublisher.java
@@ -93,7 +93,10 @@ public class OsgiCamelContextPublisher extends EventNotifierSupport {
 
     public ServiceRegistration registerCamelContext(CamelContext camelContext) throws InvalidSyntaxException {
         // avoid registering the same service again
-        String symbolicName = bundleContext.getBundle().getSymbolicName();
+        // we must include unique camel management name so the symbolic name becomes unique,
+        // in case the bundle has more than one CamelContext
+        String name = camelContext.getName();
+        String symbolicName = bundleContext.getBundle().getSymbolicName() + "-" + name;
         Version bundleVersion = getBundleVersion(bundleContext.getBundle());
         ServiceReference[] refs = bundleContext.getServiceReferences(CamelContext.class.getName(),
                 "(&(" + CONTEXT_SYMBOLIC_NAME_PROPERTY + "=" + symbolicName + ")(" + CONTEXT_VERSION_PROPERTY + "=" + bundleVersion + "))");
@@ -102,7 +105,7 @@ public class OsgiCamelContextPublisher extends EventNotifierSupport {
             Dictionary<String, Object > props = new Hashtable<String, Object>();
             props.put(CONTEXT_SYMBOLIC_NAME_PROPERTY, symbolicName);
             props.put(CONTEXT_VERSION_PROPERTY, bundleVersion);
-            props.put(CONTEXT_NAME_PROPERTY, camelContext.getName());
+            props.put(CONTEXT_NAME_PROPERTY, name);
 
             if (log.isDebugEnabled()) {
                 log.debug("Registering CamelContext [{}] of in OSGi registry", camelContext.getName());