E-Book, Englisch, 1104 Seiten
Mak / Rubio / Long Spring Recipes
2. ed
ISBN: 978-1-4302-2500-3
Verlag: Apress
Format: PDF
Kopierschutz: 1 - PDF Watermark
A Problem-Solution Approach
E-Book, Englisch, 1104 Seiten
ISBN: 978-1-4302-2500-3
Verlag: Apress
Format: PDF
Kopierschutz: 1 - PDF Watermark
The Spring framework is growing. It has always been about choice. Java EE focused on a few technologies, largely to the detriment of alternative, better solutions. When the Spring framework debuted, few would have agreed that Java EE represented the best-in-breed architectures of the day. Spring debuted to great fanfare, because it sought to simplify Java EE. Each release since marks the introduction of new features designed to both simplify and enable solutions. With version 2.0 and later, the Spring framework started targeting multiple platforms. The framework provided services on top of existing platforms, as always, but was decoupled from the underlying platform wherever possible. Java EE is a still a major reference point, but it's not the only target. OSGi (a promising technology for modular architectures) has been a big part of the SpringSource strategy here. Additionally, the Spring framework runs on Google App Engine. With the introduction of annotation-centric frameworks and XML schemas, SpringSource has built frameworks that effectively model the domain of a specific problem, in effect creating domain-specific languages (DSLs). Frameworks built on top of the Spring framework have emerged supporting application integration, batch processing, Flex and Flash integration, GWT, OSGi, and much more.
Gary Mak, founder and chief consultant of Meta-Archit Software Technology Limited, has been a technical architect and application developer on the enterprise Java platform for more than seven years. He is the author of the Apress books Spring Recipes: A Problem-Solution Approach and Pro SpringSource dm Server. In his career, Gary has developed a number of Java-based software projects, most of which are application frameworks, system infrastructures, and software tools. He enjoys designing and implementing the complex parts of software projects. Gary has a master's degree in computer science. His research interests include object-oriented technology, aspect-oriented technology, design patterns, software reuse, and domain-driven development. Gary specializes in building enterprise applications on technologies including Spring, Hibernate, JPA, JSF, Portlet, AJAX, and OSGi. He has been using the Spring Framework in his projects since Spring version 1.0. Gary has been an instructor of courses on enterprise Java, Spring, Hibernate, Web Services, and agile development. He has written a series of Spring and Hibernate tutorials as course materials, parts of which are open to the public, and they're gaining popularity in the Java community. In his spare time, he enjoys playing tennis and watching tennis competitions.
Autoren/Hrsg.
Weitere Infos & Material
1;Title Page;1
2;Copyright Page;2
3;Contents at a Glance;4
4;Table of Contents;6
5;About the Authors;37
6;About the Technical Reviewers;38
7;Acknowledgments;39
8;Introduction;41
8.1;Who This Book Is For;41
8.2;How This Book Is Structured;41
8.3;Conventions;43
8.4;Prerequisites;43
8.5;Downloading the code;44
8.6;Contacting the Authors;44
9;CHAPTER 1 Introduction to Spring;45
9.1;1-1. Instantiating the Spring IoC Container;45
9.1.1;Problem;45
9.1.2;Solution;45
9.1.3;How It Works;47
9.1.3.1;Instantiating an Application Context;47
9.1.3.2;Getting Beans from the IoC Container;47
9.2;1-2. Configuring Beans in the Spring IoC Container;48
9.2.1;Problem;48
9.2.2;Solution;48
9.2.3;How It Works;49
9.2.3.1;Creating the Bean Class;49
9.2.3.2;Creating the Bean Configuration File;50
9.2.3.3;Declaring Beans in the Bean Configuration File;50
9.2.3.4;Defining Bean Properties by Shortcut;51
9.2.3.5;Configuring Collections for Your Beans;52
9.2.3.6;Lists, Arrays, and Sets;52
9.2.3.7;Maps and Properties;55
9.3;1-3. Creating Beans by Invoking a Constructor;58
9.3.1;Problem;58
9.3.2;Solution;59
9.3.3;How It Works;59
9.4;1-4. Resolving Constructor Ambiguity;62
9.4.1;Problem;62
9.4.2;Solution;62
9.4.3;How It Works;62
9.5;1-5. Specifying Bean References;65
9.5.1;Problem;65
9.5.2;Solution;65
9.5.3;How It Works;65
9.5.3.1;Specifying Bean References for Setter Methods;66
9.5.3.2;Specifying Bean References for Constructor Arguments;68
9.5.3.3;Declaring Inner Beans;68
9.6;1-6. Specifying the Data Type for Collection Elements;69
9.6.1;Problem;69
9.6.2;Solution;69
9.6.3;How It Works;69
9.7;1-7. Creating Beans Using Spring’s FactoryBean;72
9.7.1;Problem;72
9.7.2;Solution;72
9.7.3;How It Works;72
9.8;1-8. Defining Collections Using Factory Beans and the Utility Schema;74
9.8.1;Problem;74
9.8.2;Solution;74
9.8.3;How It Works;74
9.8.3.1;Specifying the Concrete Class for Collections;74
9.8.3.2;Defining Stand-Alone Collections;75
9.9;1-9. Checking Properties with Dependency Checking;76
9.9.1;Problem;76
9.9.2;Solution;76
9.9.3;How It Works;77
9.9.3.1;Checking Properties of the Simple Types;77
9.9.3.2;Checking Properties of the Object Types;78
9.9.3.3;Checking Properties of All Types;78
9.9.3.4;Dependency Checking and Constructor Injection;79
9.10;1-10. Checking Properties with the @Required Annotation;79
9.10.1;Problem;79
9.10.2;Solution;79
9.10.3;How It Works;79
9.11;1-11. Auto-Wiring Beans with XML Configuration;82
9.11.1;Problem;82
9.11.2;Solution;82
9.11.3;How It Works;83
9.11.3.1;Auto-Wiring by Type;83
9.11.3.2;Auto-Wiring by Name;84
9.11.3.3;Auto-Wiring by Constructor;84
9.11.3.4;Auto-Wiring by Auto-Detection;85
9.11.3.5;Auto-Wiring and Dependency Checking;86
9.12;1-12. Auto-Wiring Beans with @Autowired and @Resource;86
9.12.1;Problem;86
9.12.2;Solution;86
9.12.3;How It Works;87
9.12.3.1;Auto-Wiring a Single Bean of Compatible Type;87
9.12.3.2;Auto-Wiring All Beans of Compatible Type;89
9.12.3.3;Auto-Wiring by Type with Qualifiers;90
9.12.3.4;Auto-Wiring by Name;92
9.13;1-13. Inheriting Bean Configuration;93
9.13.1;Problem;93
9.13.2;Solution;93
9.13.3;How It Works;94
9.14;1-14. Scanning Components from the Classpath;97
9.14.1;Problem;97
9.14.2;Solution;97
9.14.3;How It Works;97
9.14.3.1;Scanning Components Automatically;99
9.14.3.2;Filtering Components to Scan;101
9.14.3.3;Naming Detected Components;102
9.15;Summary;102
10;CHAPTER 2 Advanced Spring IoC Container;104
10.1;2-1. Creating Beans by Invoking a Static Factory Method;104
10.1.1;Problem;104
10.1.2;Solution;104
10.1.3;How It Works;104
10.2;2-2. Creating Beans by Invoking an Instance Factory Method;105
10.2.1;Problem;105
10.2.2;Solution;106
10.2.3;How It Works;106
10.3;2-3. Declaring Beans from Static Fields;107
10.3.1;Problem;107
10.3.2;Solution;107
10.3.3;How It Works;107
10.4;2-4. Declaring Beans from Object Properties;109
10.4.1;Problem;109
10.4.2;Solution;109
10.4.3;How It Works;109
10.5;2-5. Using the Spring Expression Language;111
10.5.1;Problem;111
10.5.2;Solution;111
10.5.3;How It Works;111
10.5.3.1;Features of the Language Syntax;112
10.5.3.2;Uses of the Language in Your Configurations;114
10.5.3.3;Using the Spring Expression Language Parser;115
10.6;2-6. Setting Bean Scopes;117
10.6.1;Problem;117
10.6.2;Solution;117
10.6.3;How It Works;117
10.7;2-7. Customizing Bean Initialization and Destruction;120
10.7.1;Problem;120
10.7.2;Solution;120
10.7.3;How It Works;120
10.7.3.1;Implementing the InitializingBean and DisposableBean Interfaces;122
10.7.3.2;Setting the init-method and destroy-method Attributes;123
10.7.3.3;Annotating the @PostConstruct and @PreDestroy Annotations;123
10.8;2-8. Reducing XML Configuration with Java Config;125
10.8.1;Problem;125
10.8.2;Solution;125
10.8.3;How It Works;125
10.9;2-9. Making Beans Aware of the Container;129
10.9.1;Problem;129
10.9.2;Solution;129
10.9.3;How It Works;130
10.10;2-10. Loading External Resources;131
10.10.1;Problem;131
10.10.2;Solution;131
10.10.3;How It Works;132
10.10.3.1;Resource Prefixes;133
10.10.3.2;Injecting Resources;133
10.11;2-11. Creating Bean Post Processors;134
10.11.1;Problem;134
10.11.2;Solution;134
10.11.3;How It Works;135
10.12;2-12. Externalizing Bean Configurations;138
10.12.1;Problem;138
10.12.2;Solution;138
10.12.3;How It Works;138
10.13;2-13. Resolving Text Messages;139
10.13.1;Problem;139
10.13.2;Solution;140
10.13.3;How It Works;140
10.14;2-14. Communicating with Application Events;142
10.14.1;Problem;142
10.14.2;Solution;142
10.14.3;How It Works;142
10.14.3.1;Defining Events;142
10.14.3.2;Publishing Events;143
10.14.3.3;Listening to Events;144
10.15;2-15. Registering Property Editors in Spring;145
10.15.1;Problem;145
10.15.2;Solution;145
10.15.3;How It Works;145
10.16;2-16. Creating Custom Property Editors;148
10.16.1;Problem;148
10.16.2;Solution;148
10.16.3;How It Works;148
10.17;2-17. Concurrency with TaskExecutors;150
10.17.1;Problem;150
10.17.2;Solution;150
10.17.3;How It Works;150
10.17.3.1;Java SE;150
10.17.3.2;Java EE;153
10.17.3.3;Spring’s Solution;154
10.18;Summary;159
11;CHAPTER 3 Spring AOP and AspectJ Support;160
11.1;3-1. Enabling AspectJ Annotation Support in Spring;160
11.1.1;Problem;160
11.1.2;Solution;161
11.1.3;How It Works;161
11.2;3-2. Declaring Aspects with AspectJ Annotations;163
11.2.1;Problem;163
11.2.2;Solution;163
11.2.3;How It Works;164
11.2.3.1;Before Advices;164
11.2.3.2;After Advices;166
11.2.3.3;After Returning Advices;166
11.2.3.4;After Throwing Advices;167
11.2.3.5;Around Advices;168
11.3;3-3. Accessing the Join Point Information;169
11.3.1;Problem;169
11.3.2;Solution;170
11.3.3;How It Works;170
11.4;3-4. Specifying Aspect Precedence;171
11.4.1;Problem;171
11.4.2;Solution;171
11.4.3;How It Works;171
11.5;3-5. Reusing Pointcut Definitions;173
11.5.1;Problem;173
11.5.2;Solution;173
11.5.3;How It Works;173
11.6;3-6. Writing AspectJ Pointcut Expressions;175
11.6.1;Problem;175
11.6.2;Solution;175
11.6.3;How It Works;176
11.6.3.1;Method Signature Patterns;176
11.6.3.2;Type Signature Patterns;178
11.6.3.3;Bean Name Patterns;179
11.6.3.4;Combining Pointcut Expressions;179
11.6.3.5;Declaring Pointcut Parameters;180
11.7;3-7. Introducing Behaviors to Your Beans;181
11.7.1;Problem;181
11.7.2;Solution;181
11.7.3;How It Works;181
11.8;3-8. Introducing States to Your Beans;184
11.8.1;Problem;184
11.8.2;Solution;184
11.8.3;How It Works;184
11.9;3-9. Declaring Aspects with XML-Based Configurations;186
11.9.1;Problem;186
11.9.2;Solution;186
11.9.3;How It Works;186
11.9.3.1;Declaring Aspects;187
11.9.3.2;Declaring Pointcuts;187
11.9.3.3;Declaring Advices;188
11.9.3.4;Declaring Introductions;188
11.10;3-10. Load-Time Weaving AspectJ Aspects in Spring;189
11.10.1;Problem;189
11.10.2;Solution;189
11.10.3;How It Works;190
11.10.3.1;Load-Time Weaving by the AspectJ Weaver;193
11.10.3.2;Load-Time Weaving by Spring Load-Time Weaver;194
11.11;3-11. Configuring AspectJ Aspects in Spring;195
11.11.1;Problem;195
11.11.2;Solution;195
11.11.3;How It Works;196
11.12;3-12. Injecting Spring Beans into Domain Objects;197
11.12.1;Problem;197
11.12.2;Solution;197
11.12.3;How It Works;197
11.13;Summary;201
12;CHAPTER 4 Scripting in Spring;202
12.1;19-1. Implementing Beans with Scripting Languages;202
12.1.1;Problem;202
12.1.2;Solution;202
12.1.3;How It Works;203
12.1.3.1;Scripting Beans with JRuby;203
12.1.3.2;Scripting Beans with Groovy;205
12.1.3.3;Scripting Beans with BeanShell;206
12.2;19-2. Injecting Spring Beans into Scripts;207
12.2.1;Problem;207
12.2.2;Solution;207
12.2.3;How It Works;207
12.2.3.1;Injecting Spring Beans into JRuby;209
12.2.3.2;Injecting Spring Beans into Groovy;209
12.2.3.3;Injecting Spring Beans into BeanShell;210
12.3;19-3. Refreshing Beans from Scripts;210
12.3.1;Problem;210
12.3.2;Solution;210
12.3.3;How It Works;211
12.4;19-4. Defining Script Sources Inline;211
12.4.1;Problem;211
12.4.2;Solution;211
12.4.3;How It Works;212
12.5;Summary;213
13;CHAPTER 5 Spring Security;214
13.1;5-1. Securing URL Access;215
13.1.1;Problem;215
13.1.2;Solution;215
13.1.3;How It Works;216
13.1.3.1;Setting Up a Spring MVC Application That Uses Spring Security;217
13.1.3.2;Creating the Configuration Files;218
13.1.3.3;Creating the Controllers and Page Views;220
13.1.3.4;Securing URL Access;223
13.2;5-2. Logging In to Web Applications;226
13.2.1;Problem;226
13.2.2;Solution;226
13.2.3;How It Works;226
13.2.3.1;HTTP Basic Authentication;226
13.2.3.2;Form-Based Login;227
13.2.3.3;The Logout Service;229
13.2.3.4;Anonymous Login;230
13.2.3.5;Remember-Me Support;230
13.3;5-3. Authenticating Users;230
13.3.1;Problem;230
13.3.2;Solution;231
13.3.3;How It Works;231
13.3.3.1;Authenticating Users with In-Memory Definitions;231
13.3.3.2;Authenticating Users Against a Database;232
13.3.3.3;Encrypting Passwords;235
13.3.3.4;Authenticating Users Against an LDAP Repository;237
13.3.3.5;Caching User Details;241
13.4;5-4. Making Access Control Decisions;242
13.4.1;Problem;242
13.4.2;Solution;243
13.4.3;How It Works;243
13.5;5-5. Securing Method Invocations;246
13.5.1;Problem;246
13.5.2;Solution;246
13.5.3;How It Works;246
13.5.3.1;Securing Methods by Embedding a Security Interceptor;246
13.5.3.2;Securing Methods with Pointcuts;247
13.5.3.3;Securing Methods with Annotations;248
13.6;5-6. Handling Security in Views;249
13.6.1;Problem;249
13.6.2;Solution;249
13.6.3;How It Works;249
13.6.3.1;Displaying Authentication Information;249
13.6.3.2;Rendering View Contents Conditionally;250
13.7;5-7. Handling Domain Object Security;251
13.7.1;Problem;251
13.7.2;Solution;251
13.7.3;How It Works;252
13.7.3.1;Setting Up an ACL Service;252
13.7.3.2;Maintaining ACLs for Domain Objects;255
13.7.3.3;Making Access Control Decisions Based on ACLs;257
13.7.3.4;Handling Domain Objects Returned from Methods;259
13.8;Summary;261
14;CHAPTER 6 Integrating Spring with Other Web Frameworks;262
14.1;6-1. Accessing Spring in Generic Web Applications;263
14.1.1;Problem;263
14.1.2;Solution;263
14.1.3;How It Works;263
14.2;6-2. Using Spring in Your Servlets and Filters;267
14.2.1;Problem;267
14.2.2;Solution;268
14.2.3;How It Works;268
14.2.3.1;Servlets;268
14.2.3.2;Filters;270
14.3;6-3. Integrating Spring with Struts 1.x;273
14.3.1;Problem;273
14.3.2;Solution;273
14.3.3;How It Works;274
14.3.3.1;Loading Spring’s Application Context into a Struts Application;275
14.3.3.2;Accessing Spring’s Application Context in Struts Actions;276
14.3.3.3;Declaring Struts Actions in Spring’s Bean Configuration File;278
14.4;6-4. Integrating Spring with JSF;280
14.4.1;Problem;280
14.4.2;Solution;280
14.4.3;How It Works;281
14.4.3.1;Resolving Spring Beans in JSF;285
14.4.3.2;Declaring JSF Managed Beans in Spring’s Bean Configuration File;286
14.5;6-5. Integrating Spring with DWR;287
14.5.1;Problem;287
14.5.2;Solution;287
14.5.3;How It Works;287
14.5.3.1;Exposing Spring Beans for Remote Invocation;289
14.5.3.2;Configuring DWR in Spring’s Bean Configuration File;290
14.6;Summary;291
15;CHAPTER 7 Spring Web Flow;292
15.1;7-1. Managing a Simple UI Flow with Spring Web Flow;292
15.1.1;Problem;292
15.1.2;Solution;292
15.1.3;How It Works;293
15.1.3.1;Setting Up a Spring MVC Application That Uses Spring Web Flow;294
15.1.3.2;Creating the Configuration Files;296
15.1.3.3;Creating Web Flow Definitions;299
15.1.3.4;Creating the Page Views;300
15.2;7-2. Modeling Web Flows with Different State Types;301
15.2.1;Problem;301
15.2.2;Solution;302
15.2.3;How It Works;302
15.2.3.1;Defining View States;305
15.2.3.2;Defining Action States;309
15.2.3.3;Defining Decision States;311
15.2.3.4;Defining End States;312
15.2.3.5;Defining Subflow States;313
15.3;7-3. Securing Web Flows;315
15.3.1;Problem;315
15.3.2;Solution;316
15.3.3;How It Works;316
15.4;7-4. Persisting Objects in Web Flows;318
15.4.1;Problem;318
15.4.2;Solution;318
15.4.3;How It Works;318
15.4.3.1;Configuring JPA in Spring’s Application Context;320
15.4.3.2;Setting Up JPA for Spring Web Flow;321
15.4.3.3;Using JPA in Web Flows;322
15.5;7-5. Integrating Spring Web Flow with JSF;326
15.5.1;Problem;326
15.5.2;Solution;326
15.5.3;How It Works;326
15.5.3.1;Rendering JSF Views for Spring Web Flow;326
15.5.3.2;Actions and ActionListeners;331
15.5.3.3;Using the JSF Components of Spring Faces;332
15.6;7-6. Using RichFaces with Spring Web Flow;334
15.6.1;Problem;334
15.6.2;Solution;334
15.6.3;Approach;334
15.6.3.1;Setting Up RichFaces With JSF;334
15.7;Summary;338
16;CHAPTER 8 Spring @MVC;339
16.1;8-1. Developing a Simple Web Application with Spring MVC;339
16.1.1;Problem;339
16.1.2;Solution;339
16.1.3;How It Works;341
16.1.3.1;Setting up a Spring MVC Application;343
16.1.3.2;Creating the Configuration Files;344
16.1.3.3;Activating Spring MVC annotation scanning;346
16.1.3.4;Creating Spring MVC Controllers;347
16.1.3.5;Creating JSP Views;350
16.1.3.6;Deploying the Web Application;352
16.2;8-2. Mapping requests with @RequestMapping;352
16.2.1;Problem;352
16.2.2;Solution;353
16.2.3;How It Works;353
16.2.3.1;Mapping requests by method;353
16.2.3.2;Mapping requests by class;354
16.2.3.3;Mapping requests by HTTP request type;355
16.3;8-3. Intercepting Requests with Handler Interceptors;356
16.3.1;Problem;356
16.3.2;Solution;357
16.3.3;How It Works;357
16.4;8-4. Resolving User Locales;360
16.4.1;Problem;360
16.4.2;Solution;361
16.4.3;How It Works;361
16.4.3.1;Resolving Locales by an HTTP Request Header;361
16.4.3.2;Resolving Locales by a Session Attribute;361
16.4.3.3;Resolving Locales by a Cookie;361
16.4.3.4;Changing a User’s Locale;362
16.5;8-5. Externalizing Locale-Sensitive Text Messages;363
16.5.1;Problem;363
16.5.2;Solution;363
16.5.3;How It Works;363
16.6;8-6. Resolving Views by Names;364
16.6.1;Problem;364
16.6.2;Solution;364
16.6.3;How It Works;365
16.6.3.1;Resolving Views Based on a template’s name and location;365
16.6.3.2;Resolving Views from an XML Configuration File;365
16.6.3.3;Resolving Views from a Resource Bundle;366
16.6.3.4;Resolving Views with Multiple Resolvers;366
16.6.3.5;The Redirect Prefix;367
16.7;8-7. Views and Content Negotiation;367
16.7.1;Problem;367
16.7.2;Solution;368
16.7.3;How It Works;368
16.8;8-8. Mapping Exceptions to Views;371
16.8.1;Problem;371
16.8.2;Solution;371
16.8.3;How It Works;371
16.9;8-9. Assigning values in a Controller with @Value;373
16.9.1;Problem;373
16.9.2;Solution;373
16.9.3;How It Works;373
16.10;8-10. Handling Forms with Controllers;375
16.10.1;Problem;375
16.10.2;Solution;375
16.10.3;How It Works;375
16.10.3.1;Creating a form’s views;376
16.10.3.2;Creating a form’s service processing;378
16.10.3.3;Creating a form’s controller;378
16.10.3.4;Initializing a model attribute object and pre-populating a form with values;380
16.10.3.5;Providing form Reference Data;382
16.10.3.6;Binding Properties of Custom Types;384
16.10.3.7;Validating Form Data;386
16.10.3.8;Expiring a controller’s Session Data;389
16.11;8-11. Handling Multipage Forms with Wizard Form Controllers;390
16.11.1;Problem;390
16.11.2;Solution;390
16.11.3;How It Works;391
16.11.3.1;Creating Wizard Form Pages;392
16.11.3.2;Creating a Wizard Form Controller;395
16.11.3.3;Validating Wizard Form Data;398
16.12;8-12. Bean validation with Annotations (JSR-303);401
16.12.1;Problem;401
16.12.2;Solution;401
16.12.3;How It Works;401
16.13;8-13. Creating Excel and PDF Views;404
16.13.1;Problem;404
16.13.2;Solution;404
16.13.3;How It Works;404
16.13.3.1;Creating Excel Views;406
16.13.3.2;Creating PDF Views;407
16.13.3.3;Creating resolvers for Excel and PDF views;409
16.13.3.4;Creating date based PDF and XLS file names;409
16.14;Summary;411
17;CHAPTER 9 Spring REST;412
17.1;9-1. Publishing a REST Service with Spring;412
17.1.1;Problem;412
17.1.2;Solution;412
17.1.3;How It Works;413
17.2;9-2. Accessing a REST Service with Spring;417
17.2.1;Problem;417
17.2.2;Solution;417
17.2.3;How It Works;418
17.3;9-3. Publishing RSS and Atom feeds;422
17.3.1;Problem;422
17.3.2;Solution;422
17.3.3;How It Works;423
17.4;9-4. Publishing JSON with REST services;432
17.4.1;Problem;432
17.4.2;Solution;432
17.4.3;How It Works;433
17.5;9-5. Accessing REST Services with Elaborate XML Responses;435
17.5.1;Problem;435
17.5.2;Solution;435
17.5.3;How It Works;435
17.6;Summary;445
18;CHAPTER 10 Spring and Flex;446
18.1;10-1. Getting started with Flex;447
18.1.1;Problem;447
18.1.2;Solution;448
18.1.3;How It Works;448
18.1.3.1;Flex Development Basics;448
18.1.3.2;The Tools;452
18.2;10-2. Leaving the Sandbox;453
18.2.1;Problem;453
18.2.2;Solution;453
18.2.3;How It Works;454
18.2.3.1;FlashVars;454
18.2.3.2;ExternalInterface;455
18.2.3.3;HTTP and HTTPS;458
18.2.3.4;Consuming SOAP Services;461
18.2.3.5;Flash Remoting with AMF;463
18.3;10-3. Adding the Spring BlazeDS support to an application;465
18.3.1;Problem;465
18.3.2;Solution;465
18.3.3;How It Works;466
18.3.3.1;Installing the Spring Support;466
18.4;10-4. Exposing Services Through BlazeDS / Spring;471
18.4.1;Problem;471
18.4.2;Solution;471
18.4.3;How It Works;471
18.5;10-5. Working With Server-Side Objects;478
18.5.1;Problem;478
18.5.2;Solution;478
18.5.3;How It Works;478
18.6;10-6. Consuming Message-Oriented Services Using BlazeDS and Spring;481
18.6.1;Problem;481
18.6.2;Solution;482
18.6.3;How It Works;482
18.6.3.1;JMS;485
18.6.3.2;Spring Integration;486
18.6.3.3;BlazeDS;491
18.6.3.4;Sending Messages from Flex;492
18.7;10-7. Bringing Dependency Injection to your ActionScript Client;493
18.7.1;Problem;493
18.7.2;Solution;494
18.7.3;How It Works;494
18.8;Summary;498
19;CHAPTER 11 Grails;499
19.1;11-1. Getting and Installing Grails;499
19.1.1;Problem;499
19.1.2;Solution;499
19.1.3;How It Works;500
19.2;11-2. Creating a Grails Application;500
19.2.1;Problem;500
19.2.2;Solution;501
19.2.3;How It Works;501
19.2.3.1;A Grails Application’s File and Directory Structure;502
19.2.3.2;Running an Application;503
19.2.3.3;Creating Your First Grails Application Construct;504
19.2.3.4;Exporting a Grails Application to a WAR;505
19.3;11-3. Grails Plug-Ins;506
19.3.1;Problem;506
19.3.2;Solution;506
19.3.3;How It Works;507
19.4;11-4. Developing, Producing, and Testing in Grails Environments;508
19.4.1;Problem;508
19.4.2;Solution;508
19.4.3;How It Works;508
19.5;11-5. Creating an Application’s Domain Classes;510
19.5.1;Problem;510
19.5.2;Solution;511
19.5.3;How It Works;511
19.6;11-6. Generating CRUD Controllers and Views for an Application’s Domain Classes;513
19.6.1;Problem;513
19.6.2;Solution;513
19.6.3;How It Works;513
19.7;11-7. Internationalization (I18n) Message Properties;517
19.7.1;Problem;517
19.7.2;Solution;517
19.7.3;How it works;517
19.8;11-8. Changing Permanent Storage Systems;520
19.8.1;Problem;520
19.8.2;Solution;520
19.8.3;How It Works;520
19.8.3.1;Setting Up an RDBMS Driver;521
19.8.3.2;Configuring an RDBMS Instance;521
19.9;11-9. Logging;523
19.9.1;Problem;523
19.9.2;Solution;523
19.9.3;How It Works;523
19.9.3.1;Configuring Custom Appenders and Loggers;524
19.9.3.2;Configuring Layouts;526
19.10;11-10. Running Unit and Integration Tests;526
19.10.1;Problem;526
19.10.2;Solution;526
19.10.3;How It Works;527
19.11;11-11. Using Custom Layouts and Templates;532
19.11.1;Problem;532
19.11.2;Solution;532
19.11.3;How It Works;532
19.12;11-12. Using GORM Queries;535
19.12.1;Problem;535
19.12.2;Solution;535
19.12.3;How It Works;535
19.13;11-13. Creating Custom Tags;537
19.13.1;Problem;537
19.13.2;Solution;537
19.13.3;How It Works;537
19.14;Summary;539
20;CHAPTER 12 Spring Roo;540
20.1;12-1. Setting Up the Spring Roo Development Environment;542
20.1.1;Problem;542
20.1.2;Solution;542
20.1.3;How It Works;542
20.1.3.1;Maven;543
20.1.3.2;SpringSource Tool Suite;543
20.1.3.3;Spring Roo;544
20.2;12-2. Creating Your First Spring Roo Project;545
20.2.1;Problem;545
20.2.2;Solution;545
20.2.3;How It Works;545
20.2.3.1;Exploring the Maven Project;548
20.2.3.2;Getting Started Using STS;549
20.3;12-3. Importing an Existing Project into SpringSource Tool Suite;551
20.3.1;Problem;551
20.3.2;Solution;551
20.3.3;How It Works;551
20.4;12-4. Building A Better Application, Quicker;553
20.4.1;Problem;553
20.4.2;Solution;554
20.4.3;How It Works;554
20.4.3.1;Coding the Backend;554
20.4.3.2;Coding the Front-end;558
20.5;12-5. Removing Spring Roo from Your Project;560
20.5.1;Problem;560
20.5.2;Solution;561
20.5.3;How It Works;561
20.6;Summary;562
21;CHAPTER 13 Spring Testing;563
21.1;13-1. Creating Tests with JUnit and TestNG;564
21.1.1;Problem;564
21.1.2;Solution;564
21.1.3;How It Works;564
21.1.3.1;Testing with JUnit 3;565
21.1.3.2;Testing with JUnit 4;567
21.1.3.3;Testing with TestNG;568
21.2;13-2. Creating Unit Tests and Integration Tests;570
21.2.1;Problem;570
21.2.2;Solution;570
21.2.3;How It Works;571
21.2.3.1;Creating Unit Tests for Isolated Classes;571
21.2.3.2;Creating Unit Tests for Dependent Classes Using Stubs and Mock Objects;574
21.2.3.3;Creating Integration Tests;579
21.3;13-3. Unit Testing Spring MVC Controllers;580
21.3.1;Problem;580
21.3.2;Solution;580
21.3.3;How It Works;580
21.4;13-4. Managing Application Contexts in Integration Tests;582
21.4.1;Problem;582
21.4.2;Solution;582
21.4.3;How It Works;583
21.4.3.1;Accessing the Context with JUnit 3 Legacy Support;583
21.4.3.2;Accessing the Context with the TestContext Framework in JUnit 4;585
21.4.3.3;Accessing the Context with the TestContext Framework in JUnit 3;587
21.4.3.4;Accessing the Context with the TestContext Framework in TestNG;587
21.5;13-5. Injecting Test Fixtures into Integration Tests;589
21.5.1;Problem;589
21.5.2;Solution;589
21.5.3;How It Works;589
21.5.3.1;Injecting Test Fixtures with JUnit 3 Legacy Support;589
21.5.3.2;Injecting Test Fixtures with the TestContext Framework in JUnit 4;590
21.5.3.3;Injecting Test Fixtures with the TestContext Framework in JUnit 3;591
21.5.3.4;Injecting Test Fixtures with the TestContext Framework in TestNG;592
21.6;13-6. Managing Transactions in Integration Tests;593
21.6.1;Problem;593
21.6.2;Solution;593
21.6.3;How It Works;594
21.6.3.1;Managing Transactions with JUnit 3 Legacy Support;595
21.6.3.2;Managing Transactions with the TestContext Framework in JUnit 4;596
21.6.3.3;Managing Transactions with the TestContext Framework in JUnit 3;598
21.6.3.4;Managing Transactions with the TestContext Framework in TestNG;599
21.7;13-7. Accessing a Database in Integration Tests;599
21.7.1;Problem;599
21.7.2;Solution;599
21.7.3;How It Works;600
21.7.3.1;Accessing a Database with JUnit 3 Legacy Support;600
21.7.3.2;Accessing a Database with the TestContext Framework;601
21.8;13-8. Using Spring’s Common Testing Annotations;603
21.8.1;Problem;603
21.8.2;Solution;603
21.8.3;How It Works;604
21.8.3.1;Using Common Testing Annotations with JUnit 3 Legacy Support;604
21.8.3.2;Using Common Testing Annotations with the TestContext Framework;605
21.9;Summary;606
22;CHAPTER 14 Spring Portlet MVC Framework;607
22.1;14-1. Developing a Simple Portlet with Spring Portlet MVC;607
22.1.1;Problem;607
22.1.2;Solution;607
22.1.3;How It Works;609
22.1.3.1;Setting Up a Portlet Application;609
22.1.3.2;Creating the Configuration Files;610
22.1.3.3;Creating Portlet Controllers;612
22.1.3.4;Resolving View Names into Views;614
22.1.3.5;Creating Portlet Views;614
22.1.3.6;Deploying the Portlet Application;615
22.2;14-2. Mapping Portlet Requests to Handlers;617
22.2.1;Problem;617
22.2.2;Solution;617
22.2.3;How It Works;617
22.2.3.1;Mapping Requests by the Portlet Mode;619
22.2.3.2;Mapping Requests by a Parameter;623
22.3;14-3. Handling Portlet Forms with Simple Form Controllers;625
22.3.1;Problem;625
22.3.2;Solution;625
22.3.3;How It Works;625
22.3.3.1;Creating Form Controllers;627
22.3.3.2;Validating Form Data;631
22.4;Summary;633
23;CHAPTER 15 Data Access;635
23.1;Problems with Direct JDBC;636
23.1.1;Setting Up the Application Database;636
23.1.2;Understanding the Data Access Object Design Pattern;638
23.1.3;Implementing the DAO with JDBC;638
23.1.4;Configuring a Data Source in Spring;640
23.1.5;How It Works;642
23.1.6;Running the DAO;643
23.1.7;Taking It A Step Further;644
23.2;15-1. Using a JDBC Template to Update a Database;644
23.2.1;Problem;644
23.2.2;Solution;645
23.2.3;How It Works;645
23.2.3.1;Updating a Database with a Statement Creator;645
23.2.3.2;Updating a Database with a Statement Setter;647
23.2.3.3;Updating a Database with a SQL Statement and Parameter Values;648
23.2.3.4;Batch Updating a Database;648
23.3;15-2. Using a JDBC Template to Query a Database;650
23.3.1;Problem;650
23.3.2;Solution;650
23.3.3;How It Works;650
23.3.3.1;Extracting Data with Row Callback Handler;650
23.3.3.2;Extracting Data with a Row Mapper;651
23.3.3.3;Querying for Multiple Rows;652
23.3.3.4;Querying for a Single Value;654
23.4;15-3. Simplifying JDBC Template Creation;655
23.4.1;Problem;655
23.4.2;Solution;655
23.4.3;How It Works;656
23.4.3.1;Injecting a JDBC Template;656
23.4.3.2;Extending the JdbcDaoSupport Class;657
23.5;15-4. Using the Simple JDBC Template with Java 1.5;658
23.5.1;Problem;658
23.5.2;Solution;658
23.5.3;How It Works;658
23.5.3.1;Using a Simple JDBC Template to Update a Database;658
23.5.3.2;Using a Simple JDBC Template to Query a Database;659
23.6;15-5. Using Named Parameters in a JDBC Template;662
23.6.1;Problem;662
23.6.2;Solution;662
23.6.3;How It Works;662
23.7;15-6. Handling Exceptions in the Spring JDBC Framework;664
23.7.1;Problem;664
23.7.2;Solution;664
23.7.3;How It Works;665
23.7.3.1;Understanding Exception Handling in the Spring JDBC Framework;665
23.7.3.2;Customizing Data Access Exception Handling;668
23.8;15-7. Problems with Using ORM Frameworks Directly;670
23.8.1;Problem;670
23.8.2;Solution;670
23.8.3;How It Works;670
23.8.4;Persisting Objects Using the Hibernate API with Hibernate XML Mappings;672
23.8.5;Persisting Objects Using the Hibernate API with JPA Annotations;675
23.8.6;Persisting Objects Using JPA with Hibernate as the Engine;677
23.9;15-8. Configuring ORM Resource Factories in Spring;681
23.9.1;Problem;681
23.9.2;Solution;681
23.9.3;How It Works;681
23.9.3.1;Configuring a Hibernate Session Factory in Spring;681
23.9.3.2;Configuring a JPA Entity Manager Factory in Spring;685
23.10;15-9. Persisting Objects with Spring’s ORM Templates;687
23.10.1;Problem;687
23.10.2;Solution;688
23.10.3;How It Works;688
23.10.3.1;Using a Hibernate Template and a JPA Template;688
23.10.3.2;Extending the Hibernate and JPA DAO Support Classes;692
23.11;15-10. Persisting Objects with Hibernate’s Contextual Sessions;694
23.11.1;Problem;694
23.11.2;Solution;694
23.11.3;How It Works;694
23.12;15-11. Persisting Objects with JPA’s Context Injection;697
23.12.1;Problem;697
23.12.2;Solution;697
23.12.3;How It Works;698
23.13;Summary;700
24;CHAPTER 16 Transaction Management in Spring;701
24.1;16-1. Problems with Transaction Management;702
24.1.1;Managing Transactions with JDBC Commit and Rollback;708
24.2;16-2. Choosing a Transaction Manager Implementation;709
24.2.1;Problem;709
24.2.2;Solution;709
24.2.3;How It Works;710
24.3;16-3. Managing Transactions Programmatically with the Transaction Manager API;711
24.3.1;Problem;711
24.3.2;Solution;711
24.3.3;How It Works;711
24.4;16-4. Managing Transactions Programmatically with a Transaction Template;713
24.4.1;Problem;713
24.4.2;Solution;713
24.4.3;How It Works;714
24.5;16-5. Managing Transactions Declaratively with Transaction Advices;716
24.5.1;Problem;716
24.5.2;Solution;717
24.5.3;How It Works;717
24.6;16-6. Managing Transactions Declaratively with the @Transactional Annotation;719
24.6.1;Problem;719
24.6.2;Solution;719
24.6.3;How It Works;720
24.7;16-7. Setting the Propagation Transaction Attribute;721
24.7.1;Problem;721
24.7.2;Solution;721
24.7.3;How It Works;722
24.7.3.1;The REQUIRED Propagation Behavior;724
24.7.3.2;The REQUIRES_NEW Propagation Behavior;726
24.7.3.3;Setting the Propagation Attribute in Transaction Advices, Proxies, and APIs;727
24.8;16-8. Setting the Isolation Transaction Attribute;727
24.8.1;Problem;727
24.8.2;Solution;727
24.8.3;How It Works;728
24.8.3.1;The READ_UNCOMMITTED and READ_COMMITTED Isolation Levels;730
24.8.3.2;The REPEATABLE_READ Isolation Level;733
24.8.3.3;The SERIALIZABLE Isolation Level;735
24.8.3.4;Setting the Isolation Level Attribute in Transaction Advices, Proxies, and APIs;736
24.9;16-9. Setting the Rollback Transaction Attribute;736
24.9.1;Problem;736
24.9.2;Solution;736
24.9.3;How It Works;737
24.10;16-10. Setting the Timeout and Read-Only Transaction Attributes;738
24.10.1;Problem;738
24.10.2;Solution;738
24.10.3;How It Works;738
24.11;16-11. Managing Transactions with Load-Time Weaving;739
24.11.1;Problem;739
24.11.2;Solution;740
24.11.3;How It Works;740
24.12;Summary;743
25;CHAPTER 17 EJB, Spring Remoting, and Web Services;744
25.1;17-1. Exposing and Invoking Services Through RMI;744
25.1.1;Problem;744
25.1.2;Solution;744
25.1.3;How It Works;745
25.1.3.1;Exposing an RMI Service;746
25.1.3.2;Invoking an RMI Service;747
25.2;17-2. Creating EJB 2.x Components with Spring;748
25.2.1;Problem;748
25.2.2;Solution;749
25.2.3;How It Works;749
25.2.3.1;Creating EJB 2.x Components Without Spring’s Support;750
25.2.3.2;Creating EJB 2.x Components with Spring’s Support;753
25.3;17-3. Accessing Legacy EJB 2.x Components in Spring;755
25.3.1;Problem;755
25.3.2;Solution;756
25.3.3;How It Works;756
25.3.3.1;Accessing EJB 2.x Components;757
25.4;17-4. Creating EJB 3.0 Components in Spring;760
25.4.1;Problem;760
25.4.2;Solution;760
25.4.3;How It Works;760
25.5;17-5. Accessing EJB 3.0 Components in Spring;762
25.5.1;Problem;762
25.5.2;Solution;762
25.5.3;How It Works;762
25.5.3.1;Accessing EJB 3.0 Components with Spring’s Support;762
25.6;17-6. Exposing and Invoking Services Through HTTP;764
25.6.1;Problem;764
25.6.2;Solution;764
25.6.3;How It Works;764
25.6.3.1;Exposing a Hessian Service;764
25.6.3.2;Invoking a Hessian Service;766
25.6.3.3;Exposing a Burlap Service;767
25.6.3.4;Invoking a Burlap Service;767
25.6.3.5;Exposing an HTTP Invoker Service;767
25.6.3.6;Invoking an HTTP Invoker Service;767
25.7;17-7. Choosing a SOAP Web Service Development Approach;768
25.7.1;Problem;768
25.7.2;Solution;768
25.7.3;How It Works;768
25.7.3.1;Contract-Last Web Services;768
25.7.3.2;Contract-First Web Services;769
25.7.3.3;Comparison;769
25.8;17-8. Exposing and Invoking a Contract-Last SOAP Web Services Using JAX-WS;770
25.8.1;Problem;770
25.8.2;Solution;770
25.8.3;How It Works;770
25.8.3.1;Exposing a Web Service Using The JAX-WS Endpoint Support in the JDK;771
25.8.3.2;Exposing a Web Service Using CXF;774
25.8.3.3;Invoking a Web Service Using CXF;776
25.9;17-9. Defining the Contract of a Web Service;777
25.9.1;Problem;777
25.9.2;Solution;777
25.9.3;How It Works;778
25.9.3.1;Creating Sample XML Messages;778
25.9.3.2;Generating an XSD File from Sample XML Messages;779
25.9.3.3;Optimizing the Generated XSD File;780
25.9.3.4;Previewing the Generated WSDL File;781
25.10;17-10. Implementing Web Services Using Spring-WS;782
25.10.1;Problem;782
25.10.2;Solution;782
25.10.3;How It Works;783
25.10.3.1;Setting Up a Spring-WS Application;783
25.10.3.2;Mapping Web Service Requests to Endpoints;784
25.10.3.3;Creating Service Endpoints;784
25.10.3.4;Publishing the WSDL File;787
25.11;17-11. Invoking Web Services Using Spring-WS;788
25.11.1;Problem;788
25.11.2;the contract. You want to use Spring-WS to create the service client.;788
25.11.3;How It Works;788
25.12;17-12. Developing Web Services with XML Marshalling;792
25.12.1;Problem;792
25.12.2;Solution;792
25.12.3;How It Works;793
25.12.3.1;Creating Service Endpoints with XML Marshalling;793
25.12.3.2;Invoking Web Services with XML Marshalling;797
25.13;17-13. Creating Service Endpoints with Annotations;798
25.13.1;Problem;798
25.13.2;Solution;798
25.13.3;How It Works;798
25.14;Summary;800
26;CHAPTER 18 Spring in the Enterprise;801
26.1;18-1. Exporting Spring Beans as JMX MBeans;801
26.1.1;Problem;801
26.1.2;Solution;802
26.1.3;How It Works;802
26.1.3.1;Registering MBeans Without Spring’s Support;805
26.1.3.2;Exporting Spring Beans as MBeans;807
26.1.3.3;Exposing MBeans for Remote Access;809
26.1.3.4;Assembling the Management Interface of MBeans;810
26.1.3.5;Auto-Detecting MBeans by Annotations;812
26.2;18-2. Publishing and Listening to JMX Notifications;814
26.2.1;Problem;814
26.2.2;Solution;814
26.2.3;How It Works;814
26.2.3.1;Publishing JMX Notifications;814
26.2.3.2;Listening to JMX Notifications;815
26.3;18-3. Accessing Remote JMX MBeans in Spring;816
26.3.1;Problem;816
26.3.2;Solution;816
26.3.3;How It Works;816
26.3.3.1;Accessing Remote MBeans Through an MBean Server Connection;816
26.3.3.2;Accessing Remote MBeans Through an MBean Proxy;818
26.4;18-4. Sending E-mail with Spring’s E-mail Support;819
26.4.1;Problem;819
26.4.2;Solution;820
26.4.3;How It Works;820
26.4.3.1;Sending E-mail Using the JavaMail API;821
26.4.3.2;Sending E-mail with Spring’s MailSender;823
26.4.3.3;Defining an E-mail Template;824
26.4.3.4;Sending MIME Messages;826
26.5;18-5. Scheduling with Spring’s Quartz Support;828
26.5.1;Problem;828
26.5.2;Solution;828
26.5.3;How It Works;828
26.5.3.1;Using Quartz Without Spring’s Support;828
26.5.3.2;Using Quartz with Spring’s Support;831
26.6;18-6. Scheduling With Spring 3.0’s Scheduling Namespace;833
26.6.1;Problem;833
26.6.2;Solution;833
26.6.3;How It Works;833
26.7;Summary;837
27;CHAPTER 19 Messaging;838
27.1;19-1. Sending and Receiving JMS Messages with Spring;839
27.1.1;Problem;839
27.1.2;Solution;839
27.1.3;How It Works;840
27.1.3.1;Sending and Receiving Messages Without Spring’s Support;841
27.1.3.2;Sending and Receiving Messages with Spring’s JMS Template;846
27.1.3.3;Sending and Receiving Messages to and from a Default Destination;849
27.1.3.4;Extending the JmsGatewaySupport Class;851
27.2;19-2. Converting JMS Messages;851
27.2.1;Problem;851
27.2.2;Solution;852
27.2.3;Approach;852
27.3;19-3. Managing JMS Transactions;854
27.3.1;Problem;854
27.3.2;Approach;854
27.3.3;Solution;854
27.4;19-4. Creating Message-Driven POJOs in Spring;856
27.4.1;Problem;856
27.4.2;Solution;856
27.4.3;How It Works;856
27.4.3.1;Listening for JMS Messages with Message Listeners;856
27.4.3.2;Listening for JMS Messages with POJOs;858
27.4.3.3;Converting JMS Messages;859
27.4.3.4;Managing JMS Transactions;861
27.4.3.5;Using Spring’s JMS Schema;861
27.5;19-5. Making the Connection;862
27.5.1;Problem;862
27.5.2;Solution;862
27.5.3;How It Works;863
27.6;Summary;863
28;CHAPTER 20 Spring Integration;864
28.1;20-1. Integrating One System with Another Using EAI;865
28.1.1;Problem;865
28.1.2;Solution;865
28.1.3;How It Works;866
28.1.3.1;Picking an Integration Style;866
28.1.3.2;Building on an ESB Solution;867
28.2;20-2. Integrating Two Systems Using JMS;868
28.2.1;Problem;868
28.2.2;Solution;868
28.2.3;How it Works;868
28.2.3.1;Building an Message Driven Pojo (MDP) Using Spring Integration;868
28.3;20-3. Interrogating Spring Integration Messages for Context Information;872
28.3.1;Problem;872
28.3.2;Solution;872
28.3.3;How it Works;873
28.3.3.1;Using MessageHeaders for Fun and Profit;873
28.4;20-4. Integrating Two Systems Using a File System;875
28.4.1;Problem;875
28.4.2;Solution;875
28.4.3;How It Works;876
28.4.3.1;Concerns in Dealing with a File System;876
28.5;20-5. Transforming a Message from One Type to Another;878
28.5.1;Problem;878
28.5.2;Solution;878
28.5.3;How It Works;878
28.5.3.1;Modifying a Message’s Payload;878
28.5.3.2;Modifying a Message’s Headers;881
28.6;20-6. Error Handling Using Spring Integration;881
28.6.1;Problem;881
28.6.2;Solution;882
28.6.3;How It Works;882
28.6.3.1;Routing to Custom Handlers Based on the Type of Exception;883
28.6.3.2;Building a Solution with Multiple Error Channels;884
28.7;20-7. Forking Integration Control: Splitters and Aggregators;884
28.7.1;Problem;884
28.7.2;Solution;884
28.7.3;How it Works;885
28.7.3.1;Using a Splitter;885
28.7.3.2;Using Aggregators;887
28.8;20-8. Conditional Routing with Routers;888
28.8.1;Problem;888
28.8.2;Solution;888
28.8.3;How It Works;888
28.9;20-9. Adapting External Systems to the Bus;889
28.9.1;Problem;889
28.9.2;Solution;889
28.9.3;How It Works;890
28.9.3.1;An Inbound Twitter Adapter;890
28.9.3.2;Twitter Messages;891
28.9.3.3;A Simple MessageSource;891
28.9.3.4;An Outbound Twitter Example;897
28.10;20-10. Staging Events Using Spring Batch;900
28.10.1;Problem;900
28.10.2;Solution;900
28.10.3;How It Works;900
28.11;20-11. Using Gateways;901
28.11.1;Problem;901
28.11.2;Solution;901
28.11.3;How It Works;902
28.11.3.1;SimpleMessagingGateway;902
28.11.3.2;Breaking the Interface Dependency;903
28.12;Summary;908
29;CHAPTER 21 Spring Batch;909
29.1;Runtime Metadata Model;910
29.2;21-1. Setting Up Spring Batch’s Infrastructure;911
29.2.1;Problem;911
29.2.2;Solution;911
29.2.3;How It Works;912
29.3;21-2. Reading and Writing (but No Arithmetic);914
29.3.1;Problem;914
29.3.2;Solution;914
29.3.3;How It Works;914
29.3.3.1;The Job Configuration;916
29.3.3.2;Input;917
29.3.3.3;Output;918
29.4;21-3. Writing a Custom ItemWriter and ItemReader;919
29.4.1;Problem;919
29.4.2;Solution;919
29.4.3;How It Works;919
29.4.3.1;Writing a Custom ItemReader;919
29.4.3.2;Writing a Custom ItemWriter;920
29.5;21-4. Processing Input Before Writing;922
29.5.1;Problem;922
29.5.2;Solution;922
29.5.3;How It Works;922
29.5.3.1;Chaining Processors Together;924
29.6;21-5. Better Living through Transactions;925
29.6.1;Problem;925
29.6.2;Solution;925
29.6.3;How It Works;925
29.6.3.1;Transactions;925
29.6.3.2;Rollbacks;926
29.7;21-6. Retrying;927
29.7.1;Problem;927
29.7.2;Solution;927
29.7.3;How It Works;927
29.7.3.1;Configuring a Step;927
29.7.3.2;Retry Template;928
29.7.3.3;AOP-Based Retries;930
29.8;21-7. Controlling Step Execution;930
29.8.1;Problem;930
29.8.2;Solution;930
29.8.3;How It Works;931
29.8.3.1;Sequential Steps;931
29.8.3.2;Concurrency;931
29.8.3.3;Conditional Steps with Statuses;932
29.8.3.4;Conditional Steps with Decisions;934
29.9;21-8. Launching a Job;934
29.9.1;Problem;934
29.9.2;Solution;935
29.9.3;How It Works;935
29.9.3.1;Launching From a Web Application;936
29.9.3.2;Running from the Command Line;936
29.9.3.3;Running On A Schedule;937
29.10;21-9. Parameterizing a Job;939
29.10.1;Problem;939
29.10.2;Solution;939
29.10.3;How It Works;939
29.10.3.1;Launching a Job with Parameters;939
29.10.3.2;Accessing JobParameters;940
29.11;Summary;941
30;CHAPTER 22 Spring on the Grid;942
30.1;22-1. Clustering Object State Using Terracotta;944
30.1.1;Problem;944
30.1.2;Solution;944
30.1.3;How It Works;944
30.1.3.1;Deploying a Simple Example with Terracotta;945
30.1.3.2;Terracotta Architecture and Deployment;950
30.1.3.3;The XML Configuration File;951
30.2;22-2. Farming Out Execution to a Grid;954
30.2.1;Problem;954
30.2.2;Solution;954
30.2.3;Approach;954
30.2.3.1;Deployment;955
30.3;22-3. Load Balancing a Method;956
30.3.1;Problem;956
30.3.2;Solution;956
30.3.3;Approach;956
30.4;22-4. Parallelizing Processing;960
30.4.1;Problem;960
30.4.2;Solution;960
30.4.3;Approach;960
30.5;22-5. Deploying on GridGain;962
30.5.1;Problem;962
30.5.2;Solution;962
30.5.3;How It Works;962
30.5.3.1;Creating a Grid Node;962
30.5.3.2;Provisioning a Grid Node;963
30.5.3.3;Getting Access to the Spring Container from a Task;964
30.5.3.4;Node-Specific GridGain Configuration;964
30.6;Summary;967
31;CHAPTER 23 jBPM and Spring;968
31.1;Software Processes;969
31.2;23-1. Understanding Workflow Models;972
31.2.1;Problem;972
31.2.2;Solution;972
31.2.3;How It Works;972
31.3;23-2. Installing jBPM;974
31.3.1;Problem;974
31.3.2;Solution;974
31.3.3;How It Works;974
31.4;23-3. Integrating jBPM 4 with Spring;977
31.4.1;Problem;977
31.4.2;Solution;977
31.4.3;How It Works;977
31.4.3.1;The Application Context;978
31.5;23-4. Building a Service with Spring;983
31.5.1;Problem;983
31.5.2;Solution;983
31.5.3;How It Works;983
31.6;23-5. Building a Business Process;986
31.6.1;Problem;986
31.6.2;Solution;987
31.6.3;How It Works;987
31.7;Summary;989
32;CHAPTER 24 OSGi and Spring;991
32.1;24-1. Getting Started with OSGi;992
32.1.1;Problem;992
32.1.2;Solution;992
32.1.3;How It Works;992
32.1.3.1;OSGi and JavaBeans;993
32.1.3.2;The helloworld-service Service;993
32.1.3.3;Installing Equinox;996
32.1.3.4;Using the Service in a Client Bundle;996
32.2;24-2. Getting Started Using Spring Dynamic Modules;999
32.2.1;Problem;999
32.2.2;Solution;999
32.2.3;How It Works;999
32.3;24-3. Exporting a Service Using Spring Dynamic Modules;1003
32.3.1;Problem;1003
32.3.2;Solution;1003
32.3.3;How It Works;1003
32.3.3.1;Interfacing with the OSGi Runtime;1005
32.4;24-4. Finding a Specific Service in the OSGi Registry;1007
32.4.1;Problem;1007
32.4.2;Solution;1007
32.4.3;How It Works;1007
32.4.3.1;Ranking;1007
32.4.3.2;Service Attributes;1008
32.4.3.3;Cardinality;1009
32.5;24-5. Publishing a Service Under Multiple Interfaces;1009
32.5.1;Problem;1009
32.5.2;Solution;1009
32.5.3;How It Works;1010
32.6;24-6. Customizing Spring Dynamic Modules;1011
32.6.1;Problem;1011
32.6.2;Solution;1011
32.6.3;How It Works;1011
32.6.3.1;Making Spring Process OSGi Annotations on Beans;1011
32.6.3.2;Changing the Default HTTP Server That Spring Uses When Deploying a .war;1012
32.7;24-7. Using SpringSource dm Server;1013
32.7.1;Problem;1013
32.7.2;Solution;1013
32.7.3;How It Works;1013
32.8;24-8. SpringSource’s Tooling;1014
32.8.1;Problem;1014
32.8.2;Solution;1014
32.8.3;How it Works;1015
32.9;Summary;1015
33;Index;1016




