b.append("doDeploy ").append(numAllowed).append(" [");
b.append(LoggingUtil.getLoggingName(req)).append("] instances");
for (int i = 0; i < numAllowed; i++) {
ProvisionRequest request = ProvisionRequest.copy(req);
ServiceProvisionContext spc = getServiceProvisionContext();
long nextID = (changeInstanceID ?
request.getInstanceIDMgr().getNextInstanceID() : currentID);
if(changeInstanceID)
logger.warn("[{}] Changing instanceID", LoggingUtil.getLoggingName(request));
request.setServiceElement(ServiceElementUtil.prepareInstanceID(request.getServiceElement(),
true,
nextID));
logger.trace("[{}] instanceID : {}",
LoggingUtil.getLoggingName(request),
request.getServiceElement().getServiceBeanConfig().getInstanceID());
spc.getInProcess().add(request.getServiceElement());
spc.setProvisionRequest(request);
spc.setServiceResource(resource);
spc.getProvisioningPool().execute(new ProvisionTask(spc, null));
}
logger.debug(b.toString());
}
return (numAllowed);
}