/** * Get the agent adapter. * @return The agent adapter. * // todo: deprecated, all kernels should have getComponentAdapter? */ public IComponentAdapter getAgentAdapter() { return interpreter.getAgentAdapter(); }
/** * Get the agent adapter. * @return The agent adapter. */ public IComponentAdapter getComponentAdapter() { return interpreter.getAgentAdapter(); }
/** * Get the agent identifier. * @return The agent identifier. */ public IComponentIdentifier getComponentIdentifier() { return interpreter.getAgentAdapter().getComponentIdentifier(); }
/** * Exit the running or end state. * Cleans up remaining steps and timer entries. */ protected void exitState() { // System.out.println("cleanupComponent: "+getAgentAdapter().getComponentIdentifier()); ComponentTerminatedException ex = new ComponentTerminatedException(getAgentAdapter().getComponentIdentifier()); while(steps!=null && !steps.isEmpty()) { StepInfo step = removeStep(); Future<?> future = step.getFuture(); future.setException(ex); // System.out.println("Cleaning obsolete step: "+getAgentAdapter().getComponentIdentifier()+", "+step[0]); } if(microagent.timers!=null) { for(int i=0; i<microagent.timers.size(); i++) { ITimer timer = (ITimer)microagent.timers.get(i); timer.cancel(); } microagent.timers.clear(); } }
public void customResultAvailable(IMessageService ms) { // System.err.println("send msg1: "+getComponentIdentifier()+" "+me.get(SFipa.CONTENT)); ms.sendMessage(me, mt, interpreter.getAgentAdapter().getComponentIdentifier(), interpreter.getModel().getResourceIdentifier(), null, codecids) .addResultListener(createResultListener(new DelegationResultListener<Void>(ret))); } });
step.getFuture().setException(new ComponentTerminatedException(getAgentAdapter().getComponentIdentifier()));