So auto-wiring and AOP (in particular transactions) are supported for
spring defined beans.

I've done a few tests with cxf and the duplicate namespace handler does not
really seem to cause any issue, even if the one used is currently
undetermined (it depends on the bundle start order between blueprint-spring
/ cxf bundles).  Both namespace handlers seem to behave correctly, but i
have only tested with the cxf config one.

Do you guys see additional use cases to cover ?

2015-11-20 17:56 GMT+01:00 Guillaume Nodet <[email protected]>:

> I've just committed a new module (and the additional required changes and
> existing modules) to support Spring namespaces (default and custom) in
> blueprint.
> See the source code at
>
> http://svn.apache.org/viewvc/aries/trunk/blueprint/blueprint-spring/src/main/java/org/apache/aries/blueprint/spring/
>
> It's limited and not much tested for now, but it can handle things like
> the following:
>
> <blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0";
>            xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
>   xmlns:bp="http://www.osgi.org/xmlns/blueprint/v1.0.0";
>   xmlns:bean="http://camel.apache.org/schema/blueprint";
>   xmlns:util="http://www.springframework.org/schema/util";
>            xsi:schemaLocation="
>              http://www.osgi.org/xmlns/blueprint/v1.0.0
> http://www.osgi.org/xmlns/blueprint/v1.0.0/blueprint.xsd
>              http://camel.apache.org/schema/blueprint
> http://camel.apache.org/schema/blueprint/camel-blueprint.xsd
>              http://www.springframework.org/schema/tx
> http://www.springframework.org/schema/tx/spring-tx-4.2.xsd
>              http://www.springframework.org/schema/util
> http://www.springframework.org/schema/util/spring-util-4.2.xsd
>              http://www.springframework.org/schema/beans
> http://www.springframework.org/schema/beans/spring-beans-4.2.xsd";>
>
>     <!-- plain blueprint bean referencing a spring bean -->
>     <bean id="artemis" class="org.apache.camel.component.jms.JmsComponent">
> <property name="connectionFactory" ref="jmsConnectionFactory"/>
>     </bean>
>
>     <!-- spring bean -->
>     <bean name="jmsConnectionFactory"
> class="org.apache.activemq.artemis.api.jms.ActiveMQJMSClient"
> factory-method="createConnectionFactory" xmlns="
> http://www.springframework.org/schema/beans";>
> <constructor-arg value="tcp://0.0.0.0:61616?user=karaf&amp;password=karaf
> "/>
> <constructor-arg value="broker"/>
>     </bean>
>
>     <!-- spring bean using custom namespace, referencing spring and
> blueprint beans -->
>     <util:list id="springList" xmlns="
> http://www.springframework.org/schema/beans";>
> <value>foo</value>
> <ref bean="jmsConnectionFactory" />
> <ref bean="artemis"/>
>     </util:list>
>
>     <!-- blueprint service referencing a spring bean -->
>     <service ref="springList" auto-export="all-classes"/>
>
> </blueprint>
>
>
> So you can use the default spring namespace or custom spring namespaces
> and cross-reference beans between blueprint and spring.
>
> I haven't tried auto-wiring or any advanced usage such as AOP.
>
> I'll try to commit a few initial integration tests beginning of next week.
> Please have a look and provide feedback and additional use cases (as tests
> ?).
>
> Cheers,
> Guillaume Nodet
>
>
>

Reply via email to