if (!portletContexts.containsKey(applicationId)) {
PortletAppDD portletAppDD = PortletDescriptorRegistry.getRegistry()
.getPortletAppDD(servletContext);
PortletContextImpl portletContext = new PortletContextImpl(
applicationId, servletContext, portletAppDD);
if (portletContext.getApplicationId() == null) {
throw new IllegalStateException("Unable to resolve unique identifier for portletContext.");
}
portletContexts.put(applicationId, portletContext);
fireRegistered(portletContext);