You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@servicemix.apache.org by abovesun <ab...@gmail.com> on 2008/10/09 16:58:46 UTC

how to get access form jbi component to OSGI env?

We are running SMX4 NMR in equinox osgi environment, is there are some
standard way to access some OSGI-registered service from jbi component? Only
solution that I think about is to create special MBean to access OSGI word.
Thanks.
-- 
View this message in context: http://www.nabble.com/how-to-get-access-form-jbi-component-to-OSGI-env--tp19900738p19900738.html
Sent from the ServiceMix - User mailing list archive at Nabble.com.


Re: how to get access form jbi component to OSGI env?

Posted by Guillaume Nodet <gn...@gmail.com>.
Well, take a look at the following example:
  https://svn.apache.org/repos/asf/servicemix/components/engines/servicemix-wsn2005/trunk/src/main/resources/META-INF/spring/servicemix-wsn2005.xml

A JMS ConnectionFactory is retrieved from the OSGi registry and
injected into the WSNComponent.
Another way would be to make your component implement the spring
BundleContextAware interface so that the BundleContext would be
injected in your component and you could use it to access the whole
OSGi framework.
I would recommend using the Spring-DM way unless you need more specific stuff.

On Fri, Oct 10, 2008 at 12:12 PM, abovesun <ab...@gmail.com> wrote:
>
> Guillaume, it isn't a problem source to deploy jbi component in OSGI
> environment, we are using ServiceMix4+Equinox+Spring-OSGI for that, but the
> question is how to (for example) invoce some OSGI service inside
> JBIComponent.doStart method.
> Thanks.
>
>
> gnodet wrote:
>>
>> The OSGi runtime is only accessible to JBI components deployed with
>> the OSGi packaging (aka with OSGi bundles) instead of the JBI
>> packaging.
>> If you use ServiceMix components, or your own components written using
>> servicemix-common, this is quite easy to do.
>> You first need to package your jar containing the component classes
>> into an OSGi bundle, then you need to write a spring configuration
>> file to register your component in the OSGi registry as this is now
>> done for servicemix components.  You can find an example at:
>>
>> https://svn.apache.org/repos/asf/servicemix/components/engines/servicemix-quartz/trunk/src/main/resources/META-INF/spring/servicemix-quartz.xml
>> You just need to copy this file and change the quartz references to
>> point to your own component.
>> From this spring powered file, you can access the OSGi registry to
>> publish other services, or retrieve services and inject them in your
>> own beans.
>>
>> For a component packages as a pure JBI component, I'm not sure how we
>> could do that.  The component itself is not create inside a bundle, so
>> it has no real way to access the JBI api.
>>
>> If you have further questions, feel free to ask.
>>
>> On Thu, Oct 9, 2008 at 4:58 PM, abovesun <ab...@gmail.com> wrote:
>>>
>>> We are running SMX4 NMR in equinox osgi environment, is there are some
>>> standard way to access some OSGI-registered service from jbi component?
>>> Only
>>> solution that I think about is to create special MBean to access OSGI
>>> word.
>>> Thanks.
>>> --
>>> View this message in context:
>>> http://www.nabble.com/how-to-get-access-form-jbi-component-to-OSGI-env--tp19900738p19900738.html
>>> Sent from the ServiceMix - User mailing list archive at Nabble.com.
>>>
>>>
>>
>>
>>
>> --
>> Cheers,
>> Guillaume Nodet
>> ------------------------
>> Blog: http://gnodet.blogspot.com/
>> ------------------------
>> Open Source SOA
>> http://open.iona.com
>>
>>
>
> --
> View this message in context: http://www.nabble.com/how-to-get-access-form-jbi-component-to-OSGI-env--tp19900738p19915561.html
> Sent from the ServiceMix - User mailing list archive at Nabble.com.
>
>



-- 
Cheers,
Guillaume Nodet
------------------------
Blog: http://gnodet.blogspot.com/
------------------------
Open Source SOA
http://open.iona.com

Re: how to get access form jbi component to OSGI env?

