use of javax.enterprise.deploy.spi.exceptions.TargetException in project Payara by payara.
the class SunDeploymentManager method getModules.
/**
*Get all modules in the specified state from the targets specified in the
* argument list.
*@param moduleType which returned modules must match
*@param array of Target indicating which targets should be searched for matching modules
*@param state state of the modules
*have for the indicated attribute to be matched
*@exception TargetException if a target was improperly formed
*@exception IllegalStateException if the method is called after release was called
*/
private TargetModuleID[] getModules(ModuleType moduleType, Target[] targetList, String state) throws TargetException, IllegalStateException {
verifyConnected();
if (moduleType == null) {
return null;
}
try {
Vector resultingTMIDs = new Vector();
for (int i = 0; i < targetList.length; i++) {
TargetImpl aTarget = (TargetImpl) targetList[i];
TargetModuleID[] tmids = deploymentFacility._listAppRefs(new Target[] { aTarget }, state, getTypeFromModuleType(moduleType));
addToTargetModuleIDs(tmids, moduleType, aTarget, resultingTMIDs);
}
/*
*Return an array of runtime type TargetModuleIDImpl [].
*/
TargetModuleID[] answer = (TargetModuleID[]) resultingTMIDs.toArray(new TargetModuleIDImpl[resultingTMIDs.size()]);
return answer;
} catch (Exception e) {
TargetException tg = new TargetException(localStrings.getLocalString("enterprise.deployapi.spi.errorgetreqmods", "Error getting required modules"));
tg.initCause(e);
throw tg;
}
}
Aggregations