XBean syntax
Here are a few examples of XBean syntax. For more informations, refer to:
<beans xmlns:sm="http://servicemix.apache.org/config/1.0"> <sm:container embedded="true"> ... </sm:container> </beans>
or using plain Spring syntax:
<beans> <bean class="org.apache.servicemix.jbi.container.SpringJBIContainer"> <property name="embedded" value="true" /> ... </bean> </beans>
Elements listed above are properties with complex types, i.e. beans. They can be set using references in xbean:
<beans xmlns:sm="http://servicemix.apache.org/config/1.0"> <sm:container transactionManager="#txmgr"> ... </sm:container> <bean id="txmgr" ... /> </beans>
or using an element and an inner bean definition:
<beans xmlns:sm="http://servicemix.apache.org/config/1.0"> <sm:container> <sm:transactionManager> <bean ... /> </sm:transactionManager> ... </sm:container> <bean id="txmgr" ... /> </beans>
or using plain spring syntax as a reference:
<beans> <bean class="org.apache.servicemix.jbi.container.SpringJBIContainer"> <property name="transactionManager" ref="txmgr" /> ... </bean> <bean id="txmgr" ... /> </beans>
or using plain spring syntax and an inner bean definition:
<beans> <bean class="org.apache.servicemix.jbi.container.SpringJBIContainer"> <property name="transactionManager"> <bean ... /> </property> ... </bean> </beans>
Some beans have corresponsing xbean elements, so the following xml configurations are equivalent:
XBean syntax
<beans xmlns:sm="http://servicemix.apache.org/config/1.0"> <sm:container id="jbi" embedded="true"> <sm:broker> <sm:securedBroker authorizationMap="#authorizationMap"> <sm:flows> <sm:sedaFlow /> <sm:jmsFlow jmsURL="tcp://localhost:61616" /> <sm:jcaFlow connectionManager="#connectionManager" jmsURL="tcp://localhost:61616" /> </sm:flows> </sm:securedBroker> </sm:broker> </sm:container> </beans>
Plain spring syntax
<beans> <bean id="jbi" class="org.apache.servicemix.jbi.container.SpringJBIContainer"> <property name="embedded" value="true" /> <property name="broker"> <bean class="org.apache.servicemix.jbi.security.SecuredBroker"> <property name="authorizationMap" ref="authorizationMap" /> <property name="flows"> <list> <bean class="org.apache.servicemix.jbi.flows.seda.SedaFlow" /> <bean class="org.apache.servicemix.jbi.flows.jms.JMSFlow"> <property name="jmsURL" value="tcp://localhost:61616" /> </bean> <bean class="org.apache.servicemix.jbi.flows.jca.JCAFlow"> <property name="jmsURL" value="tcp://localhost:61616" /> <property name="connectionManager" ref="connectionManager" /> </bean> </list> </property> </bean> </property> </bean> </beans>