/** * Create a new mechanism. */ public TTPAcquisitionMechanism(String ttpname) { this.ttpcid = ttpname==null? null: new ComponentIdentifier(ttpname); this.verify = true; this.rnd = new Random(); // setTTPCid(new ComponentIdentifier(ttpname)); // setverify(true); }
/** * Get the root identifier. * @return The root identifier. */ public IComponentIdentifier getRoot() { // return new ComponentIdentifier(getPlatformName(), getAddresses(), getResolvers()); return new ComponentIdentifier(getPlatformName(), getAddresses()); }
/** * Clone this component identifier. * Does a deep copy. */ public Object clone() { ComponentIdentifier clone = new ComponentIdentifier(getName(), getAddresses()); // // Deep copy of resolvers. // ComponentIdentifier[] res = getResolvers(); // for(int i = 0; i < res.length; i++) // clone.addResolver((ComponentIdentifier)res[i].clone()); return clone; }
/** * Get the platform name without the suffix for name uniqueness. * @return The platform name without suffix. */ public String getPlatformPrefix() { return getPlatformPrefix(getPlatformName()); }
/** * Get the parent identifier. * @return The parent identifier (if any). */ public IComponentIdentifier getParent() { IComponentIdentifier ret = null; int at = name.indexOf("@"); int idx = name.indexOf(".", at); if(idx!=-1) { String paname = name.substring(at+1, idx); String pfname = name.substring(idx+1); ret = new ComponentIdentifier(paname+"@"+pfname, getAddresses()); } else if(at!=-1) { String paname = name.substring(at+1); ret = new ComponentIdentifier(paname, getAddresses()); } // else at root. return ret; }
ComponentIdentifier tcid = new ComponentIdentifier(cid.getName()); TransportAddressBook tab = TransportAddressBook.getAddressBook(cid); if(tab!=null) tcid.setAddresses(tab.getPlatformAddresses(cid));
/** * @return the local name of a component */ public String getLocalName() { String ret = getName(); int idx; if((idx = ret.indexOf('@')) != -1) ret = ret.substring(0, idx); return ret; }
update.setString(param++, ComponentIdentifier.getPlatformPrefix(rs.getString("PLATFORM"))); update.setInt(param++, rs.getInt("ID")); update.executeUpdate(); String name = "and_"+rs.getString("PLATFORM").substring(4); update.setString(param++, name); update.setString(param++, ComponentIdentifier.getPlatformPrefix(name)); update.setInt(param++, rs.getInt("ID")); update.executeUpdate();
/** * Get the parent identifier. * @return The parent identifier (if any). */ public IComponentIdentifier getParent() { IComponentIdentifier ret = null; int at = name.indexOf("@"); int idx = name.indexOf(".", at); if(idx!=-1) { String paname = name.substring(at+1, idx); String pfname = name.substring(idx+1); // ret = new ComponentIdentifier(paname+"@"+pfname, getAddresses(), getResolvers()); ret = new ComponentIdentifier(paname+"@"+pfname, getAddresses()); } else if(at!=-1) { String paname = name.substring(at+1); // ret = new ComponentIdentifier(paname, getAddresses(), getResolvers()); ret = new ComponentIdentifier(paname, getAddresses()); } // else at root. return ret; }
/** * Get the platform name. * @return The platform name. */ public String getPlatformName() { String ret = getName(); int idx; if((idx = ret.indexOf('@')) != -1) ret = ret.substring(idx + 1); if((idx = ret.lastIndexOf('.')) != -1) ret = ret.substring(idx + 1); return ret; }
insert.setDouble(param++, pi.getBytes()); insert.setDouble(param++, pi.getTransferTime()); insert.setString(param++, ComponentIdentifier.getPlatformPrefix(name)); insert.executeUpdate(); ResultSet keys = insert.getGeneratedKeys(); update.setDouble(param++, pi.getBytes()); update.setDouble(param++, pi.getTransferTime()); update.setString(param++, ComponentIdentifier.getPlatformPrefix(name)); update.setInt(param++, pi.getDBId().intValue()); update.executeUpdate();
/** * Create a new agent factory for startup. * @param platform The platform. */ // This constructor is used by the Starter class and the ADFChecker plugin. public MicroAgentFactory(String providerid) { super(new ComponentIdentifier(providerid), IComponentFactory.class, null); this.loader = new MicroModelLoader(); }
/** * Get the root identifier. * @return The root identifier. */ public IComponentIdentifier getRoot() { return new ComponentIdentifier(getPlatformName(), getAddresses()); }
/** * Clone this component identifier. * Does a deep copy. */ public Object clone() { ComponentIdentifier clone = new ComponentIdentifier(getName(), getAddresses()); return clone; }
/** * Create a new factory for startup. * @param platform The platform. */ // This constructor is used by the Starter class and the ADFChecker plugin. public BpmnFactory(String providerid) { super(new ComponentIdentifier(providerid), IComponentFactory.class, null); this.loader = new BpmnModelLoader(); }
/** * Create a new agent factory for startup. * @param platform The platform. */ // This constructor is used by the Starter class and the ADFChecker plugin. public BDIAgentFactory(String providerid) { super(new ComponentIdentifier(providerid), IComponentFactory.class, null); this.loader = new BDIModelLoader(); }
/** * Set the component identifier. */ public void setComponentIdentifier(IComponentIdentifier cid) { // System.out.println("set cid: "+cid+", "+(cid!=null ? SUtil.arrayToString(cid.getAddresses()):"[]")); this.cid = cid!=null? cid: new ComponentIdentifier(); // this.cid = aid!=null ? aid : cms.createComponentIdentifier(null, false, null); refresh(); }
/** * Get the platform identifier. */ protected static IComponentIdentifier getPlatformIdentifier(StringBuffer buf) { IComponentIdentifier ret = null; String str = buf.toString(); int idx = str.indexOf("platform startup time"); // hack?! better way to identify platform cid? if(idx!=-1) { str = str.substring(0, idx); idx = str.lastIndexOf(SUtil.LF); if(idx!=-1) { str = str.substring(idx+SUtil.LF.length()); } // System.out.println("platform id: "+str); ret = new ComponentIdentifier(str.trim()); } return ret; }
public void customResultAvailable(Object result) { IComponentManagementService cms = (IComponentManagementService)result; nameediting = true; // ComponentIdentifierPanel.this.cid = cms.createComponentIdentifier(tfname.getText(), false, cid.getAddresses()); ComponentIdentifierPanel.this.cid = new ComponentIdentifier(tfname.getText(), cid.getAddresses()); cidChanged(); nameediting = false; } });
public void customResultAvailable(IComponentManagementService cms) { if(name.indexOf("@")==-1) { ret.setResult(new ComponentIdentifier(name, parent, parent.getAddresses())); // ret.setResult(cms.createComponentIdentifier(name, parent, parent.getAddresses())); } else { ret.setResult(new ComponentIdentifier(name)); // ret.setResult(cms.createComponentIdentifier(name, false)); } } });