ModuleType type = status == null
? getModuleType()
: DeploymentClientUtils.getXModuleType(status, key, xKey);
for(int i=0; i<targetsList.length; i++) {
SunTargetModuleID parentTargetModuleID = new SunTargetModuleID(moduleID, targetsList[i]);
parentTargetModuleID.setModuleType(type);
targetModuleIDs[i] = parentTargetModuleID;
if (status != null) {
// let's get the host name and port where the application was deployed
HostAndPort webHost=null;
try {
Object[] params = new Object[]{ moduleID, Boolean.FALSE };
String[] signature = new String[]{ "java.lang.String", "boolean"};
ObjectName applicationsMBean = new ObjectName(APPS_CONFIGMBEAN_OBJNAME);
webHost = (HostAndPort) mbsc.invoke(applicationsMBean, "getHostAndPort", params, signature);
} catch(Exception e) {
Print.dprintStackTrace(e.getLocalizedMessage(), e);
}
key = moduleID + KEY_SEPARATOR + SUBMODULE_COUNT;
if (status.getProperty(key) == null) { //standalone module
if (ModuleType.WAR.equals(type) ||
XModuleType.isExtensionModule(type)) {
key = moduleID + KEY_SEPARATOR + CONTEXT_ROOT;
String contextRoot = status.getProperty(key);
if(contextRoot != null)
initTargetModuleIDWebURL(parentTargetModuleID, webHost, contextRoot, mbsc);
}
} else {
int counter = (Integer.valueOf(status.getProperty(key))).intValue();
// now for each sub module
for (int j = 0; j < counter; j++) {
//subModuleID
key = moduleID + KEY_SEPARATOR + MODULE_ID + KEY_SEPARATOR + String.valueOf(j);
String subModuleID = status.getProperty(key);
SunTargetModuleID subModule = new SunTargetModuleID(subModuleID, targetsList[i]);
//subModuleType
key = subModuleID + KEY_SEPARATOR + MODULE_TYPE;
xKey = subModuleID + KEY_SEPARATOR + XMODULE_TYPE;
//type = XModuleType.getModuleType((new Integer(status.getProperty(key))).intValue());
type = DeploymentClientUtils.getXModuleType(
status, key, xKey);
subModule.setModuleType(type);
if (ModuleType.WAR.equals(type) && webHost!=null) {
key = subModuleID + KEY_SEPARATOR + CONTEXT_ROOT;
String contextRoot = status.getProperty(key);
initTargetModuleIDWebURL(subModule, webHost, contextRoot, mbsc);
}