/** * Get the root. * @return the root. */ public IComponentIdentifier getRoot() { if(root==null) this.root = agent.getComponentIdentifier().getRoot(); return root; }
/** * Get the agent name. * @return The agent name. */ public String getAgentName() { return getComponentIdentifier().getLocalName(); }
/** * Get the root. * @return the root. */ public IComponentIdentifier getRoot() { if(root==null) this.root = agent.getComponentIdentifier().getRoot(); return root; }
/** * Called by new platform after correct startup. * * Acknowledgement is complete when called twice: * a) after creation with cid of new platform * b) after new update agent has send ack to this agent (handshake) * * After ack is complete platform shutdown will be initiated. */ public void acknowledgeUpdate(IComponentIdentifier caller) { // System.out.println("ack: "+caller); if(caller.equals(newcomp)) { // System.out.println("Update acknowledged, shutting down old platform: "+agent.getComponentIdentifier()); cms.destroyComponent(agent.getComponentIdentifier().getRoot()); } else if(newcomp==null) { newcomp = caller; } }
public void exceptionOccurred(Exception exception) { collectInjectedResults(); nosteps = true; exitState(); StringWriter sw = new StringWriter(); exception.printStackTrace(new PrintWriter(sw)); microagent.getLogger().severe(microagent.getComponentIdentifier()+", "+microagent.getModel().getFullName()+": Exception during cleanup: "+sw); ret.setResult(null); } }));
/** * Announce a potentially new component identifier. * @param cid The component identifier. */ public IFuture<Void> announceComponentIdentifier(IComponentIdentifier ccid) { // Only handle platforms IComponentIdentifier cid = ccid.getRoot(); // Ignore self messages if(!getMicroAgent().getComponentIdentifier().getRoot().equals(cid)) { refreshComponentIdentifier(cid, System.currentTimeMillis()); } return IFuture.DONE; }
public void customResultAvailable(IComponentManagementService cms) { cms.destroyComponent(getComponentIdentifier()) .addResultListener(new DelegationResultListener<Map<String, Object>>(ret)); } });
/** * Announce a potentially new component identifier. * @param cid The component identifier. */ public IFuture<Void> announceComponentIdentifier(IComponentIdentifier ccid) { // Only handle platforms IComponentIdentifier cid = ccid.getRoot(); // Return in case of self message. if(getMicroAgent().getComponentIdentifier().getRoot().equals(cid)) return IFuture.DONE; // Do not start another check if already contained if(announcements.containsKey(cid)) { // Update time announcements.put(cid, System.currentTimeMillis()); } else { // System.out.println("enter: "+cid); performAnnouncements(cid); } return IFuture.DONE; }
args.put("creator", agent.getComponentIdentifier()); String argsstr = AWriter.objectToXML(XMLWriterFactory.getInstance().createWriter(true, false, false), args, null, JavaWriter.getObjectHandler());
args.put("creator", agent.getComponentIdentifier()); String argsstr = AWriter.objectToXML(XMLWriterFactory.getInstance().createWriter(true, false, false), args, null, JavaWriter.getObjectHandler());
final String sendid = SUtil.createUniqueId(agent.getMicroAgent().getComponentIdentifier().getLocalName()); this.sendid = sendid;
final String sendid = SUtil.createUniqueId(agent.getMicroAgent().getComponentIdentifier().getLocalName()); this.sendid = sendid;
.getComponentIdentifier().getLocalName()); this.sendid = sendid;
.getComponentIdentifier().getLocalName()); this.sendid = sendid;