Package org.exoplatform.container.xml

Examples of org.exoplatform.container.xml.ValueParam


     * @param params the init params
     * @throws Exception any exception
     */
    public WebAppController(InitParams params) throws Exception {
        // Get router config
        ValueParam routerConfig = params.getValueParam("controller.config");
        if (routerConfig == null) {
            throw new IllegalArgumentException("No router param defined");
        }
        String configurationPath = routerConfig.getValue();

        //
        this.applications_ = new HashMap<String, Application>();
        this.attributes_ = new HashMap<String, Object>();
        this.handlers = new HashMap<String, WebRequestHandler>();
View Full Code Here


    }

    public PicketLinkIDMServiceImpl(ExoContainerContext exoContainerContext, InitParams initParams,
            HibernateService hibernateService, ConfigurationManager confManager, PicketLinkIDMCacheService picketLinkIDMCache,
            InitialContextInitializer dependency) throws Exception {
        ValueParam config = initParams.getValueParam(PARAM_CONFIG_OPTION);
        ValueParam jndiName = initParams.getValueParam(PARAM_JNDI_NAME_OPTION);
        ValueParam canExpireStructureCacheEntriesParam = initParams
                .getValueParam(PARAM_SKIP_EXPIRATION_STRUCTURE_CACHE_ENTRIES);
        ValueParam staleCacheNodesLinksCleanerDelayParam = initParams
                .getValueParam(PARAM_STALE_CACHE_NODES_LINKS_CLEANER_DELAY);
        ValueParam realmName = initParams.getValueParam(REALM_NAME_OPTION);
        ValueParam apiCacheConfig = initParams.getValueParam(CACHE_CONFIG_API_OPTION);
        ValueParam storeCacheConfig = initParams.getValueParam(CACHE_CONFIG_STORE_OPTION);

        this.hibernateService = hibernateService;

        if (config == null && jndiName == null) {
            throw new IllegalStateException("Either '" + PARAM_CONFIG_OPTION + "' or '" + PARAM_JNDI_NAME_OPTION
                    + "' parameter must " + "be specified");
        }
        if (realmName != null) {
            this.realmName = realmName.getValue();
        }

        long staleCacheNodesLinksCleanerDelay = staleCacheNodesLinksCleanerDelayParam == null ? DEFAULT_STALE_CACHE_NODES_LINKS_CLEANER_DELAY
                : Long.parseLong(staleCacheNodesLinksCleanerDelayParam.getValue());

        boolean skipExpirationOfStructureCacheEntries = canExpireStructureCacheEntriesParam != null
                && "true".equals(canExpireStructureCacheEntriesParam.getValue());
        // Not ideal, as we are changing field of singleton (could be changed more time with different values for different
        // portal containers)
        infinispanCacheFactory.setSkipExpirationOfStructureCacheEntries(skipExpirationOfStructureCacheEntries);

        if (config != null) {
            this.config = config.getValue();
            URL configURL = confManager.getURL(this.config);

            if (configURL == null) {
                throw new IllegalStateException("Cannot fine resource: " + this.config);
            }

            IdentityConfigurationMetaData configMD = JAXB2IdentityConfiguration.createConfigurationMetaData(confManager
                    .getInputStream(this.config));

            identityConfiguration = new IdentityConfigurationImpl().configure(configMD);

            identityConfiguration.getIdentityConfigurationRegistry().register(hibernateService.getSessionFactory(),
                    "hibernateSessionFactory");

            if (apiCacheConfig != null) {

                InputStream configStream = confManager.getInputStream(apiCacheConfig.getValue());

                if (configStream == null) {
                    throw new IllegalArgumentException("Infinispan configuration InputStream is null");
                }

                Cache cache = infinispanCacheFactory.createInfinispanCache(configStream,
                        exoContainerContext.getPortalContainerName(), "api");

                configStream.close();

                // PLIDM API cache
                APICacheProvider apiCacheProvider = infinispanCacheFactory.createAPICacheProvider(
                        staleCacheNodesLinksCleanerDelay, cache);
                picketLinkIDMCache.register(apiCacheProvider);
                identityConfiguration.getIdentityConfigurationRegistry().register(apiCacheProvider, "apiCacheProvider");

                // Integration cache
                integrationCache = infinispanCacheFactory.createIntegrationCache(cache);
                picketLinkIDMCache.register(integrationCache);

            }

            if (storeCacheConfig != null) {
                InputStream configStream = confManager.getInputStream(storeCacheConfig.getValue());

                if (configStream == null) {
                    throw new IllegalArgumentException("Infinispan configuration InputStream is null");
                }
View Full Code Here

         def.setRealmName(DEFAULT_REALM_NAME);
         if (params == null)
         {
            return;
         }
         final ValueParam vp = params.getValueParam("default.realm.name");
         if (vp != null && vp.getValue().trim().length() > 0)
         {
            // A realm name has been defined in the value parameter, thus we use it
            def.setRealmName(Deserializer.resolveVariables(vp.getValue().trim()));
         }
      }
      else
      {
         // We ensure that the realm name doesn't contain any useless characters
View Full Code Here

         def.setRestContextName(DEFAULT_REST_CONTEXT_NAME);
         if (params == null)
         {
            return;
         }
         final ValueParam vp = params.getValueParam("default.rest.context");
         if (vp != null && vp.getValue().trim().length() > 0)
         {
            // A rest context name has been defined in the value parameter, thus we use it
            def.setRestContextName(Deserializer.resolveVariables(vp.getValue().trim()));
         }
      }
      else
      {
         // We ensure that the rest context name doesn't contain any useless characters
View Full Code Here

         def.setName(DEFAULT_PORTAL_CONTAINER_NAME);
         if (params == null)
         {
            return;
         }
         final ValueParam vp = params.getValueParam("default.portal.container");
         if (vp != null && vp.getValue().trim().length() > 0)
         {
            // A name has been defined in the value parameter, thus we use it
            def.setName(Deserializer.resolveVariables(vp.getValue().trim()));
         }
      }
      else
      {
         // We ensure that the name doesn't contain any useless characters
View Full Code Here

  
   private static Log log = ExoLogger.getLogger("exo.kernel.component.cache.CommonsXMLConfigurationPlugin");

   public CommonsXMLConfigurationPlugin(InitParams params, ConfigurationManager configurationManager) throws Exception
   {
      ValueParam confFile = params.getValueParam("config-file");
      if (confFile != null)
      {
         String path = confFile.getValue();
         ConfigParser parser = new ConfigParser();
         // may work for StandaloneContainer
         ClassLoader cl = Thread.currentThread().getContextClassLoader();
         URL res = cl.getResource(path);
         // for PortalContainer
View Full Code Here

    * @throws Exception
    */
   public LogConfigurationInitializer(InitParams params) throws Exception
   {

      ValueParam loggerValue = params.getValueParam("logger");
      if (loggerValue != null)
         logger = loggerValue.getValue();

      ValueParam confValue = params.getValueParam("configurator");
      if (confValue != null)
         configurer = confValue.getValue();

      PropertiesParam p = params.getPropertiesParam("properties");
      if (p != null)
         properties = p.getProperties();

View Full Code Here

  
   private static Log log = ExoLogger.getLogger("exo.kernel.component.cache.CommonsXMLConfigurationPlugin");

   public CommonsXMLConfigurationPlugin(InitParams params, ConfigurationManager configurationManager) throws Exception
   {
      ValueParam confFile = params.getValueParam("config-file");
      if (confFile != null)
      {
         final String path = confFile.getValue();
         final ConfigParser parser = new ConfigParser();
         // may work for StandaloneContainer
        
         URL res = AccessController.doPrivileged(new PrivilegedAction<URL>()
         {
View Full Code Here

   public RepositoryServiceConfigurationImpl(InitParams params, ConfigurationManager configurationService,
      InitialContextInitializer initialContextInitializer) throws RepositoryConfigurationException
   {
      param = params.getValueParam("conf-path");
      ValueParam valueBackupFiles = params.getValueParam("max-backup-files");
      maxBackupFiles =
         valueBackupFiles == null ? DEFAULT_MAX_BACKUP_FILES : Integer.valueOf(valueBackupFiles.getValue());

      if (params.getPropertiesParam("working-conf") != null)
      {
         String cn = params.getPropertiesParam("working-conf").getProperty("persister-class-name");
         if (cn == null)
View Full Code Here

   {
      this.sessionProviderService = sessionProviderService;
      this.repositoryService = repositoryService;
      this.nullResourceLocks = new NullResourceLocksHolder();

      ValueParam pXSLTParam = params.getValueParam(FOLDER_ICON_PATH);
      if (pXSLTParam != null)
      {
         xsltParams.put(FOLDER_ICON_PATH, pXSLTParam.getValue());
         log.info(FOLDER_ICON_PATH + " = " + pXSLTParam.getValue());
      }

      ValueParam pDefFolderNodeType = params.getValueParam(INIT_PARAM_DEF_FOLDER_NODE_TYPE);
      if (pDefFolderNodeType != null)
      {
         defaultFolderNodeType = pDefFolderNodeType.getValue();
         log.info(INIT_PARAM_DEF_FOLDER_NODE_TYPE + " = " + defaultFolderNodeType);
      }

      ValueParam pDefFileNodeType = params.getValueParam(INIT_PARAM_DEF_FILE_NODE_TYPE);
      if (pDefFileNodeType != null)
      {
         defaultFileNodeType = pDefFileNodeType.getValue();
         log.info(INIT_PARAM_DEF_FILE_NODE_TYPE + " = " + defaultFileNodeType);
      }

      ValueParam pDefFileMimeType = params.getValueParam(INIT_PARAM_DEF_FILE_MIME_TYPE);
      if (pDefFileMimeType != null)
      {
         defaultFileMimeType = pDefFileMimeType.getValue();
         log.info(INIT_PARAM_DEF_FILE_MIME_TYPE + " = " + defaultFileMimeType);
      }

      ValueParam pUpdatePolicy = params.getValueParam(INIT_PARAM_UPDATE_POLICY);
      if (pUpdatePolicy != null)
      {
         updatePolicyType = pUpdatePolicy.getValue();
         log.info(INIT_PARAM_UPDATE_POLICY + " = " + updatePolicyType);
      }

      ValueParam pAutoVersion = params.getValueParam(INIT_PARAM_AUTO_VERSION);
      if (pAutoVersion != null)
      {
         autoVersionType = pAutoVersion.getValue();
         log.info(INIT_PARAM_AUTO_VERSION + " = " + autoVersionType);
      }

      ValueParam pCacheControl = params.getValueParam(INIT_PARAM_CACHE_CONTROL);
      if (pCacheControl != null)
      {
         String cacheControlConfigValue = pCacheControl.getValue();

         try
         {
            String[] elements = cacheControlConfigValue.split(";");
            for (String element : elements)
View Full Code Here

TOP

Related Classes of org.exoplatform.container.xml.ValueParam

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.