File tree 4 files changed +48
-1
lines changed
athena/src/main/java/org/dcsc/athena
4 files changed +48
-1
lines changed Original file line number Diff line number Diff line change
1
+ package org .dcsc .athena .controllers ;
2
+
3
+ import org .springframework .messaging .handler .annotation .MessageMapping ;
4
+ import org .springframework .messaging .handler .annotation .SendTo ;
5
+ import org .springframework .stereotype .Controller ;
6
+
7
+ import org .dcsc .athena .objects .Greeting ;
8
+ import org .dcsc .athena .objects .HelloMessage ;
9
+
10
+ @ Controller
11
+ public class GreetingController {
12
+
13
+
14
+ @ MessageMapping ("/hello" )
15
+ @ SendTo ("/topic/greetings" )
16
+ public Greeting greeting (HelloMessage message ) throws Exception {
17
+ Thread .sleep (3000 ); // simulated delay
18
+ return new Greeting ("Hello, " + message .getName () + "!" );
19
+ }
20
+
21
+ }
Original file line number Diff line number Diff line change
1
+ package org .dcsc .athena .objects ;
2
+
3
+ public class Greeting {
4
+
5
+ private String content ;
6
+
7
+ public Greeting (String content ) {
8
+ this .content = content ;
9
+ }
10
+
11
+ public String getContent () {
12
+ return content ;
13
+ }
14
+
15
+ }
Original file line number Diff line number Diff line change
1
+ package org .dcsc .athena .objects ;
2
+
3
+ public class HelloMessage {
4
+
5
+ private String name ;
6
+
7
+ public String getName () {
8
+ return name ;
9
+ }
10
+
11
+ }
Submodule resources updated from 3c2986c to 5f27ed4
You can’t perform that action at this time.
0 commit comments