Chapter 14. Odds and ends

 

This chapter covers

  • Externalizing configuration
  • Wiring JNDI resources in Spring
  • Sending email messages
  • Scheduling tasks
  • Asynchronous methods

I don’t know about your house, but many houses (including mine) have a so-called junk drawer. Despite its name, the contents of a junk drawer are often handy or even necessary. Things such as screwdrivers, ballpoint pens, paper clips, and extra keys often call the junk drawer their home. It’s not that they’re truly junk and have no value—it’s that they don’t have a place otherwise.

We’ve covered a lot of ground so far in this book and have explored several corners of working with Spring. Each topic has had a chapter of its own. But there are a few more Spring tricks that I’d like to show you, and none of them were big enough to justify a chapter of their own.

This is the junk drawer of the book. But don’t think that the topics here are useless. You’ll find valuable techniques here. We’ll see how to externalize Spring configuration, encrypt property values, work with JNDI objects, send emails, and configure methods to run in the background—all using Spring.

First up, let’s look at how to move property value configuration out of Spring configuration and into external properties files that can be managed without repackaging and redeploying your applications.

14.1. Externalizing configuration

14.2. Wiring JNDI objects

14.3. Sending email

14.4. Scheduling and background tasks

14.5. Summary

14.6. The end...?