{
SecurityManager security = System.getSecurityManager();
if (security != null)
security.checkPermission(ContainerPermissions.MANAGE_CONTAINER_PERMISSION);
PortalContainerConfig config = getPortalContainerConfig();
if (config.hasDefinition())
{
// The new behavior has been detected thus, the creation will be done at the end asynchronously
if (config.isPortalContainerName(ContainerUtil.getServletContextName(context)))
{
// The portal context has been registered has a portal container
portalContexts.add(new WebAppInitContext(context));
}
else
{
if (PropertyManager.isDevelopping())
{
LOG.info("We assume that the ServletContext '" + ContainerUtil.getServletContextName(context)
+ "' is not a portal since no portal container definition with the same name has been"
+ " registered to the component PortalContainerConfig. The related portal container"
+ " will be declared as disabled.");
}
config.disablePortalContainer(ContainerUtil.getServletContextName(context));
}
// We assume that a ServletContext of a portal container owns configuration files
PortalContainer.addInitTask(context, new PortalContainer.RegisterTask());
}
else
{
// Ensure that the portal container has been registered
config.registerPortalContainerName(ContainerUtil.getServletContextName(context));
// The old behavior has been detected thus, the creation will be done synchronously
createPortalContainer(context);
}
}