* expect the old behavior, thus the portal container will be initialized synchronously
* @param context the context of the portal container
*/
public void registerPortalContainer(ServletContext context)
{
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(context.getServletContextName()))
{
// 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 '" + context.getServletContextName()
+ "' 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(context.getServletContextName());
}
// We assume that a ServletContext of a portal container owns configuration files
final PortalContainerPreInitTask task = new PortalContainerPreInitTask()
{
public void execute(ServletContext context, PortalContainer portalContainer)
{
portalContainer.registerContext(context);
}
};
PortalContainer.addInitTask(context, task);
}
else
{
// Ensure that the portal container has been registered
config.registerPortalContainerName(context.getServletContextName());
// The old behavior has been detected thus, the creation will be done synchronously
createPortalContainer(context);
}
}