This page describes the SCA component type derived from a Spring Application Context.

Spring Application Context structure

<beans>
   <bean id="xs:string" class="xs:string" scope="xs:string">*
      <property name="xs:string" value="xs:string"? ref="xs:string"?>*
         <value type="xs:string"?/>?
         <bean/>?
         <ref bean="xs:string"? local="xs:IDREF"? parent="xs:string"?/>?
         <idref bean="xs:string" local="xs:IDREF"?/>?
         <list/>?
         <map/>?
         <set/>?
         <lookup-method/>?
         <replaced-method/>?
      </property>
      <constructor-arg ref="xs:string"? index="xs:string" type="xs:string"? value="xs:string"?>*
         <value/>?
         <bean/>?
         <ref bean="xs:string"/>?
         <idref bean="xs:string"/>?
         <list/>?
         <map/>?
         <set/>?
         <props/>?
      </constructor-arg>
      <meta/>*
      <qualifier/>*
      <lookup-method/>*
      <replaced-method/>*
      <any/>*
   </bean>
</beans>

Names, IDs and Aliases

Beans have zero or one ID and zero or more Names. Where there is more than one name or ID, the others can be regarded as aliases to the same bean.
In addition, there may be formal <alias/> elements that provide further alias names for a given bean.
Beans may be referenced by ID or by one of its names & aliases.
<idref/> provides a reference to the ID of a Bean. This is equivalent to a value with the ID of a Bean.

Inner Beans

A <bean/> element within a <property/> or <constructor-arg/> element is termed an inner bean. Such beans are only available for injection into the bean which is the owner of the <property/> or <constructor-arg/> element. They cannot be referenced from some other bean.

Component Type of a Spring Application Context

Component Type of a Spring implementation is introspected from the content of the application context and its associated Spring Bean classes as follows:

a) Services

One <service/> element exists in the C.T. for each <sca:service/> element in the application context.

If there are no <service/> elements in the application context, each top-level <bean/> element in the application context results in one <service/> element in the C.T. for each service interface implemented by the bean.

b) References

One <reference/> element exists in the C.T. for each <sca:reference/> element in the application context.

In addition, each reference in the application context to a bean which does not exist in the application context results in a <reference/> element in the C.T.

c) Properties

One <property/> element exists in the C.T. for each <sca:property/> element in the application context.

Notes

  • Beans within properties are anonymous
  • Property values can be done by attribute or by child element
  • Placement and handling of <collectionElements/> needs work
  • <constructor-arg> elements inject via constructors
  • <properties> elements inject to fields or setter methods
  • No labels