Adding code from the original blog post. Refactoring to use annotation config instead of XML.