You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by Ramiro Pugh <ra...@gmail.com> on 2014/05/14 22:21:15 UTC

EventNotifierSupport in all contexts

Hi, I'm trying  to develop an auditor for every context that exist in Jboss
Fuse.

I read this post
http://java.dzone.com/articles/measure-elapsed-time-cameland this is
the best approach to my solution.  But I wish to create one
single bean and make posiible with one single bean intercept all the
exchanges in all the contexts in Fuse. Is this possible?

Regards

-- 
Ramiro Pugh

Re: EventNotifierSupport in all contexts

Posted by Chubutin <ra...@gmail.com>.
Thank you Charles and Claus! I supposed there was a mechanism to intercept
all the registrations of t he Camel Contexts. I'll try with a notifier bean
as a osgi service and a implementation of Activation to register that bean
in all the contexts. If all goes well my solution will be posted here, or
the inconvenients.

@Henrique I not use blueprint, because in many services it was impossible to
test them, so all my services are with Camel and Spring-DM.



 



--
View this message in context: http://camel.465427.n5.nabble.com/EventNotifierSupport-in-all-contexts-tp5751178p5751486.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: EventNotifierSupport in all contexts

Posted by Charles Moulliard <ch...@gmail.com>.
This could possible if you use the Camel Container SPI interface.

package org.apache.camel.spi;

/**
 * The <code>Container</code> interface defines an object that can be used
 * to customize all Camel CONTEXTS created.
 * <p/>
 * A container can be used to globally intercept and customize Camel
CONTEXTS,
 * by registering a <code>LifecycleStrategy</code>, a
<code>ProcessorFactory</code>,
 * or any other SPI object.
 */
public interface Container {

Here is an OSGI example -->

https://github.com/cmoulliard/fabric8/blob/master/insight/insight-camel/src/main/java/io/fabric8/insight/camel/base/Activator.java


On Wed, May 14, 2014 at 10:21 PM, Ramiro Pugh <ra...@gmail.com> wrote:

> Hi, I'm trying  to develop an auditor for every context that exist in Jboss
> Fuse.
>
> I read this post
> http://java.dzone.com/articles/measure-elapsed-time-cameland this is
> the best approach to my solution.  But I wish to create one
> single bean and make posiible with one single bean intercept all the
> exchanges in all the contexts in Fuse. Is this possible?
>
> Regards
>
> --
> Ramiro Pugh
>



-- 
Charles Moulliard
Apache Committer / Architect @RedHat
Twitter : @cmoulliard | Blog :  http://cmoulliard.github.io

Re: EventNotifierSupport in all contexts

Posted by Henrique Viecili <vi...@gmail.com>.
If you are using OSGi Blueprint you may face this issue:
https://issues.apache.org/jira/browse/CAMEL-7091

Henrique Viecili


On 16 May 2014 02:18, Claus Ibsen <cl...@gmail.com> wrote:

> On Wed, May 14, 2014 at 10:21 PM, Ramiro Pugh <ra...@gmail.com> wrote:
> > Hi, I'm trying  to develop an auditor for every context that exist in
> Jboss
> > Fuse.
> >
> > I read this post
> > http://java.dzone.com/articles/measure-elapsed-time-cameland this is
> > the best approach to my solution.  But I wish to create one
> > single bean and make posiible with one single bean intercept all the
> > exchanges in all the contexts in Fuse. Is this possible?
> >
>
> You can create one osgi bundle with the implementation and install
> that, and have it enlisted in osgi service registry.
>
> And then for each camel bundle, you need to lookup that bean in the
> osgi service registry, so <camelContext> can find it.
>
> > Regards
> >
> > --
> > Ramiro Pugh
>
>
>
> --
> Claus Ibsen
> -----------------
> Red Hat, Inc.
> Email: cibsen@redhat.com
> Twitter: davsclaus
> Blog: http://davsclaus.com
> Author of Camel in Action: http://www.manning.com/ibsen
> hawtio: http://hawt.io/
> fabric8: http://fabric8.io/
>

Re: EventNotifierSupport in all contexts

Posted by Claus Ibsen <cl...@gmail.com>.
On Wed, May 14, 2014 at 10:21 PM, Ramiro Pugh <ra...@gmail.com> wrote:
> Hi, I'm trying  to develop an auditor for every context that exist in Jboss
> Fuse.
>
> I read this post
> http://java.dzone.com/articles/measure-elapsed-time-cameland this is
> the best approach to my solution.  But I wish to create one
> single bean and make posiible with one single bean intercept all the
> exchanges in all the contexts in Fuse. Is this possible?
>

You can create one osgi bundle with the implementation and install
that, and have it enlisted in osgi service registry.

And then for each camel bundle, you need to lookup that bean in the
osgi service registry, so <camelContext> can find it.

> Regards
>
> --
> Ramiro Pugh



-- 
Claus Ibsen
-----------------
Red Hat, Inc.
Email: cibsen@redhat.com
Twitter: davsclaus
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen
hawtio: http://hawt.io/
fabric8: http://fabric8.io/