public ServiceResponse<KieContainerResource> createContainer(String containerId, KieContainerResource container) {
if (container == null || container.getReleaseId() == null) {
logger.error("Error creating container. Release Id is null: " + container);
return new ServiceResponse<KieContainerResource>(ServiceResponse.ResponseType.FAILURE, "Failed to create container " + containerId + ". Release Id is null: " + container + ".");
}
ReleaseId releaseId = container.getReleaseId();
try {
KieContainerInstance ci = new KieContainerInstance(containerId, KieContainerStatus.CREATING);
KieContainerInstance previous = null;
// have to synchronize on the ci or a concurrent call to dispose may create inconsistencies
synchronized (ci) {