1
2
3
4
5
6
7
8
9
10
11
12
13 package it.imolinfo.jbi4corba.jbi.component.runtime;
14
15 import javax.jbi.component.ServiceUnitManager;
16
17
18
19
20
21
22
23
24
25 public abstract class DefaultServiceUnitManager implements ServiceUnitManager {
26
27
28
29
30 @SuppressWarnings("unused")
31 private ComponentRuntime mContext;
32
33
34
35
36
37 public DefaultServiceUnitManager(ComponentRuntime ctx) {
38 this.mContext = ctx;
39 }
40
41
42
43
44
45
46
47
48
49
50 protected String createComponentTaskResultXML(String message, boolean isSuccess) {
51
52 String taskResult = isSuccess ? "SUCCESS" : "FAILED";
53 String msgType = isSuccess ? "INFO" : "ERROR";
54 String componentName = RuntimeHelper.getComponentName();
55
56 String xmlResult =
57 "<component-task-result xmlns=\"http://java.sun.com/xml/ns/jbi/management-message\" >" +
58 " <component-name>" + componentName + "</component-name>" +
59 " <component-task-result-details >" +
60 " <task-result-details>" +
61 " <task-id>deployment</task-id>" +
62 " <task-result>" + taskResult + "</task-result>" +
63 " <message-type>" + msgType + "</message-type>" +
64 " <task-status-msg>" +
65 " <msg-loc-info>" +
66 " <loc-token>MSG_ID_000</loc-token>" +
67 " <loc-message>" + message + "</loc-message>" +
68 " </msg-loc-info>" +
69 " </task-status-msg>" +
70 " </task-result-details>" +
71 " </component-task-result-details>" +
72 "</component-task-result>";
73
74 return xmlResult;
75 }
76
77 }