Project

General

Profile

Spring Add-on » History » Version 8

Henning Blohm, 20.09.2012 17:09

1 1 Henning Blohm
h1. The Spring Framework Addon
2
3 7 Henning Blohm
The Spring add-on provides a pre-packaged version of the Spring framework and some integration features.
4 1 Henning Blohm
5 6 Henning Blohm
h2. Repository
6
7
"z2-addons-spring":http://redmine.z2-environment.net/projects/z2-addons/repository/z2-addons-spring
8
9 4 Henning Blohm
h2. Howto
10 1 Henning Blohm
11 4 Henning Blohm
Please visit [[How to Spring]].
12
13
h2. Samples
14
15 1 Henning Blohm
Please check out [[sample-spring-basic]].
16 7 Henning Blohm
17
h2. Version map
18
19
|_. add-on version |_. Spring version |
20 8 Henning Blohm
| 2.1 | 3.1.2 |
21 7 Henning Blohm
22 1 Henning Blohm
23 8 Henning Blohm
h2. Details on com.zfabrik.springframework
24
25
Javadocs can be found here: "Javadocs":http://www.z2-environment.net/javadoc/com.zfabrik.springframework!2Fjava/api/index.html
26 4 Henning Blohm
27
The Spring add-on defines two component types:
28
29
h3. Spring Application Contexts (*org.springframework.context*)
30
31 5 Henning Blohm
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.
32 4 Henning Blohm
33
Properties of a Spring Application Context Component:
34
35
|_. name |_. values |
36
|com.zfabrik.component.type |org.springframework.context|
37
|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.|
38
39
40
h3. Spring Beans (*org.springframework.bean*)
41
42
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.
43
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.
44
45
Properties of a Spring Bean Component:
46
|_. name |_. values |
47
|com.zfabrik.component.type|org.springframework.bean|
48
|bean.context|Name of the context component (of type org.springframework.context (see above) that defines the bean.|
49
|bean.name|Name of the bean in the context above|