When I look at the example provided I'm not entirely sure if I'm
understanding how the CDI OSGi service mechanics work.

    @Produces
    @Named("sjms")
    @ApplicationScoped
SjmsComponent sjms()

I gather because it is ApplicationScoped that gets exported via the OSGi
service registry? But it is also a Camel component which may have other in
built mechanisms that might be required. If it isn't ApplicationScoped does
it stay private to the bundle using it?  I'm thinking of properties for
example which might have their own configurations per bundle that one
doesn't want being exported to the world.

If I have an interface like PaypalService and then a concrete
implementation of that called PayPalImpl, would this work to export the
service to the OSGi service registry?

    @Produces
    @Named("paypal")
    @ApplicationScoped
PayPal paypal() {
//Disregarding any special setup...
  return new PayPalImpl();
}

Or would that PayPalImpl have to extend a CamelComponent to get that
behavior?

Right now I'm running and using this only from Eclipse and the CDI unit
test runner which works brilliantly and I don't have to use bueprint for
anything.  But I will want to export services from some bundles while
making sure that the visibility is appropriate.

Brad

Reply via email to