Package demo.annotation

Source Code of demo.annotation.Beans

package demo.annotation;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import core.DefaultGreetingGenerator;
import core.GreetingGenerator;
import core.GreetingService;
import core.SimpleGreetingService;

@Configuration
public class Beans {

  @Bean
  public GreetingService service() {
    return new SimpleGreetingService(generator());
  }

  @Bean
  public GreetingGenerator generator() {
    return new DefaultGreetingGenerator();
  }

}
TOP

Related Classes of demo.annotation.Beans

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.