Project

General

Profile

Spring Add-on » History » Revision 8

Revision 7 (Henning Blohm, 14.09.2012 12:13) → Revision 8/15 (Henning Blohm, 20.09.2012 17:09)

h1. The Spring Framework Addon 

 The Spring add-on provides a pre-packaged version of the Spring framework and some integration features. 

 h2. Repository 

 "z2-addons-spring":http://redmine.z2-environment.net/projects/z2-addons/repository/z2-addons-spring 

 h2. Howto 

 Please visit [[How to Spring]]. 

 h2. Samples 

 Please check out [[sample-spring-basic]]. 

 h2. Version map 

 |_. add-on version |_. Spring version | 
 | 2.1 | 3.1.2 3.0.5 | 


 h2. Details on com.zfabrik.springframework 

 Javadocs can be found here: "Javadocs":http://www.z2-environment.net/javadoc/com.zfabrik.springframework!2Fjava/api/index.html Component Types 

 The Spring add-on defines two component types: 

 h3. Spring Application Contexts (*org.springframework.context*) 

 As outlined in    [[How to Spring]], it can be useful to expose a Spring    application context as a z2 Component, either because you want to expose beans of the context as Z2 components for sharing across modules or because you want to initialize the application context based on worker process target state configuration or other Z2 life cycle functions. 

 Properties of a Spring Application Context Component: 

 |_. name |_. values | 
 |com.zfabrik.component.type |org.springframework.context| 
 |context.contextConfigLocation | Defines where to look for the context definition. If prefixed by classpath:, the module's Java component will be searched using a ClassPathXmlApplicationContext (see the Spring Framework documentation).Otherwise the location it will be supplied to FileSystemXmlApplicationContext (see the Spring Framework documentation) and will be search relative to the component's resource folder.| 


 h3. Spring Beans (*org.springframework.bean*) 

 The Spring bean component type exposes a Spring bean from a named application context component (see right before) as a Z2 component. See also above. 
 When asked for a specific implementation via the <code>IResourceHandle</code> interface (or equivalently via the <code>IComponentsLookup</code> interface), the component's resource implementation will simply check the bean class for compatibility and either return the bean instance, in case it can be casted, or return null, if it cannot be casted. 

 Properties of a Spring Bean Component: 
 |_. name |_. values | 
 |com.zfabrik.component.type|org.springframework.bean| 
 |bean.context|Name of the context component (of type org.springframework.context (see above) that defines the bean.| 
 |bean.name|Name of the bean in the context above|