...
Code Block |
---|
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:sca="http://www.springframework.org/schema/sca"
xsi:schemaLocation="
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/sca http://www.osoa.org/xmlns/sca/1.0/spring-sca.xsd">
<sca:service name="StockQuoteService"
type="bigbank.stockquote.StockQuoteService" target="StockQuoteServiceBean"/>
<bean id="StockQuoteServiceBean" class="bigbank.stockquote.StockQuoteImpl">
</bean>
</beans>
|
...
Code Block |
---|
<beans> <bean id="AccountServiceBean" class="bigbank.account.AccountServiceImpl"> <property name="calculatorService" ref="calculatorService"/> <property name="stockQuoteService" ref="stockQuoteService"/> <property name="checkingAccountService" ref="checkingAccountService"/> <!-- Here are some implicit references & properties - a property with a ref not satisifed * within the Spring application context. --> <property name="savingsAccountService" ref="savingsAccountService"/> <property name="stockAccountService" ref="stockAccountService"/> <property name="currency" value="EURO"/> </bean> <sca:reference name="checkingAccountService" type="bigbank.account.checking.CheckingAccountService"/> <sca:reference name="calculatorService" type="bigbank.calculator.CalculatorService"/> <sca:reference name="stockQuoteService" type="bigbank.stockquote.StockQuoteService"/> </beans> |
...
Code Block |
---|
<composite name="StockQuote">
<service name="StockQuoteService" promote="StockQuoteServiceComponent">
<interface.java interface="bigbank.stockquote.StockQuoteService"/>
<binding.ws uri="http://localhost:8081/services/StockQuoteWebService"/>
</service>
<component name="StockQuoteServiceComponent">
<implementation.spring location="META-INF/spring/StockQuoteService-context.xml"/>
</component>
</composite>
|
...
Code Block |
---|
<constructor-arg><ref bean="mySCAService1"/></constructor-arg>
<constructor-arg><ref bean="mySCAService2"/></constructor-arg>
|
In the above scenario, particularly in cases where the spring bean has defined only one constructor, implicit references / properties can be supported when the contructor-arg element specifies the type of the SCA reference/property that its trying to consume by specifying a type attribute in the contructor-arg OR when the appropriate index attribute is specified in the constructor-arg element.
...
Raised as Specification Issue: http://www.osoa.org/jira/browse/JAVA-59
Integration with Spring for Web Applications (including Spring MVC)
Spring SCA Namespace schema
...
References
Spring Framework - http://static.springframework.org/spring/docs/2.5.5/reference/index.html