Cover image for Just Spring

Book description

Spring is an exciting framework for building Enterprise Java applications. This book shows what Spring and its companion ORM framework, Hibernate can do for you. In plain and simple language, it gets you started working with the Spring framework.

Table of Contents

  1. Special Upgrade Offer
  2. A Note Regarding Supplemental Files
  3. Preface
    1. Conventions Used in This Book
    2. Using Code Examples
    3. Safari® Books Online
    4. How to Contact Us
    5. Content Updates
      1. September 23, 2011
      2. February 28, 2013
    6. Acknowledgments
  4. 1. Basics
    1. Introduction
    2. Object Coupling Problem
      1. Designing to Interfaces
    3. Introducing Spring
      1. Dependency Injection
      2. Refactoring IReader by Using the Framework
      3. ReaderService
    4. Summary
  5. 2. Fundamentals
    1. Configuring Beans
      1. Using XML
      2. Using Annotations
      3. XML Namespaces
    2. Creating Beans
    3. Life Cycle
      1. Instantiating Beans Without Dependencies
      2. Instantiating Beans With Dependencies
    4. Aliasing Beans
    5. Anonymous Beans
    6. Injection Types
      1. Constructor Type Injection
        1. Argument type resolution
      2. Setter Type Injection
      3. Mixing Constructor and Setter
    7. Bean Callbacks
      1. init-method
      2. destroy-method
      3. Common Callbacks
    8. Summary
  6. 3. Containers
    1. Containers
      1. BeanFactory Container
      2. ApplicationContext Container
    2. Instantiating Beans
      1. Using Static Methods
      2. Using Factory Methods
    3. Initialization and Destruction Callbacks
      1. InitializingBean’s afterPropertiesSet
      2. DisposableBean’s destroy
      3. Declarative or Programmatic Callbacks?
    4. Event Handling
      1. Listening to Context Events
      2. Publishing Custom Events
      3. Event Model Is Single Threaded
    5. Autowiring
      1. Autowiring byName
      2. Autowiring byType
      3. Autowiring by constructor
      4. Mixing Autowiring with Explicit Wiring
    6. Summary
  7. 4. Advanced Concepts
    1. Bean Scopes
      1. Singleton Scope
      2. Prototype Scope
    2. Property Files
    3. Property Editors
      1. Injecting Java Collections
        1. Using lists, sets and maps
      2. Injecting Java Properties
    4. Bean Post Processors
    5. Parent-Child Bean Definitions
    6. Summary
  8. 5. Spring JMS
    1. Two-Minute JMS
      1. Messaging Models
        1. Point-to-point messaging
        2. Pub/sub messaging
    2. Spring JMS
      1. Mother of All: The JmsTemplate Class
      2. Publishing Messages
      3. Sending Messages to Default Destination
      4. Declaring a Topic
      5. Receiving Messages
      6. Receiving Messages Synchronously
      7. Receiving Messages Asynchronously
      8. Spring Message Containers
      9. Message Converters
    3. Summary
  9. 6. Spring Data
    1. JDBC and Hibernate
      1. Spring JDBC
        1. JdbcTemplate
        2. Configuring JdbcTemplate
        3. Using JdbcTemplate
        4. Returning domain objects
        5. Manipulating data
      2. Hibernate
        1. Using old style HibernateTemplate
        2. Preferred style—using native API
    2. Summary
  10. About the Author
  11. Colophon
  12. Special Upgrade Offer
  13. Copyright