Package org.exoplatform.container.configuration

Examples of org.exoplatform.container.configuration.ConfigurationManagerImpl


   public void testFilters2()
   {
      // create helper with predefined include and exclude patterns
      TemplateConfigurationHelper helper =
         new TemplateConfigurationHelper(new String[]{"^jbosscache-.*", "^jgroups-configuration"},
            new String[]{"^jbosscache-configuration"}, new ConfigurationManagerImpl());
      Map<String, String> parameters = new HashMap<String, String>();
      parameters.put("jgroups-configuration", "");
      parameters.put("jbosscache-cache.loader", "");
      parameters.put("jbosscache-clustername", "");
      parameters.put("max-volatile-size", "");
View Full Code Here


   public void testTemplating() throws IOException
   {
      TemplateConfigurationHelper helper =
         new TemplateConfigurationHelper(new String[]{"^jbosscache-.*", "^jgroups-configuration"},
            new String[]{"^jbosscache-configuration"}, new ConfigurationManagerImpl());
      String template = "configuration in any format, containing ${jbosscache-template-variable} and many others";
      String expectedConfig = "configuration in any format, containing pretty good parameter and many others";

      InputStream templateStream = new ByteArrayInputStream(template.getBytes());

View Full Code Here

      WorkspaceEntry workspaceEntry = new WorkspaceEntry();
      workspaceEntry.setCache(entry);
      workspaceEntry.setUniqueName("MyWorkspace");
      try
      {
         return new ISPNCacheWorkspaceStorageCache(workspaceEntry, new ConfigurationManagerImpl());
      }
      finally
      {
         map.clear();
         map.putAll(backupMap);
View Full Code Here

      CacheEntry entry = new CacheEntry(list);
      entry.setEnabled(true);
      WorkspaceEntry workspaceEntry = new WorkspaceEntry();
      workspaceEntry.setUniqueName("WS_UUID");
      workspaceEntry.setCache(entry);
      return new ISPNCacheWorkspaceStorageCache(workspaceEntry, new ConfigurationManagerImpl());
   }
View Full Code Here

      maxBackupFiles.setName("max-backup-files");
      maxBackupFiles.setValue("5");

      params.addParam(maxBackupFiles);
     
      ConfigurationManagerImpl configManager =
         (ConfigurationManagerImpl)container.getComponentInstanceOfType(ConfigurationManagerImpl.class);
      InitialContextInitializer context =
         (InitialContextInitializer)container.getComponentInstanceOfType(InitialContextInitializer.class);
      String defaultRepositoryName = repositoryService.getConfig().getDefaultRepositoryName();
View Full Code Here

      entry.setEnabled(true);
      WorkspaceEntry workspaceEntry = new WorkspaceEntry();
      workspaceEntry.setCache(entry);
      workspaceEntry.setUniqueName("MyWorkspace");
      JBossCacheWorkspaceStorageCache cache = new JBossCacheWorkspaceStorageCache(workspaceEntry,
         transactionService == null ? null : transactionService, new ConfigurationManagerImpl());
      cache.start();
      return cache;
   }
View Full Code Here

      entry.setEnabled(true);
      WorkspaceEntry workspaceEntry = new WorkspaceEntry();
      workspaceEntry.setUniqueName("WS_UUID");
      workspaceEntry.setCache(entry);
      return new JBossCacheWorkspaceStorageCache(workspaceEntry,
         transactionService == null ? null : transactionService, new ConfigurationManagerImpl());
   }
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);
      // Workaround used to allow to use the PropertyConfigurator with the StandaloneContainer
      // If the system property PropertyManager.PROPERTIES_URL has been set properly, it will load the properties
      // from the file and load them as system properties
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 =
            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

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.