}
try {
PortletApplicationDefinition portletApp = portletRegistry.getPortletApplication(applicationName);
Iterator customModes = portletApp.getCustomPortletModes().iterator();
while (customModes.hasNext()) {
CustomPortletModeType customMode = (CustomPortletModeType)customModes.next();
boolean isPortletManagedMode = !customMode.isPortalManaged();
if (isPortletManagedMode && customMode.getPortletMode().equalsIgnoreCase(mode)) {
return true;
}
}
} catch (PortletContainerException e) {
LOG.error("Error determining portlet managed mode support, so we assume that it is false.", e);