1
2
3
4 package ca.uhn.hl7v2.protocol.impl;
5
6 import java.util.Map;
7
8 import ca.uhn.hl7v2.HL7Exception;
9 import ca.uhn.hl7v2.app.Application;
10 import ca.uhn.hl7v2.app.ApplicationException;
11 import ca.uhn.hl7v2.model.Message;
12 import ca.uhn.hl7v2.protocol.ReceivingApplication;
13 import ca.uhn.hl7v2.protocol.ReceivingApplicationException;
14
15
16
17
18
19
20
21
22 public class AppWrapper implements ReceivingApplication<Message> {
23
24 private final Application myApplication;
25
26
27
28
29 public AppWrapper(Application theApplication) {
30 myApplication = theApplication;
31 }
32
33
34
35
36 public Message../../../ca/uhn/hl7v2/model/Message.html#Message">Message processMessage(Message theMessage, Map<String, Object> theMetadata)
37 throws ReceivingApplicationException, HL7Exception {
38 Message result;
39 try {
40 result = myApplication.processMessage(theMessage);
41 } catch (ApplicationException e) {
42 throw new ReceivingApplicationException(e);
43 }
44
45 return result;
46 }
47
48
49
50
51 public boolean canProcess(Message theMessage) {
52 return myApplication.canProcess(theMessage);
53 }
54
55 }