1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.fourthline.cling.protocol;
17
18 import org.fourthline.cling.model.message.StreamRequestMessage;
19 import org.fourthline.cling.model.message.StreamResponseMessage;
20 import org.fourthline.cling.UpnpService;
21 import org.fourthline.cling.transport.RouterException;
22
23
24
25
26
27
28
29
30
31
32
33
34
35 public abstract class SendingSync<IN extends StreamRequestMessage, OUT extends StreamResponseMessage> extends SendingAsync {
36
37 final private IN inputMessage;
38 protected OUT outputMessage;
39
40 protected SendingSync(UpnpService upnpService, IN inputMessage) {
41 super(upnpService);
42 this.inputMessage = inputMessage;
43 }
44
45 public IN getInputMessage() {
46 return inputMessage;
47 }
48
49 public OUT getOutputMessage() {
50 return outputMessage;
51 }
52
53 final protected void execute() throws RouterException {
54 outputMessage = executeSync();
55 }
56
57 protected abstract OUT executeSync() throws RouterException;
58
59 @Override
60 public String toString() {
61 return "(" + getClass().getSimpleName() + ")";
62 }
63
64 }