X-Git-Url: http://git.argeo.org/?a=blobdiff_plain;ds=sidebyside;f=runtime%2Forg.argeo.slc.support.activemq%2Fsrc%2Fmain%2Fjava%2Forg%2Fargeo%2Fslc%2Fjms%2FJmsAgentProxy.java;h=d3027c93dba717cd308fead2bd5ccf93b5901309;hb=a181e3d059185a9dc108e81f38c66f48f4e4aac8;hp=2230cb876583e58cf6d8a53125205b8c9e0895f7;hpb=e9e32f3294118e8289ca21034a7bd799ec91048d;p=gpl%2Fargeo-slc.git diff --git a/runtime/org.argeo.slc.support.activemq/src/main/java/org/argeo/slc/jms/JmsAgentProxy.java b/runtime/org.argeo.slc.support.activemq/src/main/java/org/argeo/slc/jms/JmsAgentProxy.java index 2230cb876..d3027c93d 100644 --- a/runtime/org.argeo.slc.support.activemq/src/main/java/org/argeo/slc/jms/JmsAgentProxy.java +++ b/runtime/org.argeo.slc.support.activemq/src/main/java/org/argeo/slc/jms/JmsAgentProxy.java @@ -29,6 +29,7 @@ import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.argeo.slc.SlcException; import org.argeo.slc.execution.ExecutionModuleDescriptor; +import org.argeo.slc.execution.ExecutionProcess; import org.argeo.slc.msg.ExecutionAnswer; import org.argeo.slc.msg.MsgConstants; import org.argeo.slc.process.SlcExecution; @@ -74,7 +75,15 @@ public class JmsAgentProxy implements SlcAgent { } public void runSlcExecution(SlcExecution slcExecution) { - sendReceive(new AgentMC("runSlcExecution", 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() { @@ -198,9 +207,7 @@ public class JmsAgentProxy implements SlcAgent { msg = session.createTextMessage(); else msg = toMessage(body, session); - msg - .setStringProperty(MsgConstants.PROPERTY_SLC_AGENT_ID, - agentUuid); + msg.setStringProperty(MsgConstants.PROPERTY_SLC_AGENT_ID, agentUuid); msg.setStringProperty(JmsAgent.PROPERTY_QUERY, query); msg.setJMSCorrelationID(correlationId); setArguments(msg);