+ public void runSlcExecution(SlcExecution slcExecution) {
+ process(slcExecution);
+ }
+
+ public void process(ExecutionProcess executionProcess) {
+ if (!(executionProcess instanceof SlcExecution))
+ throw new SlcException("Unsupported process type "
+ + executionProcess.getClass());
+ sendReceive(new AgentMC("runSlcExecution",
+ (SlcExecution) executionProcess));
+ }
+
+ public boolean ping() {
+ Object response = sendReceive(new AgentMC("ping"), false);
+ if (response == null)
+ return false;
+ else {
+ ExecutionAnswer answer = (ExecutionAnswer) response;
+ return ExecutionAnswer.OK.equals(answer.getStatus());
+ }
+ }
+
+ protected Object sendReceive(AgentMC messageCreator) {
+ long begin = System.currentTimeMillis();
+ Object res;
+ try {
+ res = sendReceive(messageCreator, true);
+ } finally {
+ if (log.isTraceEnabled())
+ log.trace("To agent #" + agentUuid + " in "
+ + (System.currentTimeMillis() - begin) + " ms, query '"
+ + messageCreator.getQuery() + "', correlationId "
+ + messageCreator.getCorrelationId());
+ }
+ return res;
+ }
+
+ /**
+ * @param timeoutException
+ * if true throws an exception if reception timeouted, else
+ * return null
+ */
+ protected Object sendReceive(AgentMC messageCreator,
+ boolean timeoutException) {