package com.sishuok.spring4.annotation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
/**
* <p>User: Zhang Kaitao
* <p>Date: 13-12-18
* <p>Version: 1.0
*/
@Component
public class MessagePrinter {
private MessageService messageService;
@Autowired
public MessagePrinter(MessageService messageService) {
this.messageService = messageService;
}
public void printMessage() {
System.out.println(this.messageService.getMessage());
}
}