1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30 package it.imolinfo.jbi4ejb.jbi.component.runtime;
31
32 import it.imolinfo.jbi4ejb.Logger;
33 import it.imolinfo.jbi4ejb.LoggerFactory;
34 import it.imolinfo.jbi4ejb.jbi.Messages;
35
36 import javax.jbi.component.ServiceUnitManager;
37 import javax.jbi.management.DeploymentException;
38 import javax.jbi.messaging.MessagingException;
39
40
41
42
43
44
45
46
47
48 public class DefaultServiceUnitManager implements ServiceUnitManager {
49
50 private static final Logger LOG = LoggerFactory.getLogger( DefaultServiceUnitManager.class);
51 private static final Messages MESSAGES = Messages.getMessages( DefaultServiceUnitManager.class);
52
53
54
55 private ComponentRuntime mContext;
56
57 private DefaultServiceUnitManager() {}
58
59
60
61 public DefaultServiceUnitManager(ComponentRuntime ctx) {
62 this.mContext = ctx;
63 }
64
65
66
67
68
69
70
71
72 public String deploy(String suName, String suZipPath) throws DeploymentException {
73 boolean isSuccess = false;
74 String msg=MESSAGES.getString("EJB000216_Service_unit_deployment_not_supported_for_this_component");
75 LOG.error(msg);
76 throw new DeploymentException(msg);
77
78 }
79
80
81
82
83 public String undeploy(String suName, String suZipPath) throws DeploymentException {
84 boolean isSuccess = false;
85 String msg=MESSAGES.getString("EJB000216_Service_unit_deployment_not_supported_for_this_component");
86 LOG.error(msg);
87 throw new DeploymentException(msg);
88 }
89
90
91
92
93
94
95
96 public void init(String serviceUnitName, String serviceUnitRootPath)
97 throws javax.jbi.management.DeploymentException {
98 boolean isSuccess = false;
99 String msg=MESSAGES.getString("EJB000216_Service_unit_deployment_not_supported_for_this_component");
100 LOG.error(msg);
101 throw new DeploymentException(msg);
102 }
103
104
105
106
107 public void shutDown(String serviceUnitName)
108 throws javax.jbi.management.DeploymentException {
109 boolean isSuccess = false;
110 String msg=MESSAGES.getString("EJB000216_Service_unit_deployment_not_supported_for_this_component");
111 LOG.error(msg);
112 throw new DeploymentException(msg);
113 }
114
115
116
117
118 public void start(String serviceUnitName)
119 throws javax.jbi.management.DeploymentException {
120 boolean isSuccess = false;
121 String msg=MESSAGES.getString("EJB000216_Service_unit_deployment_not_supported_for_this_component");
122 LOG.error(msg);
123 throw new DeploymentException(msg);
124 }
125
126
127
128
129 public void stop(String serviceUnitName)
130 throws javax.jbi.management.DeploymentException {
131 boolean isSuccess = false;
132 String msg=MESSAGES.getString("EJB000216_Service_unit_deployment_not_supported_for_this_component");
133 LOG.error(msg);
134 throw new DeploymentException(msg);
135 }
136
137
138
139
140
141
142
143
144
145
146
147 protected String createComponentTaskResultXML(String message, boolean isSuccess) {
148
149 String taskResult = isSuccess ? "SUCCESS" : "FAILED";
150 String msgType = isSuccess ? "INFO" : "ERROR";
151 String componentName = RuntimeHelper.getComponentName();
152
153 String xmlResult =
154 "<component-task-result xmlns=\"http://java.sun.com/xml/ns/jbi/management-message\" >" +
155 " <component-name>" + componentName + "</component-name>" +
156 " <component-task-result-details >" +
157 " <task-result-details>" +
158 " <task-id>deployment</task-id>" +
159 " <task-result>" + taskResult + "</task-result>" +
160 " <message-type>" + msgType + "</message-type>" +
161 " <task-status-msg>" +
162 " <msg-loc-info>" +
163 " <loc-token>MSG_ID_000</loc-token>" +
164 " <loc-message>" + message + "</loc-message>" +
165 " </msg-loc-info>" +
166 " </task-status-msg>" +
167 " </task-result-details>" +
168 " </component-task-result-details>" +
169 "</component-task-result>";
170
171 return xmlResult;
172 }
173
174 }