Spring Bean Configuration Files

When you generate the implementation for a Spring component, TIBCO Business Studio generates the Spring Bean configuration file containing information to access the services, references, and properties of the component.

Note: The only changes you should make to a generated Spring Bean configuration file are to import existing Spring Beans.

Limitations

Spring Bean configuration files:
  • Do not support the sca:composite tag (that is, it does not support exposing the Spring application context as a composite.
  • Do not support application context XML locations (and their resolution) such as inside JARs or directories.
  • Include TIBCO Business Studio tags, such as tibco:service-metadata, are added for supporting TIBCO ActiveMatrix design-time metadata.

The following XML snippets illustrate the contents of a Spring Bean configuration file for a Spring component with a HelloWorld service, Date Manager reference, and a SpringGreeting property.

Define Namespace

<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://www.springframework.org/schema/beans"
xmlns:context="http://www.springframework.org/schema/context" xmlns:sca="http://www.springframework.org/schema/sca"
xmlns:tibco="http://xsd.tns.tibco.com/2008/amf/extension/spring" 
xsi:schemaLocation="http://xsd.tns.tibco.com/2008/amf/extension/spring 
http://xsd.tns.tibco.com/schema/sca/tibco-ext-spring-sca.xsd 
http://www.springframework.org/schema/sca 
http://www.osoa.org/xmlns/sca/1.0/spring-sca.xsd 
http://www.springframework.org/schema/context 
http://www.springframework.org/schema/context/spring-context.xsd 
http://www.springframework.org/schema/beans 
http://www.springframework.org/schema/beans/spring-beans.xsd">

Bean Definition

<bean id="HelloWorldPTBean" class="com.tibco.ns.hello.HelloWorldPTImpl"
		destroy-method="destroy" init-method="init">
  <property name="springGreeting" ref="SpringGreeting" />
</bean>

Component Services

Component services are declared in an SCA service tag and tibco:service-metadata tag. For example:
	<sca:service name="HelloWorldPT" target="HelloWorldPTBean"
		type="com.tibco.ns.hello.HelloWorldPT" />
<tibco:service-metadata name="HelloWorldPT"
	wsdl-location="/jv.helloworld4.svcs/Service Descriptors/HelloWorld2.wsdl"
	wsdl-interface="http://ns.tibco.com/hello/#HelloWorldPT" />

Component References

The component references are declared in an SCA reference tag and tibco:reference-metadata tag. For example:
<sca:reference name="DateManagerPT" type="com.tibco.ns.date.DateManagerPT" />
<tibco:reference-metadata name="DateManagerPT"
	target="HelloWorldPTBean" wsdl-location="/jv.helloworld4.svcs/Service Descriptors/DateManager.wsdl"
	wsdl-interface="http://ns.tibco.com/date/#DateManagerPT" />

Component Properties

Component properties are declared in an SCA property tag. For example:
<sca:property id="SpringGreeting" name="SpringGreeting" type="java.lang.String" />
</beans>