if (pool != null) {
executor = (TaskHandlerExecutor) repository.getExecutor(readCommand.getCommand(), pool, taskRequestWrapper);
} else {
executor = (TaskHandlerExecutor) repository.getExecutor(readCommand.getCommand(), readCommand.getCommand(), taskRequestWrapper);
}
TaskResult result;
/* execute */
if (executor.getCallInvocationType() == TaskHandler.SYNC_CALL) {
result = executor.execute();
} else {
/* dont wait for the result. send back a response that the call has been dispatched for async execution */
executor.queue();
result = new TaskResult(true, TaskHandlerExecutor.ASYNC_QUEUED);
}
LOGGER.debug("The output is: " + result);
// write the results to the socket output
commandInterpreter.writeCommandExecutionResponse(client.getOutputStream(), result);