logger.severe("Can not launch remote component", e);
throw new NonstandardException("Can not launch remote component", e);
}
// initialize XCATComponentIDClient with a null GSH
XCATComponentID cid = null;
if (componentType.equals("basic"))
cid = new XCATComponentIDClientImpl(instanceName, null);
else if (componentType.equals("mobile"))
cid = new MobileComponentIDClientImpl(instanceName, null);
else // shouldn't get here, since we have thrown this exception before
throw new NonstandardException("Unknown componentType: " + componentType);
// insert into the namedComponentIDs hashMap
namedComponentIDs.put(instanceName, cid);
synchronized(cid) {
if (cid.getSerialization() == null)
try {
logger.finest("waiting to receive ComponentID");
// wait to receive the ComponentID from remote component
long timeout = properties.getLong("timeout", DEFAULT_TIMEOUT);
logger.finest("received timeout: " + timeout);
cid.wait(timeout);
logger.finest("woken up after waiting to receive ComponentID");
} catch (InterruptedException ie) {
logger.severe(ie.toString(), ie);
}
}
// check if the ComponentiD has been received
if (cid.getSerialization() == null)
throw new NonstandardException("Timed out while receiving ComponentID");
// transfer the properties object to the component
cid.setProperties(TypeUtil.toXML(properties));
// return the ComponentID from the namedComponentIDs hashMap
return cid;
}