You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@aries.apache.org by Santhosh T R <sa...@ibsplc.com> on 2013/04/17 15:27:28 UTC

Regarding the usage of Apache aires with Spring.

Hi All,
To begin with, I'm newbie with OSGi  and have a few questions on integrating Aires with Spring.


1.       Is it possible to co-exist Aires bundle(blue print) with an existing spring application?

2.       Is it possible to inject a blueprint service to a normal spring bean?

3.       Is it possible to inject a blueprint service in to a Spring MVC controller?

Any help on these would help me a lot.

Thanks and regards,
Santhosh



DISCLAIMER: "The information in this e-mail and any attachment is intended only for the person to whom it is addressed and may contain confidential and/or privileged material. If you have received this e-mail in error, kindly contact the sender and destroy all copies of the original communication. IBS makes no warranty, express or implied, nor guarantees the accuracy, adequacy or completeness of the information contained in this email or any attachment and is not liable for any errors, defects, omissions, viruses or for resultant loss or damage, if any, direct or indirect."

RE: Regarding the usage of Apache aires with Spring.

Posted by Timothy Ward <ti...@apache.org>.
Hi Santhosh,

The quick answers to your questions are yes, yes and yes.

> 1.       Is it possible to co-exist Aires bundle(blue print) with an existing spring application?

This is absolutely possible, particularly if you don't want the Spring container to interact with Aries in any way. If you want to share beans then things are more difficult, but still possible.

> 2.       Is it possible to inject a blueprint service to a normal spring bean?

What exactly are you trying to achieve? Do you want to register a service using blueprint, then consume that service using Spring? Do you want to consume an OSGi service using a blueprint reference and inject that into a spring bean? From your first and third questions I'm guessing that you want to do the former. The easiest way to obtain blueprint beans in Spring would be to use a Spring JNDI lookup (JndiObjectFactoryBean or the jee spring namespace) and the blueprint:comp/<bean name> URL scheme from Aries JNDI. Apparently nobody apart from IBM has documented this feature of Aries JNDI yet... http://pic.dhe.ibm.com/infocenter/wasinfo/v8r0/index.jsp?topic=%2Fcom.ibm.websphere.osgi.nd.multiplatform.doc%2Ftopics%2Fca_blueprint_jndi.html

> 3.       Is it possible to inject a blueprint service in to a Spring MVC controller?

Once you've accessed the blueprint bean in Spring you can do whatever you want with it :)

I hope this helps

Regards,

Tim Ward
-------------------
Apache Aries PMC member & Enterprise OSGi advocate
Enterprise OSGi in Action (http://www.manning.com/cummins)
-------------------


> From: santhosh.retna@ibsplc.com
> To: dev@aries.apache.org
> Subject: Regarding the usage of Apache aires with Spring.
> Date: Wed, 17 Apr 2013 13:27:28 +0000
> 
> Hi All,
> To begin with, I'm newbie with OSGi  and have a few questions on integrating Aires with Spring.
> 
> 
> 1.       Is it possible to co-exist Aires bundle(blue print) with an existing spring application?
> 
> 2.       Is it possible to inject a blueprint service to a normal spring bean?
> 
> 3.       Is it possible to inject a blueprint service in to a Spring MVC controller?
> 
> Any help on these would help me a lot.
> 
> Thanks and regards,
> Santhosh
> 
> 
> 
> DISCLAIMER: "The information in this e-mail and any attachment is intended only for the person to whom it is addressed and may contain confidential and/or privileged material. If you have received this e-mail in error, kindly contact the sender and destroy all copies of the original communication. IBS makes no warranty, express or implied, nor guarantees the accuracy, adequacy or completeness of the information contained in this email or any attachment and is not liable for any errors, defects, omissions, viruses or for resultant loss or damage, if any, direct or indirect."