Package org.exoplatform.container.configuration

Examples of org.exoplatform.container.configuration.ConfigurationManagerImpl


      return map;
   }

   private LocaleConfigService createService() throws Exception
   {
      ConfigurationManagerImpl cm = new ConfigurationManagerImpl();
      InitParams params = new InitParams();
      ValueParam param = new ValueParam();
      param.setName("locale.config.file");
      param.setValue("classpath:/resources/locales-config.xml");
      params.addParameter(param);
View Full Code Here


         {
            try
            {
               MockServletContext scontext = new MockServletContext(name);
               pcontainer = new PortalContainer(this, scontext);
               ConfigurationManagerImpl cService = new MockConfigurationManagerImpl(scontext);
               cService.addConfiguration(ContainerUtil.getConfigurationURL("conf/portal/configuration.xml"));
               cService.addConfiguration(ContainerUtil.getConfigurationURL("conf/portal/test-configuration.xml"));
               cService.processRemoveConfiguration();
               pcontainer.registerComponentInstance(ConfigurationManager.class, cService);
               pcontainer.initContainer();
               registerComponentInstance(name, pcontainer);
               PortalContainer.setInstance(pcontainer);
               ExoContainerContext.setCurrentContainer(pcontainer);
View Full Code Here

         PortalContainer.setInstance(pcontainer);
         executeInitTasks(pcontainer, PortalContainerPreInitTask.TYPE);
         // Set the full classloader of the portal container
         Thread.currentThread().setContextClassLoader(pcontainer.getPortalClassLoader());
         hasChanged = true;
         ConfigurationManagerImpl cService = new ConfigurationManagerImpl(pcontainer.getPortalContext(), profiles);

         // add configs from services
         try
         {
            cService.addConfiguration(ContainerUtil.getConfigurationURL("conf/portal/configuration.xml"));
         }
         catch (Exception ex)
         {
            log.error("Cannot add configuration conf/portal/configuration.xml. ServletContext: " + context, ex);
         }

         // Add configuration that depends on the environment
         String uri;
         if (serverenv_.isJBoss())
         {
            uri = "conf/portal/jboss-configuration.xml";
         }
         else
         {
            uri = "conf/portal/generic-configuration.xml";
         }
         Collection envConf = ContainerUtil.getConfigurationURL(uri);
         try
         {
            cService.addConfiguration(envConf);
         }
         catch (Exception ex)
         {
            log.error("Cannot add configuration " + uri + ". ServletContext: " + context, ex);
         }

         // add configs from web apps
         Set<WebAppInitContext> contexts = pcontainer.getWebAppInitContexts();
         for (WebAppInitContext webappctx : contexts)
         {
            ServletContext ctx = webappctx.getServletContext();
            try
            {
               cService.addConfiguration(ctx, "war:/conf/configuration.xml");
            }
            catch (Exception ex)
            {
               log.error("Cannot add configuration war:/conf/configuration.xml. ServletContext: " + ctx, ex);
            }
         }

         // add config from application server,
         // $AH_HOME/exo-conf/portal/configuration.xml
         String overrideConfig =
            singleton_.getServerEnvironment().getExoConfigurationDirectory() + "/portal/" + portalContainerName
               + "/configuration.xml";
         try
         {
            File file = new File(overrideConfig);
            if (file.exists())
               cService.addConfiguration(file.toURI().toURL());
         }
         catch (Exception ex)
         {
            log.error("Cannot add configuration " + overrideConfig + ". ServletContext: " + context, ex);
         }

         cService.processRemoveConfiguration();
         ComponentAdapter adapter = pcontainer.registerComponentInstance(ConfigurationManager.class, cService);
         pcontainer.initContainer();
         registerComponentInstance(portalContainerName, pcontainer);
         pcontainer.start();
View Full Code Here

   private static RootContainer buildRootContainer()
   {
      try
      {
         RootContainer rootContainer = new RootContainer();
         ConfigurationManagerImpl service = new ConfigurationManagerImpl(rootContainer.profiles);
         service.addConfiguration(ContainerUtil.getConfigurationURL("conf/configuration.xml"));
         if (System.getProperty("maven.exoplatform.dir") != null)
         {
            service.addConfiguration(ContainerUtil.getConfigurationURL("conf/test-configuration.xml"));
         }
         String confDir = rootContainer.getServerEnvironment().getExoConfigurationDirectory();
         String overrideConf = confDir + "/configuration.xml";
         File file = new File(overrideConf);
         if (file.exists())
         {
            service.addConfiguration("file:" + overrideConf);
         }
         service.processRemoveConfiguration();
         rootContainer.registerComponentInstance(ConfigurationManager.class, service);
         rootContainer.initContainer();
         rootContainer.start();
         return rootContainer;
      }
View Full Code Here

                  {
                     PortalContainer.setInstance(currentPortalContainer);
                     return null;
                  }
               });
               final ConfigurationManagerImpl cService = new MockConfigurationManagerImpl(scontext);
               cService.addConfiguration(ContainerUtil.getConfigurationURL("conf/portal/configuration.xml"));
               cService.addConfiguration(ContainerUtil.getConfigurationURL("conf/portal/test-configuration.xml"));
               cService.processRemoveConfiguration();
               SecurityHelper.doPrivilegedAction(new PrivilegedAction<Void>()
               {
                  public Void run()
                  {
                     currentPortalContainer.registerComponentInstance(ConfigurationManager.class, cService);
View Full Code Here

         PortalContainer.setInstance(pcontainer);
         executeInitTasks(pcontainer, PortalContainerPreInitTask.TYPE);
         // Set the full classloader of the portal container
         Thread.currentThread().setContextClassLoader(pcontainer.getPortalClassLoader());
         hasChanged = true;
         ConfigurationManagerImpl cService = new ConfigurationManagerImpl(pcontainer.getPortalContext(), profiles);

         // add configs from services
         try
         {
            cService.addConfiguration(ContainerUtil.getConfigurationURL("conf/portal/configuration.xml"));
         }
         catch (Exception ex)
         {
            log.error("Cannot add configuration conf/portal/configuration.xml. ServletContext: " + context, ex);
         }

         // Add configuration that depends on the environment
         String uri;
         if (serverenv_.isJBoss())
         {
            uri = "conf/portal/jboss-configuration.xml";
         }
         else
         {
            uri = "conf/portal/generic-configuration.xml";
         }
         Collection envConf = ContainerUtil.getConfigurationURL(uri);
         try
         {
            cService.addConfiguration(envConf);
         }
         catch (Exception ex)
         {
            log.error("Cannot add configuration " + uri + ". ServletContext: " + context, ex);
         }

         // add configs from web apps
         Set<WebAppInitContext> contexts = pcontainer.getWebAppInitContexts();
         for (WebAppInitContext webappctx : contexts)
         {
            ServletContext ctx = webappctx.getServletContext();
            try
            {
               cService.addConfiguration(ctx, "war:/conf/configuration.xml");
            }
            catch (Exception ex)
            {
               log.error("Cannot add configuration war:/conf/configuration.xml. ServletContext: " + ctx, ex);
            }
         }

         // add config from application server,
         // $AH_HOME/exo-conf/portal/configuration.xml
         String overrideConfig =
            singleton_.getServerEnvironment().getExoConfigurationDirectory() + "/portal/" + portalContainerName
               + "/configuration.xml";
         try
         {
            File file = new File(overrideConfig);
            if (file.exists())
               cService.addConfiguration(file.toURI().toURL());
         }
         catch (Exception ex)
         {
            log.error("Cannot add configuration " + overrideConfig + ". ServletContext: " + context, ex);
         }

         cService.processRemoveConfiguration();
         pcontainer.registerComponentInstance(ConfigurationManager.class, cService);
         registerComponentInstance(portalContainerName, pcontainer);
         pcontainer.start(true);

         // Register the portal as an mbean
View Full Code Here

   private static RootContainer buildRootContainer()
   {
      try
      {
         final RootContainer rootContainer = new RootContainer();
         final ConfigurationManagerImpl service = new ConfigurationManagerImpl(rootContainer.profiles);
         service.addConfiguration(ContainerUtil.getConfigurationURL("conf/configuration.xml"));
         if (PrivilegedSystemHelper.getProperty("maven.exoplatform.dir") != null)
         {
            service.addConfiguration(ContainerUtil.getConfigurationURL("conf/test-configuration.xml"));
         }
         String confDir = rootContainer.getServerEnvironment().getExoConfigurationDirectory();
         String overrideConf = confDir + "/configuration.xml";
         File file = new File(overrideConf);
         if (PrivilegedFileHelper.exists(file))
         {
            service.addConfiguration("file:" + overrideConf);
         }
         service.processRemoveConfiguration();
         SecurityHelper.doPrivilegedAction(new PrivilegedAction<Void>()
         {
            public Void run()
            {
               rootContainer.registerComponentInstance(ConfigurationManager.class, service);
View Full Code Here

   private StandaloneContainer(ClassLoader configClassLoader)
   {
      super(new MX4JComponentAdapterFactory(), null);

      //
      configurationManager = new ConfigurationManagerImpl(configClassLoader, ExoContainer.getProfiles());
      SecurityHelper.doPrivilegedAction(new PrivilegedAction<Void>()
      {
         public Void run()
         {
            registerComponentInstance(ConfigurationManager.class, configurationManager);
View Full Code Here

   private StandaloneContainer(ClassLoader configClassLoader)
   {
      super(new MX4JComponentAdapterFactory(), null);

      //
      configurationManager = new ConfigurationManagerImpl(configClassLoader, ExoContainer.getProfiles());
      this.registerComponentInstance(ConfigurationManager.class, configurationManager);
      registerComponentImplementation(SessionManagerImpl.class);
   }
View Full Code Here

         {
            try
            {
               MockServletContext scontext = new MockServletContext(name);
               pcontainer = new PortalContainer(this, scontext);
               ConfigurationManagerImpl cService = new MockConfigurationManagerImpl(scontext);
               cService.addConfiguration(ContainerUtil.getConfigurationURL("conf/portal/configuration.xml"));
               cService.addConfiguration(ContainerUtil.getConfigurationURL("conf/portal/test-configuration.xml"));
               cService.processRemoveConfiguration();
               pcontainer.registerComponentInstance(ConfigurationManager.class, cService);
               pcontainer.initContainer();
               registerComponentInstance(name, pcontainer);
               PortalContainer.setInstance(pcontainer);
               ExoContainerContext.setCurrentContainer(pcontainer);
View Full Code Here

TOP

Related Classes of org.exoplatform.container.configuration.ConfigurationManagerImpl

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.