Spring Implementation support of Services isn't compliant with the Specification
--------------------------------------------------------------------------------

                 Key: TUSCANY-2258
                 URL: https://issues.apache.org/jira/browse/TUSCANY-2258
             Project: Tuscany
          Issue Type: Bug
          Components: Java SCA Spring Implementation Extension
         Environment: Not Specific, but current environment is Windows
            Reporter: Kapish Aggarwal


Based on the specification (verbatim from PDF below):

Each <service> element used with <implementation.spring> should include the 
name of the Spring bean
that is to be exposed as an SCA service in its name attribute. So, for Spring, 
the name attribute of a
service plays two roles: it identifies a Spring bean, and it names the service 
for the component. The service
element above has a name of "X", so there should be a Spring bean with that 
name.

This means in a component using implementation.spring, the "name" attribute of 
the service should be based on the value of the "id" attribute of the 
corresponding bean in the Spring context file. However, since Spring 
Implementation code piggybacks on the Java Introspection, it should the Java 
interface name instead. The SpringBeanIntrospector class's introspectBean 
method simply uses the Java implementation introspection and just copies the 
Services, References, and Properties directly over to the componentType object 
for the Spring Implementation. There needs to be some processing to ensure that 
the service is named based on the bean. I am unsure if the references and 
properties need have some extra processing involved either.

Example below:

Spring Context:
<bean id="testBean" class="test.spring.HelloWorldBean">
</bean>

Component Element from Composite Should Be (This does not work):
    <component name="SpringComponent">
        <implementation.spring 
location="META-INF/SpringHelloWorld-context.xml"/>
        <service name="testBean">
            <interface.java interface="test.spring.HelloWorld"/>
        </service>
    </component>

Component  Element from Composite Actually Is (This works):
    <component name="SpringComponent">
        <implementation.spring 
location="META-INF/SpringHelloWorld-context.xml"/>
        <service name="HelloWorld">
            <interface.java interface="test.spring.HelloWorld"/>
        </service>
    </component>

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to