Reference Documentation
Version 0.8
Rob Harrop, Steven Devijver, Costin Leau, Jan Machacek, Thierry Templier, Thomas
Risberg, Alex Ruiz, Uri Boness, Gurwinder Singh, Sergio Bossa, Omar Irbouh,
Juergen Hoeller, Dave Syer
Copyright Spring Modules Team (c) 2005 - 2007
Copies of this document may be made for your own use and for distribution to others, provided that you do not
charge any fee for such copies and further provided that each copy contains this Copyright Notice, whether
distributed in print or electronically.
Table of Contents
Preface.................................................................................................................................................
1. Introduction...................................................................................................................................
2. Ant Integration ..............................................................................................................................
2.1. Introduction..........................................................................................................................2
2.2. Setting up Spring Configuration.............................................................................................2
2.2.1. Overriding the BeanFactory locations ..........................................................................2
2.2.2. Example BeanFactory Configuration ...........................................................................2
2.3. Exposing a Spring Bean to Ant ..............................................................................................3
2.4. Evaluating an Expression on a Spring Bean in Ant ..................................................................3
2.5. Dependency Injection into a Custom Ant Task........................................................................4
2.6. Configuring Ant....................................................................................................................4
2.6.1. Definitions.................................................................................................................4
2.6.2. Classpath ...................................................................................................................4
2.6.3. Example ....................................................................................................................4
3. Caching..........................................................................................................................................
3.1. Introduction..........................................................................................................................6
3.2. Uses.....................................................................................................................................6
3.3. Configuration........................................................................................................................6
3.4. Cache Provider .....................................................................................................................7
3.4.1. EHCache ...................................................................................................................8
3.4.2. JBoss Cache...............................................................................................................8
3.4.3. Java Caching System (JCS).........................................................................................9
3.4.4. OSCache....................................................................................................................9
3.5. Declarative Caching Services.................................................................................................9
3.5.1. Caching Advice..........................................................................................................10
3.5.2. Caching Models .........................................................................................................10
3.5.3. Caching Listeners.......................................................................................................11
3.5.4. Key Generator............................................................................................................11
3.5.5. Flushing Advice.........................................................................................................11
3.5.6. Flushing Models.........................................................................................................11
3.6. Strategies for Declarative Caching Services ............................................................................12
3.6.1. CacheProxyFactoryBean.............................................................................................12
3.6.2. Source-level Metadata-driven Autoproxy.....................................................................13
3.6.3. BeanNameAutoProxyCreator......................................................................................16
3.7. Programmatic Use.................................................................................................................17
4. Commons Support .........................................................................................................................
4.1. Introduction..........................................................................................................................18
4.2. Commons Configuration integration.......................................................................................18
5. db4o ...............................................................................................................................................
5.1. Introduction..........................................................................................................................20
5.2. Configuration........................................................................................................................20
5.2.1. Configuring an ObjectContainer..................................................................................20
5.2.2. Configuring an
ObjectServer...................................................................................................................21
5.2.3. Using db4o's Configuration
object.............................................................................................................................21
5.3. Inversion of Control: Template and Callback ..........................................................................21
5.4. Transaction Management.......................................................................................................22
Spring ModulesVersion 0.8 ii
5.5. Outside the Spring container ..................................................................................................22
6. Flux................................................................................................................................................
6.1. Introduction..........................................................................................................................23
6.2. Exposing Flux as a Spring Bean.............................................................................................23
6.3. Getting Help .........................................................................................................................23
7. Hivemind Integration.....................................................................................................................
7.1. Introduction..........................................................................................................................24
7.2. Configure an Hivemind Registry............................................................................................24
7.3. Exposing HiveMind Services as Spring Beans ........................................................................24
8. JavaSpaces.....................................................................................................................................
8.1. Introduction..........................................................................................................................26
8.2. JavaSpaces configuration.......................................................................................................26
8.2.1. Using specialized classes ............................................................................................26
8.2.2. Using a generic Jini service.........................................................................................26
8.3. Inversion of Control: JavaSpaceTemplate and
JavaSpaceCallback....................................................................................................................27
8.4. Transaction Management.......................................................................................................27
8.5. Remoting: JavaSpaceInterceptor ............................................................................................28
8.6. GigaSpaces Spring Integration ...............................................................................................29
8.6.1. Simplifying Business Logic Abstraction ......................................................................29
8.6.2. Online Wiki Documentation........................................................................................29
GigaSpaces Spring Integration ..............................................................................................................
1. ...............................................................................................................................................30
2. ...............................................................................................................................................30
2.1.
Introduction – Give Spring Some Space..........................................................................30
2.2.
Integration Components.................................................................................................34
2.3.
Integration Implementation Classes................................................................................61
2.4.
Spring Configuration Files.............................................................................................70
2.5.
3rd party packages ........................................................................................................78
2.6.
References....................................................................................................................78
9. jBPM 3.1.x .....................................................................................................................................
9.1. Introduction..........................................................................................................................79
9.2. Configuration........................................................................................................................79
9.2.1. LocalJbpmConfigurationFactoryBean..........................................................................80
9.2.2. Inversion of Control: JbpmTemplate and JbpmCallback................................................80
9.2.3. ProcessDefinitionFactoryBean ....................................................................................80
9.2.4. Outside Spring container.............................................................................................81
9.3. Accessing Spring beans from jBPM actions ............................................................................81
10. Java Content Repository (JSR-170)..............................................................................................
10.1. Introduction ........................................................................................................................83
10.2. JSR standard support ...........................................................................................................83
10.2.1. SessionFactory .........................................................................................................83
10.2.2. Inversion of Control: JcrTemplate and JcrCallback .....................................................85
10.2.3. RepositoryFactoryBean.............................................................................................86
10.3. Extensions support ..............................................................................................................88
Spring Modules - Modules, add-ons and integration tools for
Spring ModulesVersion 0.8 iii
10.3.1. Transaction Manager ................................................................................................88
10.4. Mapping support .................................................................................................................89
10.5. Working with JSR-170 products...........................................................................................89
10.5.1. Alfresco...................................................................................................................90
10.5.2. Magnolia..................................................................................................................90
11. JSR94...........................................................................................................................................
11.1. Introduction ........................................................................................................................91
11.2. JSR94 support.....................................................................................................................91
11.2.1. Provider...................................................................................................................91
11.2.2. Administration .........................................................................................................92
11.2.3. Execution.................................................................................................................92
11.2.4. Definition of a ruleset ...............................................................................................93
11.2.5. Configure the JSR94 template ...................................................................................94
11.2.6. Using the JSR94 template .........................................................................................95
11.3. Configuration with different engines.....................................................................................96
11.3.1. JRules......................................................................................................................96
11.3.2. Jess..........................................................................................................................97
11.3.3. Drools......................................................................................................................98
12. Lucene..........................................................................................................................................
12.1. Introduction ........................................................................................................................99
12.2. Indexing .............................................................................................................................99
12.2.1. Root entities.............................................................................................................99
12.2.2. Configuration...........................................................................................................101
12.2.3. Document type handling ...........................................................................................102
12.2.4. Template approach ...................................................................................................105
12.2.5. Mass indexing approach............................................................................................109
12.3. Search ................................................................................................................................114
12.3.1. Root entities.............................................................................................................114
12.3.2. Configuration...........................................................................................................115
12.3.3. Template approach ...................................................................................................116
12.3.4. Object approach .......................................................................................................118
13. Apache OJB ................................................................................................................................
13.1. OJB setup in a Spring environment.......................................................................................120
13.2. PersistenceBrokerTemplate and
PersistenceBrokerDaoSupport ...................................................................................................120
13.3. Transaction management .....................................................................................................121
14. O/R Broker ..................................................................................................................................
14.1. Introduction ........................................................................................................................123
14.2. Setting up the Broker...........................................................................................................123
14.3. BrokerTemplate and BrokerDaoSupport ...............................................................................124
14.4. Implementing DAOs based on plain O/R Broker API ............................................................125
15. OSWorkflow ................................................................................................................................
15.1. Introduction ........................................................................................................................126
15.2. Configuration......................................................................................................................126
15.3. Inversion of Control: OsWorkflowTemplate and
OsWorkflowCallback................................................................................................................126
15.4. Working with workflow instances ........................................................................................127
15.5. Acegi integration.................................................................................................................127
15.6. OSWorkflow 2.8+ support ...................................................................................................128
16. Spring MVC extra........................................................................................................................
16.1. About .................................................................................................................................130
16.2. Usage guide ........................................................................................................................130
Spring Modules - Modules, add-ons and integration tools for
Spring ModulesVersion 0.8 iv
16.2.1. Using the ReflectivePropertyEditor............................................................................130
16.2.2. Using the ReflectiveCollectionEditor.........................................................................130
16.2.3. Using EnhancedSimpleFormController and
EnhancedAbstractWizardFormController .........................................................................130
16.2.4. Using the FullPathUrlFilenameViewController...........................................................131
16.2.5. Using the AbstractRssView.......................................................................................132
17. Validation.....................................................................................................................................
17.1. Commons Validator ............................................................................................................133
17.1.1. Configure an Validator Factory .................................................................................133
17.1.2. Use a dedicated validation-rules.xml..........................................................................133
17.1.3. Configure a Commons Validator ...............................................................................134
17.1.4. Server side validation................................................................................................134
17.1.5. Partial Bean Validation Support.................................................................................135
17.1.6. Client side validation ................................................................................................136
17.2. Valang................................................................................................................................136
17.2.1. Valang Syntax..........................................................................................................138
17.2.2. Valang Validator Support..........................................................................................143
17.2.3. Client Side Validation...............................................................................................144
17.3. Bean Validation Framework.................................................................................................147
17.3.1. Introduction .............................................................................................................147
17.3.2. Using the Framework................................................................................................149
17.3.3. Future Directions......................................................................................................167
18. XT Framework.............................................................................................................................
18.1. About XT Framework..........................................................................................................169
18.1.1. XT Modeling Framework..........................................................................................169
18.1.2. XT Ajax Framework.................................................................................................170
18.2. XT Modeling Framework ....................................................................................................170
18.2.1. Introduction .............................................................................................................170
18.2.2. Base Concepts..........................................................................................................170
18.2.3. Advanced Concepts ..................................................................................................177
18.3. XT Ajax Framework............................................................................................................178
18.3.1. Introduction .............................................................................................................178
18.3.2. Base Concepts..........................................................................................................179
18.3.3. Advanced Concepts ..................................................................................................186
18.3.4. Tutorials ..................................................................................................................187
Spring
Spring ModulesVersion 0.8 v
- 1
- 2
- 3
前往页