mirror of https://github.com/apache/cloudstack.git
Make sure hooking of answer command callback be called for both sync/Async commands
This commit is contained in:
parent
918df1a838
commit
1692caabe8
|
|
@ -22,5 +22,4 @@ public class ListResponse<T extends ResponseObject> extends BaseResponse {
|
|||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -231,5 +231,5 @@ public interface AgentManager extends Manager {
|
|||
|
||||
Answer sendTo(Long dcId, HypervisorType type, Command cmd);
|
||||
|
||||
void notifyAnswersFromAttache(long agentId, long seq, Answer[] answers);
|
||||
void notifyAnswersToMonitors(long agentId, long seq, Answer[] answers);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -268,7 +268,7 @@ public abstract class AgentAttache {
|
|||
sendNext(seq);
|
||||
}
|
||||
|
||||
_agentMgr.notifyAnswersFromAttache(_id, seq, answers);
|
||||
_agentMgr.notifyAnswersToMonitors(_id, seq, answers);
|
||||
return processed;
|
||||
}
|
||||
|
||||
|
|
@ -391,7 +391,7 @@ public abstract class AgentAttache {
|
|||
// s_logger.debug(log(seq, "Received after timeout: " + new Response(req, answers).toString()));
|
||||
}
|
||||
|
||||
_agentMgr.notifyAnswersFromAttache(_id, seq, answers);
|
||||
_agentMgr.notifyAnswersToMonitors(_id, seq, answers);
|
||||
return answers;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -485,9 +485,9 @@ public class AgentManagerImpl implements AgentManager, HandlerFactory,
|
|||
}
|
||||
}
|
||||
|
||||
public void notifyAnswersFromAttache(long agentId, long seq, Answer[] answers) {
|
||||
public void notifyAnswersToMonitors(long agentId, long seq, Answer[] answers) {
|
||||
for (Pair<Integer, Listener> listener : _cmdMonitors) {
|
||||
listener.second().processCommands(agentId, seq, answers);
|
||||
listener.second().processAnswers(agentId, seq, answers);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -1449,7 +1449,7 @@ public class AgentManagerImpl implements AgentManager, HandlerFactory,
|
|||
Request req = new Request(seq, hostId, _nodeId, cmds,
|
||||
commands.stopOnError(), true, commands.revertOnError());
|
||||
Answer[] answers = agent.send(req, timeout);
|
||||
notifyAnswersFromAttache(hostId, seq, answers);
|
||||
notifyAnswersToMonitors(hostId, seq, answers);
|
||||
commands.setAnswers(answers);
|
||||
return answers;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue