/** * Schedule a step of the agent. * May safely be called from external threads. * @param step Code to be executed as a step of the agent. */ public <T> IFuture<T> scheduleStep(IComponentStep<T> step) { return interpreter.scheduleStep(step); }
/** * Schedule a step of the agent. * May safely be called from external threads. * @param step Code to be executed as a step of the agent. */ public <T> IFuture<T> scheduleStep(IComponentStep<T> step, long delay) { return interpreter.scheduleStep(step, delay); }
/** * Can be called concurrently (also during executeAction()). * * Inform the component that a stream has arrived. * Can be called concurrently (also during executeAction()). * @param con The stream that arrived. */ public void streamArrived(final IConnection con) { scheduleStep(new IComponentStep<Void>() { public IFuture<Void> execute(IInternalAccess ia) { microagent.streamArrived(con); return IFuture.DONE; } }); }
scheduleStep(new IComponentStep<Void>()
/** * Can be called concurrently (also during executeAction()). * * Inform the agent that a message has arrived. * Can be called concurrently (also during executeAction()). * @param message The message that arrived. */ public void messageArrived(final IMessageAdapter message) { // System.out.println("msgrec: "+getAgentAdapter().getComponentIdentifier()+" "+message); // IFuture ret = scheduleStep(new ICommand() scheduleStep(new HandleMessageStep(message)); }