Project

General

Profile

Spring Add-on » History » Version 6

Henning Blohm, 14.09.2012 12:10

1 1 Henning Blohm
h1. The Spring Framework Addon
2
3 2 Henning Blohm
The repository "z2-addons.spring":http://redmine.z2-environment.net/projects/z2-addons/repository/z2-addons-spring contains a pre-packaged version of the Spring framework of Version ABC.
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
Please check out [[sample-spring-basic]].
16
17
h2. Component Types
18
19
The Spring add-on defines two component types:
20
21
h3. Spring Application Contexts (*org.springframework.context*)
22
23 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.
24 4 Henning Blohm
25
Properties of a Spring Application Context Component:
26
27
|_. name |_. values |
28
|com.zfabrik.component.type |org.springframework.context|
29
|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.|
30
31
32
h3. Spring Beans (*org.springframework.bean*)
33
34
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.
35
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.
36
37
Properties of a Spring Bean Component:
38
|_. name |_. values |
39
|com.zfabrik.component.type|org.springframework.bean|
40
|bean.context|Name of the context component (of type org.springframework.context (see above) that defines the bean.|
41
|bean.name|Name of the bean in the context above|