View Javadoc

1   package org.kuali.common.util.spring.config;
2   
3   import org.kuali.common.util.execute.Executable;
4   import org.kuali.common.util.spring.beans.DefaultMessageImpl;
5   import org.kuali.common.util.spring.beans.Message;
6   import org.kuali.common.util.spring.beans.PrintMessagesExecutable;
7   import org.springframework.context.annotation.Bean;
8   import org.springframework.context.annotation.Configuration;
9   
10  @Configuration
11  public class MessagesConfig {
12  
13  	@Bean
14  	public String helloWorldString() {
15  		return "Hello World";
16  	}
17  
18  	@Bean
19  	public String goodbyeString() {
20  		return "Good bye";
21  	}
22  
23  	@Bean
24  	public Message helloWorldMessage() {
25  		DefaultMessageImpl message = new DefaultMessageImpl();
26  		message.setMessage(helloWorldString());
27  		return message;
28  	}
29  
30  	@Bean
31  	public Message goodbyeMessage() {
32  		DefaultMessageImpl message = new DefaultMessageImpl();
33  		message.setMessage(goodbyeString());
34  		return message;
35  	}
36  
37  	// @Bean(initMethod = "execute")
38  	@Bean
39  	public Executable printMessagesExecutable() {
40  		return new PrintMessagesExecutable();
41  	}
42  }