|
5 | 5 | import org.hobbit.core.Commands; |
6 | 6 | import org.hobbit.core.components.Component; |
7 | 7 | //import org.hobbit.core.data.ExecuteCommandData; |
8 | | -import org.hobbit.core.data.ExecuteCommandData; |
9 | 8 | import org.hobbit.core.data.StartCommandData; |
10 | 9 | import org.hobbit.core.rabbit.RabbitMQUtils; |
11 | 10 | import org.hobbit.sdk.docker.AbstractDockerizer; |
@@ -249,37 +248,37 @@ public void handleCmd(Byte command, byte[] bytes, String replyTo) throws Excepti |
249 | 248 | } |
250 | 249 | } |
251 | 250 | } |
252 | | - else if(command==Commands.EXECUTE_ASYNC_COMMAND){ |
253 | | - //Supported only for the extended core, not supported in the online platform |
254 | | - CommandSender commandSender = null; |
255 | | - String dataString = RabbitMQUtils.readString(bytes); |
256 | | - ExecuteCommandData executeCommandData = gson.fromJson(dataString, ExecuteCommandData.class); |
257 | | - |
258 | | - logger.debug("EXECUTE_COMMAND_IN_CONTAINER {} received", executeCommandData.containerId); |
259 | | - |
260 | | - AbstractDockerizer runningContainer; |
261 | | - if(!runningComponents.containsKey(executeCommandData.containerId)){ |
262 | | - runningContainer = new PullBasedDockersBuilder("container-"+executeCommandData.containerId).containerName(executeCommandData.containerId).build(); |
263 | | - //logger.error("No running container {} found", executeCommandData.containerId); |
264 | | - //return; |
265 | | - }else |
266 | | - runningContainer = (AbstractDockerizer)runningComponents.get(executeCommandData.containerId); |
267 | | - |
268 | | - Boolean result0 = runningContainer.execAsyncCommand(executeCommandData.containerId, executeCommandData.command); |
269 | | - String result = (result0?"Succeeded":"Failed"); |
270 | | - synchronized (this) { |
271 | | - try { |
272 | | - logger.debug("Sending command execution result: {}", result); |
273 | | - new CommandSender(result.getBytes(), MessageProperties.PERSISTENT_BASIC, replyTo).send(); |
274 | | - |
275 | | - } catch (Exception e){ |
276 | | - logger.error("Failed send reply: ", e.getLocalizedMessage()); |
277 | | - Assert.fail(e.getMessage()); |
278 | | - } |
279 | | - } |
280 | | - |
281 | | - |
282 | | - } |
| 251 | +// else if(command==Commands.EXECUTE_ASYNC_COMMAND){ |
| 252 | +// //Supported only for the extended core, not supported in the online platform |
| 253 | +// CommandSender commandSender = null; |
| 254 | +// String dataString = RabbitMQUtils.readString(bytes); |
| 255 | +// ExecuteCommandData executeCommandData = gson.fromJson(dataString, ExecuteCommandData.class); |
| 256 | +// |
| 257 | +// logger.debug("EXECUTE_COMMAND_IN_CONTAINER {} received", executeCommandData.containerId); |
| 258 | +// |
| 259 | +// AbstractDockerizer runningContainer; |
| 260 | +// if(!runningComponents.containsKey(executeCommandData.containerId)){ |
| 261 | +// runningContainer = new PullBasedDockersBuilder("container-"+executeCommandData.containerId).containerName(executeCommandData.containerId).build(); |
| 262 | +// //logger.error("No running container {} found", executeCommandData.containerId); |
| 263 | +// //return; |
| 264 | +// }else |
| 265 | +// runningContainer = (AbstractDockerizer)runningComponents.get(executeCommandData.containerId); |
| 266 | +// |
| 267 | +// Boolean result0 = runningContainer.execAsyncCommand(executeCommandData.containerId, executeCommandData.command); |
| 268 | +// String result = (result0?"Succeeded":"Failed"); |
| 269 | +// synchronized (this) { |
| 270 | +// try { |
| 271 | +// logger.debug("Sending command execution result: {}", result); |
| 272 | +// new CommandSender(result.getBytes(), MessageProperties.PERSISTENT_BASIC, replyTo).send(); |
| 273 | +// |
| 274 | +// } catch (Exception e){ |
| 275 | +// logger.error("Failed send reply: ", e.getLocalizedMessage()); |
| 276 | +// Assert.fail(e.getMessage()); |
| 277 | +// } |
| 278 | +// } |
| 279 | +// |
| 280 | +// |
| 281 | +// } |
283 | 282 |
|
284 | 283 |
|
285 | 284 | } |
|
0 commit comments