List<ExoContainer> containers = rootContainer.getComponentInstancesOfType(ExoContainer.class);
containers.add(rootContainer);
try {
for (ExoContainer container : containers) {
ExoContainerContext.setCurrentContainer(container);
WebAppController controller = (WebAppController) container.getComponentInstanceOfType(WebAppController.class);
// TODO: figure out what is happening with the controller not existing during shutdown
if (controller != null) {
PortletApplication application = controller.getApplication(applicationId_);
if (application != null) {
application.onDestroy();
controller.removeApplication(applicationId_);
}
}
PortletConfigRegistry registry = (PortletConfigRegistry) container
.getComponentInstanceOfType(PortletConfigRegistry.class);