Spring Enterprise Recipes: A Problem-Solution Approach

Book description

Build Spring enterprise and Java EE applications from the ground up using Recipes from this book as templates to get you started, fast. Employ Spring Integration, Spring Batch and more for your enterprise applications.

Table of contents

  1. Copyright
  2. About the Authors
  3. About the Technical Reviewer
  4. Acknowledgments
  5. Introduction
    1. Who This Book Is For
    2. How This Book Is Structured
    3. Conventions
    4. Prerequisites
    5. Downloading the Code
    6. Contacting the Authors
  6. 1. Introduction to Spring
    1. 1.1. Instantiating the Spring IoC Container
      1. 1.1.1. Problem
      2. 1.1.2. Solution
      3. 1.1.3. How It Works
        1. 1.1.3.1. Instantiating an Application Context
        2. 1.1.3.2. Getting Beans from the IoC Container
    2. 1.2. Configuring Beans in the Spring IoC Container
      1. 1.2.1. Problem
      2. 1.2.2. Solution
      3. 1.2.3. How It Works
        1. 1.2.3.1. Creating the Bean Class
        2. 1.2.3.2. Creating the Bean Configuration File
        3. 1.2.3.3. Declaring Beans in the Bean Configuration File
        4. 1.2.3.4. Defining Bean Properties by Shortcut
        5. 1.2.3.5. Configuring Collections for Your Beans
        6. 1.2.3.6. Lists, Arrays, and Sets
        7. 1.2.3.7. Maps and Properties
    3. 1.3. Auto-Wiring Beans with XML Configuration
      1. 1.3.1. Problem
      2. 1.3.2. Solution
      3. 1.3.3. How It Works
        1. 1.3.3.1. Auto-Wiring by Type
        2. 1.3.3.2. Auto-Wiring by Name
        3. 1.3.3.3. Auto-Wiring by Constructor
        4. 1.3.3.4. Auto-Wiring by Auto-Detection
        5. 1.3.3.5. Auto-Wiring and Dependency Checking
    4. 1.4. Auto-Wiring Beans with @Autowired and @Resource
      1. 1.4.1. Problem
      2. 1.4.2. Solution
      3. 1.4.3. How It Works
        1. 1.4.3.1. Auto-Wiring a Single Bean of Compatible Type
        2. 1.4.3.2. Auto-Wiring All Beans of Compatible Type
        3. 1.4.3.3. Auto-Wiring by Type with Qualifiers
        4. 1.4.3.4. Auto-Wiring by Name
    5. 1.5. Scanning Components from the Classpath
      1. 1.5.1. Problem
      2. 1.5.2. Solution
      3. 1.5.3. How It Works
        1. 1.5.3.1. Scanning Components Automatically
        2. 1.5.3.2. Filtering Components to Scan
        3. 1.5.3.3. Naming Detected Components
    6. 1.6. Setting Bean Scopes
      1. 1.6.1. Problem
      2. 1.6.2. Solution
      3. 1.6.3. How It Works
    7. 1.7. Customizing Bean Initialization and Destruction
      1. 1.7.1. Problem
      2. 1.7.2. Solution
      3. 1.7.3. How It Works
        1. 1.7.3.1. Implementing the InitializingBean and DisposableBean Interfaces
        2. 1.7.3.2. Setting the init-method and destroy-method Attributes
        3. 1.7.3.3. Annotating the @PostConstruct and @PreDestroy Annotations
    8. 1.8. Resolving Text Messages
      1. 1.8.1. Problem
      2. 1.8.2. Solution
      3. 1.8.3. How It Works
    9. 1.9. Loading External Resources
      1. 1.9.1. Problem
      2. 1.9.2. Solution
      3. 1.9.3. How It Works
        1. 1.9.3.1. Resource Prefixes
        2. 1.9.3.2. Injecting Resources
    10. 1.10. Enabling AspectJ Annotation Support in Spring
      1. 1.10.1. Problem
      2. 1.10.2. Solution
      3. 1.10.3. How It Works
    11. 1.11. Declaring Aspects with AspectJ Annotations
      1. 1.11.1. Problem
      2. 1.11.2. Solution
      3. 1.11.3. How It Works
        1. 1.11.3.1. Before Advices
        2. 1.11.3.2. After Advices
        3. 1.11.3.3. After Returning Advices
        4. 1.11.3.4. After Throwing Advices
        5. 1.11.3.5. Around Advices
    12. 1.12. Reusing Pointcut Definitions
      1. 1.12.1. Problem
      2. 1.12.2. Solution
      3. 1.12.3. How It Works
    13. 1.13. Writing AspectJ Pointcut Expressions
      1. 1.13.1. Problem
      2. 1.13.2. Solution
      3. 1.13.3. How It Works
        1. 1.13.3.1. Method Signature Patterns
        2. 1.13.3.2. Type Signature Patterns
        3. 1.13.3.3. Bean Name Patterns
        4. 1.13.3.4. Combining Pointcut Expressions
        5. 1.13.3.5. Declaring Pointcut Parameters
    14. 1.14. Introducing Behaviors to Your Beans
      1. 1.14.1. Problem
      2. 1.14.2. Solution
      3. 1.14.3. How It Works
    15. 1.15. Introducing States to Your Beans
      1. 1.15.1. Problem
      2. 1.15.2. Solution
      3. 1.15.3. How It Works
    16. 1.16. Summary
  7. 2. What's New in Spring 3.0?
    1. 2.0. Upgrades to the SpringSource Portfolio
    2. 2.1. Getting Started with the Latest and Greatest Spring Framework
      1. 2.1.1. Problem
      2. 2.1.2. Solution
      3. 2.1.3. How It Works
    3. 2.2. Using Java 5 Syntax in Spring
      1. 2.2.1. Problem
      2. 2.2.2. Solution
      3. 2.2.3. How It Works
        1. 2.2.3.1. BeanFactory and FactoryBean
        2. 2.2.3.2. ApplicationContext Events
    4. 2.3. Achieving Concurrency with TaskExecutors
      1. 2.3.1. Problem
      2. 2.3.2. Solution
      3. 2.3.3. How It Works
        1. 2.3.3.1. Java SE
        2. 2.3.3.2. Java EE
        3. 2.3.3.3. Spring's Solution
    5. 2.4. Using the Spring Expression Language
      1. 2.4.1. Problem
      2. 2.4.2. Solution
      3. 2.4.3. How It Works
        1. 2.4.3.1. Features of the Language Syntax
        2. 2.4.3.2. Uses of the Language in Your Configurations
        3. 2.4.3.3. Using the Spring Expression Language Parser
    6. 2.5. My Code Doesn't Compile!
      1. 2.5.1. Problem
      2. 2.5.2. Solution
      3. 2.5.3. How It Works
    7. 2.6. Reducing XML Configuration with Java Config
      1. 2.6.1. Problem
      2. 2.6.2. Solution
      3. 2.6.3. How It Works
    8. 2.7. Summary
  8. 3. Data Access
    1. 3.0. Problems with Direct JDBC
      1. 3.0.1. Setting Up the Application Database
      2. 3.0.2. Understanding the Data Access Object Design Pattern
      3. 3.0.3. Implementing the DAO with JDBC
      4. 3.0.4. Configuring a Data Source in Spring
      5. 3.0.5. Running the DAO
    2. 3.1. Using a JDBC Template to Update a Database
      1. 3.1.1. Problem
      2. 3.1.2. Solution
      3. 3.1.3. How It Works
        1. 3.1.3.1. Updating a Database with a Statement Creator
        2. 3.1.3.2. Updating a Database with a Statement Setter
        3. 3.1.3.3. Updating a Database with a SQL Statement and Parameter Values
        4. 3.1.3.4. Batch Updating a Database
    3. 3.2. Using a JDBC Template to Query a Database
      1. 3.2.1. Problem
      2. 3.2.2. Solution
      3. 3.2.3. How It Works
        1. 3.2.3.1. Extracting Data with a Row Callback Handler
        2. 3.2.3.2. Extracting Data with a Row Mapper
        3. 3.2.3.3. Querying for Multiple Rows
        4. 3.2.3.4. Querying for a Single Value
    4. 3.3. Simplifying JDBC Template Creation
      1. 3.3.1. Problem
      2. 3.3.2. Solution
      3. 3.3.3. How It Works
        1. 3.3.3.1. Injecting a JDBC Template
        2. 3.3.3.2. Extending the JdbcDaoSupport Class
    5. 3.4. Using the Simple JDBC Template with Java 1.5
      1. 3.4.1. Problem
      2. 3.4.2. Solution
      3. 3.4.3. How It Works
        1. 3.4.3.1. Using a Simple JDBC Template to Update a Database
        2. 3.4.3.2. Using a Simple JDBC Template to Query a Database
    6. 3.5. Using Named Parameters in a JDBC Template
      1. 3.5.1. Problem
      2. 3.5.2. Solution
      3. 3.5.3. How It Works
    7. 3.6. Handling Exceptions in the Spring JDBC Framework
      1. 3.6.1. Problem
      2. 3.6.2. Solution
      3. 3.6.3. How It Works
        1. 3.6.3.1. Understanding Exception Handling in the Spring JDBC Framework
        2. 3.6.3.2. Customizing Data Access Exception Handling
    8. 3.7. Problems with Using ORM Frameworks Directly
      1. 3.7.1. Persisting Objects Using the Hibernate API with Hibernate XML Mappings
      2. 3.7.2. Persisting Objects Using the Hibernate API with JPA Annotations
      3. 3.7.3. Persisting Objects Using JPA with Hibernate as the Engine
    9. 3.8. Configuring ORM Resource Factories in Spring
      1. 3.8.1. Problem
      2. 3.8.2. Solution
      3. 3.8.3. How It Works
        1. 3.8.3.1. Configuring a Hibernate Session Factory in Spring
        2. 3.8.3.2. Configuring a JPA Entity Manager Factory in Spring
    10. 3.9. Persisting Objects with Spring's ORM Templates
      1. 3.9.1. Problem
      2. 3.9.2. Solution
      3. 3.9.3. How It Works
        1. 3.9.3.1. Using a Hibernate Template and a JPA Template
        2. 3.9.3.2. Extending the Hibernate and JPA DAO Support Classes
    11. 3.10. Persisting Objects with Hibernate's Contextual Sessions
      1. 3.10.1. Problem
      2. 3.10.2. Solution
      3. 3.10.3. How It Works
    12. 3.11. Persisting Objects with JPA's Context Injection
      1. 3.11.1. Problem
      2. 3.11.2. Solution
      3. 3.11.3. How It Works
    13. 3.12. Summary
  9. 4. Transaction Management in Spring
    1. 4.1.
      1. 4.1.1.
        1. 4.1.1.1. Programmatic and Declarative Transaction Management
    2. 4.2. Problems with Transaction Management
      1. 4.2.1. Managing Transactions with JDBC Commit and Rollback
    3. 4.3. Choosing a Transaction Manager Implementation
      1. 4.3.1. Problem
      2. 4.3.2. Solution
      3. 4.3.3. How It Works
    4. 4.4. Managing Transactions Programmatically with the Transaction Manager API
      1. 4.4.1. Problem
      2. 4.4.2. Solution
      3. 4.4.3. How It Works
    5. 4.5. Managing Transactions Programmatically with a Transaction Template
      1. 4.5.1. Problem
      2. 4.5.2. Solution
      3. 4.5.3. How It Works
    6. 4.6. Managing Transactions Declaratively with Transaction Advices
      1. 4.6.1. Problem
      2. 4.6.2. Solution
      3. 4.6.3. How It Works
    7. 4.7. Managing Transactions Declaratively with the @Transactional Annotation
      1. 4.7.1. Problem
      2. 4.7.2. Solution
      3. 4.7.3. How It Works
    8. 4.8. Setting the Propagation Transaction Attribute
      1. 4.8.1. Problem
      2. 4.8.2. Solution
      3. 4.8.3. How It Works
      4. 4.8.4. The REQUIRED Propagation Behavior
      5. 4.8.5. The REQUIRES_NEW Propagation Behavior
      6. 4.8.6. Setting the Propagation Attribute in Transaction Advices, Proxies, and APIs
    9. 4.9. Setting the Isolation Transaction Attribute
      1. 4.9.1. Problem
      2. 4.9.2. Solution
      3. 4.9.3. How It Works
      4. 4.9.4. The READ_UNCOMMITTED and READ_COMMITTED Isolation Levels
      5. 4.9.5. The REPEATABLE_READ Isolation Level
      6. 4.9.6. The SERIALIZABLE Isolation Level
      7. 4.9.7. Setting the Isolation Level Attribute in Transaction Advices, Proxies, and APIs
    10. 4.10. Setting the Rollback Transaction Attribute
      1. 4.10.1. Problem
      2. 4.10.2. Solution
      3. 4.10.3. How It Works
    11. 4.11. Setting the Timeout and Read-Only Transaction Attributes
      1. 4.11.1. Problem
      2. 4.11.2. Solution
      3. 4.11.3. How It Works
    12. 4.12. Managing Transactions with Load-Time Weaving
      1. 4.12.1. Problem
      2. 4.12.2. Solution
      3. 4.12.3. How It Works
    13. 4.13. Summary
  10. 5. EJB, Spring Remoting, and Web Services
    1. 5.1. Exposing and Invoking Services Through RMI
      1. 5.1.1. Problem
      2. 5.1.2. Solution
      3. 5.1.3. How It Works
        1. 5.1.3.1. Exposing an RMI Service
        2. 5.1.3.2. Invoking an RMI Service
    2. 5.2. Creating EJB 2.x Components with Spring
      1. 5.2.1. Problem
      2. 5.2.2. Solution
      3. 5.2.3. How It Works
        1. 5.2.3.1. Creating EJB 2.x Components Without Spring's Support
        2. 5.2.3.2. Creating EJB 2.x Components with Spring's Support
    3. 5.3. Accessing EJB 2.x Components in Spring
      1. 5.3.1. Problem
      2. 5.3.2. Solution
      3. 5.3.3. How It Works
        1. 5.3.3.1. Accessing EJB 2.x Components
    4. 5.4. Creating EJB 3.0 Components in Spring
      1. 5.4.1. Problem
      2. 5.4.2. Solution
      3. 5.4.3. How It Works
    5. 5.5. Accessing EJB 3.0 Components in Spring
      1. 5.5.1. Problem
      2. 5.5.2. Solution
      3. 5.5.3. How It Works
        1. 5.5.3.1. Accessing EJB 3.0 Components with Spring's Support
    6. 5.6. Exposing and Invoking Services Through HTTP
      1. 5.6.1. Problem
      2. 5.6.2. Solution
      3. 5.6.3. How It Works
        1. 5.6.3.1. Exposing a Hessian Service
        2. 5.6.3.2. Invoking a Hessian Service
        3. 5.6.3.3. Exposing a Burlap Service
        4. 5.6.3.4. Invoking a Burlap Service
        5. 5.6.3.5. Exposing an HTTP Invoker Service
        6. 5.6.3.6. Invoking an HTTP Invoker Service
    7. 5.7. Choosing a Web Service Development Approach
      1. 5.7.1. Problem
      2. 5.7.2. Solution
      3. 5.7.3. How It Works
        1. 5.7.3.1. Contract-Last Web Services
        2. 5.7.3.2. Contract-First Web Services
        3. 5.7.3.3. Comparison
    8. 5.8. Exposing and Invoking Web Services Using XFire
      1. 5.8.1. Problem
      2. 5.8.2. Solution
      3. 5.8.3. How It Works
        1. 5.8.3.1. Exposing a Web Service Using XFire
        2. 5.8.3.2. Inspecting the Generated WSDL File
        3. 5.8.3.3. Invoking a Web Service Using XFire
        4. 5.8.3.4. Exposing an Annotation-Based Web Service Using XFire
    9. 5.9. Defining the Contract of Web Services
      1. 5.9.1. Problem
      2. 5.9.2. Solution
      3. 5.9.3. How It Works
        1. 5.9.3.1. Creating Sample XML Messages
        2. 5.9.3.2. Generating an XSD File from Sample XML Messages
        3. 5.9.3.3. Optimizing the Generated XSD File
        4. 5.9.3.4. Previewing the Generated WSDL File
    10. 5.10. Implementing Web Services Using Spring-WS
      1. 5.10.1. Problem
      2. 5.10.2. Solution
      3. 5.10.3. How It Works
        1. 5.10.3.1. Setting Up a Spring-WS Application
        2. 5.10.3.2. Mapping Web Service Requests to Endpoints
        3. 5.10.3.3. Creating Service Endpoints
        4. 5.10.3.4. Publishing the WSDL File
    11. 5.11. Invoking Web Services Using Spring-WS
      1. 5.11.1. Problem
      2. 5.11.2. Solution
      3. 5.11.3. How It Works
    12. 5.12. Developing Web Services with XML Marshalling
      1. 5.12.1. Problem
      2. 5.12.2. Solution
      3. 5.12.3. How It Works
        1. 5.12.3.1. Creating Service Endpoints with XML Marshalling
        2. 5.12.3.2. Invoking Web Services with XML Marshalling
    13. 5.13. Creating Service Endpoints with Annotations
      1. 5.13.1. Problem
      2. 5.13.2. Solution
      3. 5.13.3. How It Works
    14. 5.14. Summary
  11. 6. Spring in the Enterprise
    1. 6.1. Exporting Spring Beans as JMX MBeans
      1. 6.1.1. Problem
      2. 6.1.2. Solution
      3. 6.1.3. How It Works
        1. 6.1.3.1. Registering MBeans Without Spring's Support
        2. 6.1.3.2. Exporting Spring Beans as MBeans
        3. 6.1.3.3. Exposing MBeans for Remote Access
        4. 6.1.3.4. Assembling the Management Interface of MBeans
        5. 6.1.3.5. Auto-Detecting MBeans by Annotations
    2. 6.2. Publishing and Listening to JMX Notifications
      1. 6.2.1. Problem
      2. 6.2.2. Solution
      3. 6.2.3. How It Works
        1. 6.2.3.1. Publishing JMX Notifications
        2. 6.2.3.2. Listening to JMX Notifications
    3. 6.3. Accessing Remote JMX MBeans in Spring
      1. 6.3.1. Problem
      2. 6.3.2. Solution
      3. 6.3.3. How It Works
        1. 6.3.3.1. Accessing Remote MBeans Through an MBean Server Connection
        2. 6.3.3.2. Accessing Remote MBeans Through an MBean Proxy
    4. 6.4. Sending E-mail with Spring's E-mail Support
      1. 6.4.1. Problem
      2. 6.4.2. Solution
      3. 6.4.3. How It Works
        1. 6.4.3.1. Sending E-mail Using the JavaMail API
        2. 6.4.3.2. Sending E-mail with Spring's MailSender
        3. 6.4.3.3. Defining an E-mail Template
        4. 6.4.3.4. Sending MIME Messages
    5. 6.5. Scheduling with Spring's JDK Timer Support
      1. 6.5.1. Problem
      2. 6.5.2. Solution
      3. 6.5.3. How It Works
        1. 6.5.3.1. Creating a Timer Task
        2. 6.5.3.2. Using JDK Timer Without Spring's Support
        3. 6.5.3.3. Using JDK Timer with Spring's Support
    6. 6.6. Scheduling with Spring's Quartz Support
      1. 6.6.1. Problem
      2. 6.6.2. Solution
      3. 6.6.3. How It Works
        1. 6.6.3.1. Using Quartz Without Spring's Support
        2. 6.6.3.2. Using Quartz with Spring's Support
    7. 6.7. Summary
  12. 7. Messaging
    1. 7.1. Sending and Receiving JMS Messages with Spring
      1. 7.1.1. Problem
      2. 7.1.2. Solution
      3. 7.1.3. How It Works
        1. 7.1.3.1. Sending and Receiving Messages Without Spring's Support
        2. 7.1.3.2. Sending and Receiving Messages with Spring's JMS Template
        3. 7.1.3.3. Sending and Receiving Messages to and from a Default Destination
        4. 7.1.3.4. Extending the JmsGatewaySupport Class
    2. 7.2. Converting JMS Messages
      1. 7.2.1. Problem
      2. 7.2.2. Solution
      3. 7.2.3. Approach
    3. 7.3. Managing JMS Transactions
      1. 7.3.1. Problem
      2. 7.3.2. Approach
      3. 7.3.3. Solution
    4. 7.4. Creating Message-Driven POJOs in Spring
      1. 7.4.1. Problem
      2. 7.4.2. Solution
      3. 7.4.3. How It Works
        1. 7.4.3.1. Listening for JMS Messages with Message Listeners
        2. 7.4.3.2. Listening for JMS Messages with POJOs
        3. 7.4.3.3. Converting JMS Messages
        4. 7.4.3.4. Managing JMS Transactions
        5. 7.4.3.5. Using Spring's JMS Schema
    5. 7.5. Summary
  13. 8. Spring Integration
    1. 8.1. Getting Started with Spring Integration
      1. 8.1.1. Problem
      2. 8.1.2. Solution
      3. 8.1.3. How It Works
    2. 8.2. Integrating One System with Another Using EAI
      1. 8.2.1. Problem
      2. 8.2.2. Solution
      3. 8.2.3. How It Works
        1. 8.2.3.1. Picking an Integration Style
        2. 8.2.3.2. Building on an ESB Solution
    3. 8.3. Integrating Two Systems Using JMS
      1. 8.3.1. Problem
      2. 8.3.2. Solution
      3. 8.3.3. How it Works
        1. 8.3.3.1. Building an MDP Using Spring Integration
    4. 8.4. Interrogate Spring Integration Messages for Context Information
      1. 8.4.1. Problem
      2. 8.4.2. Solution
      3. 8.4.3. How it Works
        1. 8.4.3.1. Using MessageHeaders for Fun and Profit
    5. 8.5. Integrating Two Systems Using a File System
      1. 8.5.1. Problem
      2. 8.5.2. Solution
      3. 8.5.3. How It Works
        1. 8.5.3.1. Concerns in Dealing with a File System
    6. 8.6. Transforming a Message from One Type to Another
      1. 8.6.1. Problem
      2. 8.6.2. Solution
      3. 8.6.3. How it Works
        1. 8.6.3.1. Modifying a Message's Payload
        2. 8.6.3.2. Modifying a Message's Headers
    7. 8.7. Error Handling Using Spring Integration
      1. 8.7.1. Problem
      2. 8.7.2. Solution
      3. 8.7.3. How It Works
        1. 8.7.3.1. Routing to Custom Handlers Based on the Type of Exception
        2. 8.7.3.2. Building a Solution with Multiple Error channels
    8. 8.8. Forking Integration Control: Splitters and Aggregators
      1. 8.8.1. Problem
      2. 8.8.2. Solution
      3. 8.8.3. How it Works
        1. 8.8.3.1. Splitter
        2. 8.8.3.2. Aggregators
    9. 8.9. Conditional Routing with Routers
      1. 8.9.1. Problem
      2. 8.9.2. Solution
      3. 8.9.3. How It Works
    10. 8.10. Adapting External Systems to the Bus
      1. 8.10.1. Problem
      2. 8.10.2. Solution
      3. 8.10.3. How It Works
        1. 8.10.3.1. An Inbound Twitter Adapter
        2. 8.10.3.2. Twitter Messages
        3. 8.10.3.3. A Simple MessageSource
        4. 8.10.3.4. An Outbound Twitter Example
    11. 8.11. Staging Events Using Spring Batch
      1. 8.11.1. Problem
      2. 8.11.2. Solution
      3. 8.11.3. How It Works
    12. 8.12. Gateways
      1. 8.12.1. Problem
      2. 8.12.2. Solution
      3. 8.12.3. How It Works
        1. 8.12.3.1. SimpleMessagingGateway
        2. 8.12.3.2. Breaking the Interface Dependency
    13. 8.13. Summary
  14. 9. Spring Batch
    1. 9.1.
      1. 9.1.1.
        1. 9.1.1.1. Runtime Meta Model
    2. 9.2. Getting Started with the Spring Batch Distribution
      1. 9.2.1. Problem
      2. 9.2.2. Solution
      3. 9.2.3. How It Works
    3. 9.3. Setting Up Spring Batch's Infrastructure
      1. 9.3.1. Problem
      2. 9.3.2. Solution
      3. 9.3.3. How It Works
    4. 9.4. Running Jobs
      1. 9.4.1. Problem
      2. 9.4.2. Solution
      3. 9.4.3. How It Works
        1. 9.4.3.1. Launching From a Web Application
        2. 9.4.3.2. Running from the Command Line
    5. 9.5. Reading and Writing (but No Arithmetic)
      1. 9.5.1. Problem
      2. 9.5.2. Solution
      3. 9.5.3. How It Works
        1. 9.5.3.1. The Job Configuration
        2. 9.5.3.2. Input
        3. 9.5.3.3. Output
    6. 9.6. Writing a Custom ItemWriter and ItemReader
      1. 9.6.1. Problem
      2. 9.6.2. Solution
      3. 9.6.3. How It Works
        1. 9.6.3.1. Writing a Custom ItemReader
        2. 9.6.3.2. Writing a Custom ItemWriter
    7. 9.7. Processing Input Before Writing
      1. 9.7.1. Problem
      2. 9.7.2. Solution
      3. 9.7.3. How It Works
        1. 9.7.3.1. Chaining Processors Together
    8. 9.8. Better Living through Transactions
      1. 9.8.1. Problem
      2. 9.8.2. Solution
      3. 9.8.3. How It Works
        1. 9.8.3.1. Transactions
        2. 9.8.3.2. Rollbacks
    9. 9.9. Retry
      1. 9.9.1. Problem
      2. 9.9.2. Solution
      3. 9.9.3. How It Works
        1. 9.9.3.1. Configuring a Step
        2. 9.9.3.2. Retry Template
        3. 9.9.3.3. AOP-based Retries
    10. 9.10. Controlling Step Execution
      1. 9.10.1. Problem
      2. 9.10.2. Solution
      3. 9.10.3. How It Works
        1. 9.10.3.1. Sequential Steps
        2. 9.10.3.2. Concurrency
        3. 9.10.3.3. Conditional Steps with Statuses
        4. 9.10.3.4. Conditional Steps with Decisions
    11. 9.11. Parameterizing a Job
      1. 9.11.1. Problem
      2. 9.11.2. Solution
      3. 9.11.3. How It Works
        1. 9.11.3.1. Launching a Job with Parameters
        2. 9.11.3.2. Accessing JobParameters
    12. 9.12. Summary
  15. 10. Distributed Spring
    1. 10.1. Cluster Object State Using Terracotta
      1. 10.1.1. Problem
      2. 10.1.2. Solution
      3. 10.1.3. How It Works
        1. 10.1.3.1. Deploying a Simple Example with Terracotta
        2. 10.1.3.2. Terracotta Architecture and Deployment
        3. 10.1.3.3. How to Build a Terracotta XML Configuration File
    2. 10.2. Using Spring to Simplify Terracotta Configuration
      1. 10.2.1. Problem
      2. 10.2.2. Solution
      3. 10.2.3. Approach
    3. 10.3. You Want to Farm Out Execution to a Grid
      1. 10.3.1. Problem
      2. 10.3.2. Solution
      3. 10.3.3. Approach
        1. 10.3.3.1. Deployment
    4. 10.4. Load Balancing a Method
      1. 10.4.1. Problem
      2. 10.4.2. Solution
      3. 10.4.3. Approach
    5. 10.5. Parallelizing Processing
      1. 10.5.1. Problem
      2. 10.5.2. Solution
      3. 10.5.3. Approach
    6. 10.6. On GridGain Deployment
      1. 10.6.1. Problem
      2. 10.6.2. Solution
      3. 10.6.3. Approach
        1. 10.6.3.1. Creating a Grid Node
        2. 10.6.3.2. Provisioning a Grid Node
        3. 10.6.3.3. Getting Access To The Spring Container From a Task
        4. 10.6.3.4. Node-Specific GridGain Configuration
    7. 10.7. Summary
  16. 11. jBPM and Spring
    1. 11.0. Software Processes
    2. 11.1. Understanding Workflow Models
      1. 11.1.1. Problem
      2. 11.1.2. Solution
      3. 11.1.3. Approach
    3. 11.2. Installing jBPM
      1. 11.2.1. Problem
      2. 11.2.2. Approach
      3. 11.2.3. Solution
    4. 11.3. Integrating jBPM 4 with Spring
      1. 11.3.1. Problem
      2. 11.3.2. Solution
      3. 11.3.3. Approach
        1. 11.3.3.1. The Application Context
    5. 11.4. Building a Service With Spring
      1. 11.4.1. Problem
      2. 11.4.2. Solution
      3. 11.4.3. Approach
    6. 11.5. Building a Business Process
      1. 11.5.1. Problem
      2. 11.5.2. Solution
      3. 11.5.3. Approach
    7. 11.6. Summary
  17. 12. OSGi and Spring
    1. 12.1. Getting Started With OSGi
      1. 12.1.1. Problem
      2. 12.1.2. Solution
      3. 12.1.3. Approach
        1. 12.1.3.1. Osgi and "JavaBeans™"
        2. 12.1.3.2. The "Service"
        3. 12.1.3.3. Installing Equinox
        4. 12.1.3.4. Using the Service in a Client Bundle
    2. 12.2. How do I get Started Using Spring Dynamic Modules?
      1. 12.2.1. Problem
      2. 12.2.2. Solution
      3. 12.2.3. Approach
    3. 12.3. How do I Export a Service Using Spring Dynamic Modules?
      1. 12.3.1. Problem
      2. 12.3.2. Solution
      3. 12.3.3. Approach
        1. 12.3.3.1. Interfacing With the OSGi Runtime
    4. 12.4. Finding a Specific Service in the OSGi Registry
      1. 12.4.1. Problem
      2. 12.4.2. Solution
      3. 12.4.3. Approach
        1. 12.4.3.1. Ranking
        2. 12.4.3.2. Service Attributes
        3. 12.4.3.3. Cardinality
    5. 12.5. Publishing a Service Under Multiple Interfaces
      1. 12.5.1. Problem
      2. 12.5.2. Solution
      3. 12.5.3. Approach
    6. 12.6. Customizing Spring Dynamic Modules
      1. 12.6.1. Problem
      2. 12.6.2. Solution
      3. 12.6.3. Approach
        1. 12.6.3.1. You Want Spring To Process OSGi Annotations on Beans
        2. 12.6.3.2. Change the Default HTTP Server that Spring Uses When Deploying a .WAR
    7. 12.7. Using SpringSource dm Server
      1. 12.7.1. Problem
      2. 12.7.2. Solution
      3. 12.7.3. Approach
    8. 12.8. SpringSource's Tooling
      1. 12.8.1. Problem
      2. 12.8.2. Solution
      3. 12.8.3. Approach
    9. 12.9. Summary

Product information

  • Title: Spring Enterprise Recipes: A Problem-Solution Approach
  • Author(s):
  • Release date: November 2009
  • Publisher(s): Apress
  • ISBN: 9781430224976