throw new PortletContainerException("Optional Portlet Registry Service not found.");
}
PortletAppDD ctx = portletRegistry.getPortletApplicationDescriptor(applicationId);
Iterator i = ctx.getPortlets().iterator();
while(i.hasNext()) {
PortletDD dd = (PortletDD)i.next();
if(portletName.equals(dd.getPortletName())) {
Iterator i2 = dd.getSupports().iterator();
while(i2.hasNext()) {
SupportsDD sd = (SupportsDD)i2.next();
Iterator pd = sd.getPortletModes().iterator();
while(pd.hasNext()) {
if(mode.equalsIgnoreCase((String)pd.next())) {