* by an arriving container; if false this is being
* triggered by a departing container
* @throws InterruptedException
*/
protected void redeployModule(ModuleDeployment moduleDeployment, boolean arriving) throws Exception {
DeploymentUnit deploymentUnit = moduleDeployment.deploymentUnit;
ModuleDescriptor moduleDescriptor = moduleDeployment.moduleDescriptor;
RuntimeModuleDeploymentProperties deploymentProperties = moduleDeployment.runtimeDeploymentProperties;
ModuleDeploymentStatus deploymentStatus = null;
// in the case of a departing container, the module should
// only be redeployed if count > 0
if (arriving || deploymentProperties.getCount() > 0) {
try {
deploymentStatus = deployModule(moduleDeployment, instantiateContainerMatcher(moduleDescriptor));
}
catch (NoContainerException e) {
logger.warn("No containers available for redeployment of {} for stream {}",
moduleDescriptor.getModuleLabel(),
deploymentUnit.getName());
}
finally {
updateDeploymentUnitState(moduleDeployment, deploymentStatus);
}
}