Polish samples

This commit is contained in:
Stephane Nicoll
2016-12-30 17:57:14 +01:00
parent a19a28062f
commit c903ff46a7
30 changed files with 149 additions and 105 deletions

View File

@@ -16,14 +16,16 @@
package sample.parent;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
@Component
public class HelloWorldService {
@Autowired
private ServiceProperties configuration;
private final ServiceProperties configuration;
public HelloWorldService(ServiceProperties configuration) {
this.configuration = configuration;
}
public String getHelloMessage(String name) {
return this.configuration.getGreeting() + " " + name;

View File

@@ -27,8 +27,12 @@ import org.springframework.util.StreamUtils;
@MessageEndpoint
public class SampleEndpoint {
private final HelloWorldService helloWorldService;
@Autowired
private HelloWorldService helloWorldService;
public SampleEndpoint(HelloWorldService helloWorldService) {
this.helloWorldService = helloWorldService;
}
@ServiceActivator
public String hello(File input) throws Exception {