Posted by abovesun <ab...@gmail.com>.
Guillaume, it isn't a problem source to deploy jbi component in OSGI
environment, we are using ServiceMix4+Equinox+Spring-OSGI for that, but the
question is how to (for example) invoce some OSGI service inside
JBIComponent.doStart method.
Thanks.


gnodet wrote:
> 
> The OSGi runtime is only accessible to JBI components deployed with
> the OSGi packaging (aka with OSGi bundles) instead of the JBI
> packaging.
> If you use ServiceMix components, or your own components written using
> servicemix-common, this is quite easy to do.
> You first need to package your jar containing the component classes
> into an OSGi bundle, then you need to write a spring configuration
> file to register your component in the OSGi registry as this is now
> done for servicemix components.  You can find an example at:
>  
> https://svn.apache.org/repos/asf/servicemix/components/engines/servicemix-quartz/trunk/src/main/resources/META-INF/spring/servicemix-quartz.xml
> You just need to copy this file and change the quartz references to
> point to your own component.
> From this spring powered file, you can access the OSGi registry to
> publish other services, or retrieve services and inject them in your
> own beans.
> 
> For a component packages as a pure JBI component, I'm not sure how we
> could do that.  The component itself is not create inside a bundle, so
> it has no real way to access the JBI api.
> 
> If you have further questions, feel free to ask.
> 
> On Thu, Oct 9, 2008 at 4:58 PM, abovesun <ab...@gmail.com> wrote:
>>
>> We are running SMX4 NMR in equinox osgi environment, is there are some
>> standard way to access some OSGI-registered service from jbi component?
>> Only
>> solution that I think about is to create special MBean to access OSGI
>> word.
>> Thanks.
>> --
>> View this message in context:
>> http://www.nabble.com/how-to-get-access-form-jbi-component-to-OSGI-env--tp19900738p19900738.html
>> Sent from the ServiceMix - User mailing list archive at Nabble.com.
>>
>>
> 
> 
> 
> -- 
> Cheers,
> Guillaume Nodet
> ------------------------
> Blog: http://gnodet.blogspot.com/
> ------------------------
> Open Source SOA
> http://open.iona.com
> 
> 

-- 
View this message in context: http://www.nabble.com/how-to-get-access-form-jbi-component-to-OSGI-env--tp19900738p19915561.html
Sent from the ServiceMix - User mailing list archive at Nabble.com.


Re: how to get access form jbi component to OSGI env?

Posted by Guillaume Nodet <gn...@gmail.com>.
The OSGi runtime is only accessible to JBI components deployed with
the OSGi packaging (aka with OSGi bundles) instead of the JBI
packaging.
If you use ServiceMix components, or your own components written using
servicemix-common, this is quite easy to do.
You first need to package your jar containing the component classes
into an OSGi bundle, then you need to write a spring configuration
file to register your component in the OSGi registry as this is now
done for servicemix components.  You can find an example at:
  https://svn.apache.org/repos/asf/servicemix/components/engines/servicemix-quartz/trunk/src/main/resources/META-INF/spring/servicemix-quartz.xml
You just need to copy this file and change the quartz references to
point to your own component.
>From this spring powered file, you can access the OSGi registry to
publish other services, or retrieve services and inject them in your
own beans.

For a component packages as a pure JBI component, I'm not sure how we
could do that.  The component itself is not create inside a bundle, so
it has no real way to access the JBI api.

If you have further questions, feel free to ask.

On Thu, Oct 9, 2008 at 4:58 PM, abovesun <ab...@gmail.com> wrote:
>
> We are running SMX4 NMR in equinox osgi environment, is there are some
> standard way to access some OSGI-registered service from jbi component? Only
> solution that I think about is to create special MBean to access OSGI word.
> Thanks.
> --
> View this message in context: http://www.nabble.com/how-to-get-access-form-jbi-component-to-OSGI-env--tp19900738p19900738.html
> Sent from the ServiceMix - User mailing list archive at Nabble.com.
>
>



-- 
Cheers,
Guillaume Nodet
------------------------
Blog: http://gnodet.blogspot.com/
------------------------
Open Source SOA
http://open.iona.com