You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by dk...@apache.org on 2011/09/20 02:05:08 UTC
svn commit: r1172913 - in /camel/branches/camel-2.8.x: ./
components/camel-core-osgi/src/main/java/org/apache/camel/core/osgi/
tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/blueprint/
tests/camel-itest-osgi/src/test/resources/org/apa...
Author: dkulp
Date: Tue Sep 20 00:05:08 2011
New Revision: 1172913
URL: http://svn.apache.org/viewvc?rev=1172913&view=rev
Log:
Merged revisions 1163963 via svnmerge from
https://svn.apache.org/repos/asf/camel/trunk
........
r1163963 | ningjiang | 2011-09-01 05:29:22 -0400 (Thu, 01 Sep 2011) | 1 line
CAMEL-4402 OsgiCamelContextPublisher should publish the camel context with the camelName
........
Modified:
camel/branches/camel-2.8.x/ (props changed)
camel/branches/camel-2.8.x/components/camel-core-osgi/src/main/java/org/apache/camel/core/osgi/OsgiCamelContextPublisher.java
camel/branches/camel-2.8.x/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/blueprint/OSGiBlueprintHelloWorldTest.java
camel/branches/camel-2.8.x/tests/camel-itest-osgi/src/test/resources/org/apache/camel/itest/osgi/blueprint/blueprint-13.xml
Propchange: camel/branches/camel-2.8.x/
------------------------------------------------------------------------------
Binary property 'svnmerge-integrated' - no diff available.
Modified: camel/branches/camel-2.8.x/components/camel-core-osgi/src/main/java/org/apache/camel/core/osgi/OsgiCamelContextPublisher.java
URL: http://svn.apache.org/viewvc/camel/branches/camel-2.8.x/components/camel-core-osgi/src/main/java/org/apache/camel/core/osgi/OsgiCamelContextPublisher.java?rev=1172913&r1=1172912&r2=1172913&view=diff
==============================================================================
--- camel/branches/camel-2.8.x/components/camel-core-osgi/src/main/java/org/apache/camel/core/osgi/OsgiCamelContextPublisher.java (original)
+++ camel/branches/camel-2.8.x/components/camel-core-osgi/src/main/java/org/apache/camel/core/osgi/OsgiCamelContextPublisher.java Tue Sep 20 00:05:08 2011
@@ -40,6 +40,7 @@ public class OsgiCamelContextPublisher e
public static final String CONTEXT_SYMBOLIC_NAME_PROPERTY = "camel.context.symbolicname";
public static final String CONTEXT_VERSION_PROPERTY = "camel.context.version";
+ public static final String CONTEXT_NAME_PROPERTY = "camel.context.name";
private final BundleContext bundleContext;
private final Map<CamelContext, ServiceRegistration> registrations = new ConcurrentHashMap<CamelContext, ServiceRegistration>();
@@ -55,10 +56,10 @@ public class OsgiCamelContextPublisher e
Properties props = new Properties();
props.put(CONTEXT_SYMBOLIC_NAME_PROPERTY, bundleContext.getBundle().getSymbolicName());
props.put(CONTEXT_VERSION_PROPERTY, getBundleVersion(bundleContext.getBundle()));
+ props.put(CONTEXT_NAME_PROPERTY, context.getName());
+
+ log.debug("Registering CamelContext [{}] of in OSGi registry", props);
- if (log.isDebugEnabled()) {
- log.debug("Registering CamelContext [{}] in OSGi registry", context.getName());
- }
ServiceRegistration reg = bundleContext.registerService(CamelContext.class.getName(), context, props);
registrations.put(context, reg);
} else if (event instanceof CamelContextStoppingEvent) {
Modified: camel/branches/camel-2.8.x/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/blueprint/OSGiBlueprintHelloWorldTest.java
URL: http://svn.apache.org/viewvc/camel/branches/camel-2.8.x/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/blueprint/OSGiBlueprintHelloWorldTest.java?rev=1172913&r1=1172912&r2=1172913&view=diff
==============================================================================
--- camel/branches/camel-2.8.x/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/blueprint/OSGiBlueprintHelloWorldTest.java (original)
+++ camel/branches/camel-2.8.x/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/blueprint/OSGiBlueprintHelloWorldTest.java Tue Sep 20 00:05:08 2011
@@ -57,7 +57,8 @@ public class OSGiBlueprintHelloWorldTest
getInstalledBundle(name).start();
// must use the camel context from osgi
- CamelContext ctx = getOsgiService(CamelContext.class, "(camel.context.symbolicname=" + name + ")", 10000);
+ CamelContext ctx = getOsgiService(CamelContext.class, "(camel.context.symbolicname=" + name + ")"
+ + "&&(camel.context.name=camel1)", 10000);
ProducerTemplate myTemplate = ctx.createProducerTemplate();
myTemplate.start();
Modified: camel/branches/camel-2.8.x/tests/camel-itest-osgi/src/test/resources/org/apache/camel/itest/osgi/blueprint/blueprint-13.xml
URL: http://svn.apache.org/viewvc/camel/branches/camel-2.8.x/tests/camel-itest-osgi/src/test/resources/org/apache/camel/itest/osgi/blueprint/blueprint-13.xml?rev=1172913&r1=1172912&r2=1172913&view=diff
==============================================================================
--- camel/branches/camel-2.8.x/tests/camel-itest-osgi/src/test/resources/org/apache/camel/itest/osgi/blueprint/blueprint-13.xml (original)
+++ camel/branches/camel-2.8.x/tests/camel-itest-osgi/src/test/resources/org/apache/camel/itest/osgi/blueprint/blueprint-13.xml Tue Sep 20 00:05:08 2011
@@ -18,11 +18,18 @@
<blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0"
xmlns:camel="http://camel.apache.org/schema/blueprint">
- <camel:camelContext>
+ <camel:camelContext id="camel1">
<camel:route>
<camel:from uri="file:target/foo"/>
<camel:to uri="mock:result"/>
</camel:route>
</camel:camelContext>
+ <camel:camelContext id="camel2">
+ <camel:route>
+ <camel:from uri="direct:start"/>
+ <camel:to uri="mock:end"/>
+ </camel:route>
+ </camel:camelContext>
+
</blueprint>