if (kci.getKieContainer() != null) {
InternalKieContainer kieContainer = kci.getKieContainer();
kci.setKieContainer(null); // helps reduce concurrent access issues
try {
// this may fail, but we already removed the container from the registry
kieContainer.dispose();
} catch (Exception e) {
logger.warn("Container '" + containerId + "' disposed, but an unexpected exception was raised", e);
return new ServiceResponse<Void>(ServiceResponse.ResponseType.SUCCESS, "Container " + containerId +
" disposed, but exception was raised: " + e.getClass().getName() + ": " + e.getMessage());
}