// 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);