Spring In-depth, In Context

Susan Kerschbaumer & David Winterfeldt

Version 0.12 for Spring Framework 2.5.x


Table of Contents

Preface
1. Spring: Evolution Over Intelligent Design
2. A Little History
3. Goals of This Book
4. A Note about Format
I. Spring Core
1. Spring In Context: Core Concepts
1.1. Spring and Inversion of Control
1.2. Dependency Injection To The Rescue
1.3. Bean management through IoC
1.4. Our Example In Spring IoC
2. A Practical Introduction to Inversion of Control
2.1. Basic Bean Creation
2.2. Basic Constructor Injection
2.3. Basic Setter Injection
2.4. Reference Injection
2.5. Creating a Spring Application
2.6. Unit Test Beans from Application Context
2.7. Getting Started
3. In-depth Inversion of Control (IoC)
3.1. Bean Naming
3.2. Bean Creation
3.3. Constructor & Setter Injection
3.4. Multiple Parameter Constructor Injection
3.5. Collections
3.6. Bean Inheritance
3.7. Annotation-based Bean Creation
3.8. FactoryBean
3.9. Scope
3.10. Autowiring
3.11. Dependency Check
3.12. Events
3.13. BeanPostProcessors & BeanFactoryPostProcessors
4. Annotation-based Bean Configuration
4.1. Bean Creation
4.2. Dependency Injection
4.3. Lifecycle Events
4.4. IoC Container Configuration
5. Bean & Resource Loading
5.1. Resources
5.2. Application Contexts
6. AOP
6.1. Pointcuts & Advice
6.2. Load-time Weaving
6.3. Context Spring Configured
II. Middle Tier
III. Web Applications
7. GWT & Comet integration with Spring
7.1. GWT & with Spring on Jetty
7.2. GWT & Dojo Cometd Client with Spring Bayeux on Jetty
7.3. GWT & Dojo Cometd Client with Spring Bayeux on Tomcat with Embedded Jetty
IV. Enterprise
V. Spring dm Server
8. Spring dm Server & OSGi Basics
8.1. Basic OSGi Bundle & Web Module
A. Setup
A.1. Project Setup
Basic Setup
Eclipse IDE 3.4 Setup
General Eclipse IDE Setup
B. Author Bios
B.1. David Winterfeldt
Introduction
Technical Expertise
Experience
Sites & Blogs
Contact Info
B.2. Susan Kerschbaumer
Introduction

List of Tables

1.1. Dependency Injection Types
3.1. Scope Types
3.2. Autowiring Types
3.3. Dependency Check Types
4.1. Annotations from org.springframework.stereotype
4.2. Annotations from org.springframework.context.annotation
4.3. Annotations from org.springframework.beans.factory.annotation
4.4. Annotations from javax.annotation
4.5. Annotations from org.springframework.beans.factory.annotation
4.6. Annotations from javax.annotation
4.7. Annotations from org.springframework.core.annotation
4.8. Annotations from org.springframework.transaction.annotation
4.9. Annotations from org.springframework.jmx.export.annotation
4.10. Annotations from org.springframework.web.annotation
4.11. Annotations from org.springframework.web.servlet.mvc
4.12. Annotations from org.springframework.web.bind.annotation
4.13. Annotations from org.springframework.test.annotation and org.springframework.test.context
5.1. Resource Loaders
5.2. Resource Prefixes
6.1. Spring Supported Pointcuts
6.2. Spring Supported Advice
6.3. Pointcut Boolean Operators
6.4. Wildcards
6.5. Classloaders Auto-detected by Context Load-time Weaver

List of Examples

2.1. Basic Bean Creation
2.2. Basic Constructor Injection
2.3. Basic Setter Injection
2.4. Reference Setter Injection
2.5. Spring Application
2.6. Unit Test
3.1. Bean's Name Attribute and Aliasing
3.2. By Value using the Value Attribute
3.3. By Value using the Value Element
3.4. By Reference using the Ref Attribute
3.5. By Reference using the Ref Element
3.6. Inner Bean
3.7. Setter Injection using the p-namespace
3.8. Null and Empty Values
3.9. Nested Properties
3.10. Bad Bean Name Reference
3.11. IDREF Element
3.12. Bean Creation from a Static Field
3.13. Bean Creation from a Singleton Class
3.14. Multiple Parameter Constructor Injection
3.15. Multiple Parameter Constructor Injection with different Argument Types
3.16. Multiple Parameter Constructor Injection with indexed Arguments
3.17. List Element
3.18. List Factory
3.19. List Util
3.20. Set Element
3.21. Set Factory
3.22. Set Util
3.23. Map Element
3.24. Map Factory
3.25. Map Util
3.26. Props Element
3.27. Properties Factory
3.28. Properties Util
3.29. Java5 Generics Typed Collection
3.30. Java 5 Enums
3.31. Pre Java 5 Type-Safe Enums
3.32. Property Inheritance
3.33. Collection Inheritance
3.34. Annotation-based Bean Creation
3.35. DateFactoryBean
3.36. XML Configured Factory
3.37. Singleton & Prototype Scope
3.38. Annotation-based Scope
3.39. Custom Thread Scope
3.40. XML Autowiring
3.41. Annotation-based Autowiring
3.42. Lifecycle Event
3.43. Register Shutdown Hook
3.44. DoublerBeanPostProcessor
3.45. EvaluatorBeanPostProcessor
3.46. PropertyPlaceholderConfigurer
3.47. Context Namespace Property Placeholder
4.1. @Autowired Constructor
4.2. @Autowired Field
4.3. @Autowired Method
4.4. @Autowired Array
4.5. @Autowired Java 5 Type Collection
4.6. @Autowired Java 5 Type Map
4.7. @Autowired & @Qualifier Constructor
4.8. @Autowired & @Qualifier Field
4.9. @Autowired & @Qualifier Method
4.10. Simple Custom Qualifier
4.11. @Autowired & Simple Custom Qualifier Field
4.12. @Autowired & Simple Custom Qualifier Method
4.13. @Autowired & Custom Qualifier Field
4.14. @Autowired & Simple Custom Qualifier Method
4.15. @Autowired & CustomAutowireConfigurer
5.1. Defining a MessageSource
5.2. Importing XML Configuration Files
6.1. Load-time Weaving
6.2. Context Spring Configured
7.1. ChatService
7.2. Join Code Example (excerpt from AppBase.java)
7.3. Join Code Example (excerpt from App.java)
7.4. Join Code Example (excerpt from gwt-chat.js)
7.5. Send Code Example (excerpt from AppBase.java)
7.6. Send Code Example (excerpt from App.java)
7.7. Send Code Example (excerpt from gwt-chat.js)
7.8. Leave Code Example (excerpt from AppBase.java)
7.9. Leave Code Example (excerpt from App.java)
7.10. Leave Code Example (excerpt from gwt-chat.js)
7.11. TradeMonitorService Initialization
7.12. TradeMonitorService Publish Trades
7.13. Subscribe Code Example (excerpt from AppBase.java)
7.14. Subscribe Code Example (excerpt from App.java)
7.15. Subscribe Code Example (excerpt from monitor.js)
7.16. Display Trade Summary Code Example (excerpt from monitor.js)
7.17. Display Trade Summary Code Example (excerpt from AppBase.java)
7.18. Init Code Example (excerpt from monitor.js)
8.1. Message Service MessageService (version 1.0)
8.2. Message Service MessageServiceImpl (version 1.0)
8.3. Message Service MessageService (version 1.1)
8.4. Message Service MessageServiceImpl (version 1.1)
8.5. Mesage Service MessageController