001 // Copyright 2009 by Basil Vandegriend. All rights reserved.
002
003 package com.basilv.examples.spring.autowire;
004
005 import org.springframework.config.java.annotation.*;
006 import org.springframework.config.java.plugin.context.AnnotationDrivenConfig;
007
008 import com.basilv.examples.spring.*;
009
010 @Configuration
011 @AnnotationDrivenConfig // Needed for @Autowire to work
012 public class AutowireConfig
013 {
014
015 @Bean
016 public ResumeRepository resumeRepository() {
017 return new HardcodedResumeRepository();
018 }
019
020 @Bean
021 public CalculatorService calculatorService() {
022 return new CalculatorServiceImpl(); // Do not need to specify dependency.
023 }
024
025 }