Line | |
---|
1 | package test2; |
---|
2 | |
---|
3 | import java.util.ArrayList; |
---|
4 | import java.util.List; |
---|
5 | |
---|
6 | import omq.server.remote.request.RemoteObject; |
---|
7 | |
---|
8 | public class MobileImpl extends RemoteObject implements Mobile { |
---|
9 | /** |
---|
10 | * |
---|
11 | */ |
---|
12 | private static final long serialVersionUID = 1L; |
---|
13 | private List<String> messages = new ArrayList<String>(); |
---|
14 | |
---|
15 | @Override |
---|
16 | public synchronized void sendMessage(String message) { |
---|
17 | System.out.println("Message received " + this.getRef() + " -> " + message); |
---|
18 | messages.add(message); |
---|
19 | } |
---|
20 | |
---|
21 | @Override |
---|
22 | public List<String> getMessages() { |
---|
23 | return messages; |
---|
24 | } |
---|
25 | |
---|
26 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.