I'm looking at a Spring based payment component in the travel sample in the
sandbox [1] and am having problems in the case where the Spring context and
the implementations it references are unannotated.

I have a bean...

public class PaymentImpl implements Payment {

    private CreditCardPayment creditCardPayment;
    private EmailGateway emailGateway;

    public void setCreditCardPayment(CreditCardPayment creditCardPayment) {
        this.creditCardPayment = creditCardPayment;
    }

    public void setEmailGateway(EmailGateway emailGateway) {
        this.emailGateway = emailGateway;
    }

a context...

<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";>

    <bean id="Payment" class="payment.PaymentImpl">
        <property name="creditCardPayment"
ref="creditCardPaymentReference"/>
        <property name="emailGateway" ref="EmailGateway"/>
    </bean>

    <bean id="EmailGateway" class="scatours.emailgateway.EmailGatewayImpl">
    </bean>

</beans>

and a composite component...

    <component name="PaymentComponent">
        <implementation.spring location="Payment-context.xml"/>
        <service name="Payment">
            <interface.wsdl interface="
http://www.tuscanyscatours.com/Payment/#wsdl.interface(Payment)<http://www.tuscanyscatours.com/Payment/#wsdl.interface%28Payment%29>"
/>
            <binding.ws uri="http://localhost:8080/Payment"; wsdlElement="
http://www.tuscanyscatours.com/Payment/#wsdl.service(PaymentService)<http://www.tuscanyscatours.com/Payment/#wsdl.service%28PaymentService%29>
"/>
        </service>
        <reference name="creditCardPaymentReference">
            <binding.ws uri="http://localhost:8081/CreditCardPayment"/>
        </reference>
    </component>

Now the introspection that goes on inside SpringXMLComponentTypeLoader [2]
struggles as it doesn't have access to the information from the SCDL. It
introspects the bean to try and decide which fields shoulf be references and
which should be properties and it can't tell the difference. What I think
should be happing is that it should be looking back at the component in the
SCDL to see what has actually been defined as a reference and what has been
defined as a service and using this information to build the component type.
However there is a lot of code here so I'm loooking for someone familiar
with the implementation.spring code to tell me what I've missed.

Regards

Simon

[1]
http://svn.apache.org/repos/asf/tuscany/sandbox/travelsample/chapter-06/payment-spring-contribution/
[2]
http://svn.apache.org/repos/asf/tuscany/branches/sca-java-1.x/modules/implementation-spring/src/main/java/org/apache/tuscany/sca/implementation/spring/xml/SpringXMLComponentTypeLoader.java

Reply via email to