Yeah that's the guy that triggers some osgi code that enlist the camel
context in the osgi service registry at that bundle, which is what the
karaf camel command uses.

See also how camel-scr does some stuff as it does also manually do
some osgi initialization
https://github.com/apache/camel/blob/master/components/camel-scr/src/main/java/org/apache/camel/scr/AbstractCamelRunner.java

On Wed, Dec 9, 2015 at 4:49 PM, Antonin Stefanutti
<anto...@stefanutti.fr> wrote:
> You need the following piece of code to be executed so that your Camel 
> contexts get published as OSGi services:
>
> context.getManagementStrategy().addEventNotifier(new 
> OsgiCamelContextPublisher(BundleContextUtils.getBundleContext(getClass())));
>
> Then your Camel contexts will be visible from Camel Karaf commands.
>
> Antonin
>
>> On 09 Dec 2015, at 15:52, rwijngaa <rino.van.wijngaar...@gmail.com> wrote:
>>
>> ok, tried that.
>>
>>        CamelContext camelContext = new
>> OsgiSpringCamelContext(getApplicationContext(),
>> Activator.getBundleContext());
>>         ((OsgiSpringCamelContext)camelContext).setName(contextId);
>>
>>
>> The OsgiSpringCamelContext constructor is calling
>> OsgiCamelContextHelper.osgiUpdate(this, bundleContext)) and this seems to do
>> a lot of OSGi initialisation, but still no luck !
>> note: Activator is copied from org.apache.camel.osgi.Activator and present
>> in my bundle's manifest as Bundle-Activator.
>>
>> Any pointers would be apprecciated
>> Regards
>> Rino
>>
>>
>>
>> --
>> View this message in context: 
>> http://camel.465427.n5.nabble.com/Dynamically-created-CamelContext-not-visible-in-fuse-console-tp5774855p5774864.html
>> Sent from the Camel - Users mailing list archive at Nabble.com.
>



-- 
Claus Ibsen
-----------------
http://davsclaus.com @davsclaus
Camel in Action 2: https://www.manning.com/ibsen2

Reply via email to