use of org.exoplatform.container.component.ComponentRequestLifecycle in project kernel by exoplatform.
the class JobEnvironmentConfigListener method jobWasExecuted.
public void jobWasExecuted(JobExecutionContext context, JobExecutionException exception) {
String containerName = extractContainerName(context);
ExoContainer container = null;
if (containerName != null) {
if (containerName.equals(JobSchedulerServiceImpl.STANDALONE_CONTAINER_NAME)) {
container = ExoContainerContext.getTopContainer();
} else {
RootContainer rootContainer = RootContainer.getInstance();
container = (ExoContainer) rootContainer.getComponentInstance(containerName);
}
}
if (container != null) {
List<ComponentRequestLifecycle> components = container.getComponentInstancesOfType(ComponentRequestLifecycle.class);
for (ComponentRequestLifecycle component : components) {
component.endRequest(container);
}
RequestLifeCycle.end();
ExoContainerContext.setCurrentContainer(null);
}
}
Aggregations