private void addToTargetModuleIDs(TargetModuleID[] tmids, ModuleType type, TargetImpl targetImpl, Collection resultingTMIDs) throws IOException {
for (int j = 0;j< tmids.length;j++) {
// Get the host name and port where the application was deployed
HostAndPort webHost = deploymentFacility.getHostAndPort(targetImpl.getName(), tmids[j].getModuleID(), false);
if (tmids[j] instanceof TargetModuleIDImpl) {
((TargetModuleIDImpl)tmids[j]).setModuleType(type);
}
resultingTMIDs.add(tmids[j]);