Package org.exoplatform.container.definition

Examples of org.exoplatform.container.definition.PortalContainerConfig


    * 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();
      // Ensure that the portal container has been registered
      config.registerPortalContainerName(context.getServletContextName());
      if (config.hasDefinition())
      {
         // The new behavior has been detected thus, the creation will be done at the end asynchronously
         portalContexts.add(new WebAppInitContext(context));
         // We assume that a ServletContext of a portal container owns configuration files
         final PortalContainerPreInitTask task = new PortalContainerPreInitTask()
View Full Code Here


         {
            // Re-set the old classloader
            Thread.currentThread().setContextClassLoader(currentClassLoader);
         }
      }
      PortalContainerConfig config = getPortalContainerConfig();
      for (String portalContainerName : initTasks.keySet())
      {
         // Unregister name of portal container that doesn't exist
         log.warn("The portal container '" + portalContainerName + "' doesn't not exist or"
            + " it has not yet been registered, please check your PortalContainerDefinitions and "
            + "the loading order.");
         config.unregisterPortalContainerName(portalContainerName);
      }
      // remove all the unneeded tasks
      initTasks.clear();
   }
View Full Code Here

   {
      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(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);
      }
   }
View Full Code Here

         {
            // Re-set the old classloader
            Thread.currentThread().setContextClassLoader(currentClassLoader);
         }
      }
      PortalContainerConfig config = getPortalContainerConfig();
      for (String portalContainerName : initTasks.keySet())
      {
         if (config.isPortalContainerName(portalContainerName))
         {
            // Unregister name of portal container that doesn't exist
            log.warn("The portal container '" + portalContainerName + "' doesn't not exist or"
               + " it has not yet been registered, please check your PortalContainerDefinitions and "
               + "the loading order.");
            config.unregisterPortalContainerName(portalContainerName);           
         }
      }
      // remove all the unneeded tasks
      initTasks.clear();
   }
View Full Code Here

      registerComponentInstance(ServletContext.class, portalContext);
      context.setName(portalContext.getServletContextName());
      pinfo_ = new PortalContainerInfo(portalContext);
      registerComponentInstance(PortalContainerInfo.class, pinfo_);
      this.name = portalContext.getServletContextName();
      final PortalContainerConfig config = parent.getPortalContainerConfig();
      final List<String> dependencies = config == null ? null : config.getDependencies(name);
      if (dependencies == null || dependencies.isEmpty())
      {
         // No order is required
         this.webAppComparator = null;
      }
View Full Code Here

    * 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();
      // Ensure that the portal container has been registered
      config.registerPortalContainerName(context.getServletContextName());
      if (config.hasDefinition())
      {
         // The new behavior has been detected thus, the creation will be done at the end asynchronously
         portalContexts.add(new WebAppInitContext(context));
         // We assume that a ServletContext of a portal container owns configuration files
         final PortalContainerPreInitTask task = new PortalContainerPreInitTask()
View Full Code Here

         {
            // Re-set the old classloader
            Thread.currentThread().setContextClassLoader(currentClassLoader);
         }
      }
      PortalContainerConfig config = getPortalContainerConfig();
      for (String portalContainerName : initTasks.keySet())
      {
         // Unregister name of portal container that doesn't exist
         log.warn("The portal container '" + portalContainerName + "' doesn't not exist or"
            + " it has not yet been registered, please check your PortalContainerDefinitions and "
            + "the loading order.");
         config.unregisterPortalContainerName(portalContainerName);
      }
      // remove all the unneeded tasks
      initTasks.clear();
   }
View Full Code Here

   {
      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);
      }
   }
View Full Code Here

         ServletContainerFactory.getServletContainer().addAuthenticationListener(this);
         checkDependencies();
      }
      else
      {
         PortalContainerConfig config = getPortalContainerConfig();
         for (String portalContainerName : initTasks.keySet())
         {
            if (config.isPortalContainerName(portalContainerName))
            {
               // Unregister name of portal container that doesn't exist
               LOG.warn("The portal container '" + portalContainerName + "' doesn't exist or"
                  + " it has not yet been registered, please check your PortalContainerDefinitions and "
                  + "the loading order.");
               config.unregisterPortalContainerName(portalContainerName);
            }
         }
         // remove all the registered web application contexts
         // corresponding to the portal containers
         portalContexts.clear();
View Full Code Here

   /**
    * Checks the dependencies of all the portal containers to make sure that they really exist, if not it will print a warning.
    */
   private void checkDependencies()
   {
      PortalContainerConfig config = getPortalContainerConfig();
      if (!config.hasDefinition())
      {
         // No definition has been defined so we cannot check
         return;
      }
      final Set<String> existingWebApp = new HashSet<String>();
      WebAppListener listener = new WebAppListener()
      {
         public void onEvent(WebAppEvent event)
         {
            if (event instanceof WebAppLifeCycleEvent
               && ((WebAppLifeCycleEvent)event).getType() == WebAppLifeCycleEvent.ADDED)
            {
               existingWebApp.add(ContainerUtil.getServletContextName(event.getWebApp().getServletContext()));
            }
         }
      };
      try
      {
         // Collect the servlet context name of all the existing web apps.
         ServletContainerFactory.getServletContainer().addWebAppListener(listener);
         // Iterate over all the known portal containers
         for (Iterator<WebAppInitContext> it = portalContexts.iterator(); it.hasNext();)
         {
            WebAppInitContext context = it.next();
            String portalContainer = context.getServletContextName();
            List<String> dependencies = config.getDependencies(portalContainer);
            // Check if all the dependencies of the portal container exist.
            for (String dep : dependencies)
            {
               if (!existingWebApp.contains(dep))
               {
View Full Code Here

TOP

Related Classes of org.exoplatform.container.definition.PortalContainerConfig

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.