Spring JavaConfig Reference Guide - Spring Web Services - Parent ...

Spring JavaConfig Reference Guide - Spring Web Services - Parent ... Spring JavaConfig Reference Guide - Spring Web Services - Parent ...

static.springsource.org
from static.springsource.org More from this publisher
13.07.2015 Views

About this document ........................................................................................................................ iv1. Document structure .............................................................................................................. iv2. Target audience ....................................................................................................................iv3. Code conventions ................................................................................................................. ivPreface to the third milestone release ..................................................................................................vI. Introduction ...................................................................................................................................11. Overview ............................................................................................................................. 21.1. What is JavaConfig? ................................................................................................... 21.2. Why JavaConfig? ....................................................................................................... 21.3. Requirements ............................................................................................................. 21.3.1. Runtime Environment ...................................................................................... 21.3.2. Project Dependencies ....................................................................................... 21.4. History .......................................................................................................................32. New & Noteworthy in 1.0.0.m3 ............................................................................................ 42.1. AnnotationApplicationContext deprecated ................................................................42.2. Type-safety improvements .......................................................................................... 42.3. First-class support for JavaConfig in the web tier ..........................................................42.4. New semantics for nested @Configuration classes ....................................................... 52.5. Modularization improvements with @Import ................................................................ 62.6. Support for externalizing string values with @ExternalValue ........................................ 63. Quick start ...........................................................................................................................83.1. Download JavaConfig .................................................................................................83.1.1. Manual download ............................................................................................ 83.1.2. Maven 2 .......................................................................................................... 83.2. Create bean definitions ................................................................................................93.3. Retrieve bean instances ............................................................................................... 93.4. Summary ................................................................................................................... 9II. API Reference ............................................................................................................................ 104. Creating and using bean definitions ...................................................................................114.1. @Configuration ....................................................................................................... 114.2. @Bean ....................................................................................................................... 114.2.1. Declaring a bean ............................................................................................ 114.2.2. Using *Aware interfaces ..................................................................................124.2.3. Bean visibility ................................................................................................124.2.4. Bean scoping ................................................................................................. 134.2.5. Bean naming ..................................................................................................144.3. JavaConfigApplicationContext ...............................................................................144.3.1. Construction Options ......................................................................................154.3.2. Accessing beans with getBean() .....................................................................165. Modularizing configurations ..............................................................................................185.1. Partitioning bean definitions across multiple @Configuration classes .......................... 185.2. Referencing externally defined beans with @ExternalBean .......................................... 195.3. Importing @Configuration classes with @Import ........................................................195.4. ConfigurationSupport .............................................................................................205.5. Externalizing values with @ExternalValue and @ResourceBundles ............................. 205.6. Nesting @Configuration classes ................................................................................216. Using aspects ..................................................................................................................... 226.1. Embedded aspects .....................................................................................................226.2. Reusable aspects .......................................................................................................227. Developing web applications with JavaConfig ................................................................... 247.1. JavaConfigWebApplicationContext ......................................................................... 248. Combining configuration approaches ................................................................................ 25Spring JavaConfigii

Spring JavaConfig Reference Guide8.1. JavaConfig and XML ................................................................................................258.1.1. Bootstrapping JavaConfig from XML with ConfigurationPostProcessor ....... 25III. Appendices ............................................................................................................................... 26A. Roadmap ............................................................................................................................27B. Visualizing configurations with Spring IDE ..........................................................................28C. Maven2 POM configurations ............................................................................................... 29C.1. Minimal ...................................................................................................................29C.2. AOP ........................................................................................................................29D. Additional resources ........................................................................................................... 31D.1. Core Spring documentation ...................................................................................... 31D.2. Community forums .................................................................................................. 31D.3. Issue tracking ...........................................................................................................31D.4. SpringSource team blog ............................................................................................31D.5. Consulting and training services ................................................................................31Spring JavaConfigiii

About this document ........................................................................................................................ iv1. Document structure .............................................................................................................. iv2. Target audience ....................................................................................................................iv3. Code conventions ................................................................................................................. ivPreface to the third milestone release ..................................................................................................vI. Introduction ...................................................................................................................................11. Overview ............................................................................................................................. 21.1. What is <strong>JavaConfig</strong>? ................................................................................................... 21.2. Why <strong>JavaConfig</strong>? ....................................................................................................... 21.3. Requirements ............................................................................................................. 21.3.1. Runtime Environment ...................................................................................... 21.3.2. Project Dependencies ....................................................................................... 21.4. History .......................................................................................................................32. New & Noteworthy in 1.0.0.m3 ............................................................................................ 42.1. AnnotationApplicationContext deprecated ................................................................42.2. Type-safety improvements .......................................................................................... 42.3. First-class support for <strong>JavaConfig</strong> in the web tier ..........................................................42.4. New semantics for nested @Configuration classes ....................................................... 52.5. Modularization improvements with @Import ................................................................ 62.6. Support for externalizing string values with @ExternalValue ........................................ 63. Quick start ...........................................................................................................................83.1. Download <strong>JavaConfig</strong> .................................................................................................83.1.1. Manual download ............................................................................................ 83.1.2. Maven 2 .......................................................................................................... 83.2. Create bean definitions ................................................................................................93.3. Retrieve bean instances ............................................................................................... 93.4. Summary ................................................................................................................... 9II. API <strong>Reference</strong> ............................................................................................................................ 104. Creating and using bean definitions ...................................................................................114.1. @Configuration ....................................................................................................... 114.2. @Bean ....................................................................................................................... 114.2.1. Declaring a bean ............................................................................................ 114.2.2. Using *Aware interfaces ..................................................................................124.2.3. Bean visibility ................................................................................................124.2.4. Bean scoping ................................................................................................. 134.2.5. Bean naming ..................................................................................................144.3. <strong>JavaConfig</strong>ApplicationContext ...............................................................................144.3.1. Construction Options ......................................................................................154.3.2. Accessing beans with getBean() .....................................................................165. Modularizing configurations ..............................................................................................185.1. Partitioning bean definitions across multiple @Configuration classes .......................... 185.2. Referencing externally defined beans with @ExternalBean .......................................... 195.3. Importing @Configuration classes with @Import ........................................................195.4. ConfigurationSupport .............................................................................................205.5. Externalizing values with @ExternalValue and @ResourceBundles ............................. 205.6. Nesting @Configuration classes ................................................................................216. Using aspects ..................................................................................................................... 226.1. Embedded aspects .....................................................................................................226.2. Reusable aspects .......................................................................................................227. Developing web applications with <strong>JavaConfig</strong> ................................................................... 247.1. <strong>JavaConfig</strong><strong>Web</strong>ApplicationContext ......................................................................... 248. Combining configuration approaches ................................................................................ 25<strong>Spring</strong> <strong>JavaConfig</strong>ii

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!