Chapter 1. Introducing Java 7
Listing 1.1. Handling several different exceptions in Java 6
Listing 1.2. Handling several different exceptions in Java 7
Listing 1.3. Java 6 syntax for resource management
Listing 1.4. Java 7 syntax for resource management
Chapter 2. New I/O
Listing 2.1. Retrieving information from a Path
Listing 2.2. Listing properties files in a directory
Listing 2.3. Listing Java source code in subdirectories
Listing 2.4. Universal file attributes
Listing 2.5. File attribute support in Java 7
Listing 2.6. Exploring symbolic links
Listing 2.7. Using the WatchService
Listing 2.8. Asynchronous I/O—Future style
Listing 2.9. Asynchronous I/O—Callback style
Listing 2.10. NetworkChannel options
Listing 2.11. NetworkChannel options
Chapter 3. Dependency Injection
Listing 3.1. AgentFinder interface and its implementing classes
Listing 3.2. HollywoodService, with hard-coded AgentFinder
Listing 3.3. HollywoodService, with factory lookup for AgentFinder
Listing 3.4. HollywoodService, with hand-rolled DI for AgentFinder
Listing 3.5. HollywoodService, with JSR-330 DI for AgentFinder
Listing 3.6. Use of the Provider<T> interface
Listing 3.7. HollywoodService, with Guice DI for AgentFinder
Listing 3.8. HollywoodServiceClient—building the object graph with Guice
Listing 3.9. HollywoodService, using @Named
Listing 3.10. AgentFinderModule, using @Provides
Listing 3.11. AgentFinderModule, using the Provider<T> interface
Chapter 4. Modern concurrency
Listing 4.1. A fully synchronized class