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