Package org.apache.commons.chain.config

Examples of org.apache.commons.chain.config.ConfigParser


        Catalog catalog = CatalogFactory.getInstance().getCatalog(
                Globals.CLAY_CATALOG_NAME);
        if (catalog == null) {

            ConfigParser parser = new ConfigParser();
            URL url = this.getClass().getClassLoader().getResource(
                    Globals.CLAY_RESOURCE_NAME);
            if (url == null) {
                throw new IllegalArgumentException(Globals.CLAY_RESOURCE_NAME);
            }
            parser.parse(url);

            catalog = CatalogFactory.getInstance().getCatalog(
                    Globals.CLAY_CATALOG_NAME);

        }
View Full Code Here


        // Configure this catalog based on our default resource
        if (log().isDebugEnabled()) {
            log().debug(messages.getMessage("filter.parsingResource",
                                            new Object[] { RESOURCE_NAME }));
        }
        ConfigParser parser = new ConfigParser();
        URL url = this.getClass().getClassLoader().getResource(RESOURCE_NAME);
        if (url == null) {
            throw new IllegalArgumentException(RESOURCE_NAME);
        }
        parser.parse(url);

        return catalog;

    }
View Full Code Here

            if (value != null) {
                chainConfig = value;
            }

            ConfigParser parser = new ConfigParser();
            List urls = splitAndResolvePaths(chainConfig);
            URL resource;

            for (Iterator i = urls.iterator(); i.hasNext();) {
                resource = (URL) i.next();
                log.info("Loading chain catalog from " + resource);
                parser.parse(resource);
            }
        } catch (Exception e) {
            log.error("Exception loading resources", e);
            throw new ServletException(e);
        }
View Full Code Here

   {
      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 = SecurityHelper.doPrivilegedAction(new PrivilegedAction<URL>()
         {
            public URL run()
            {
               return Thread.currentThread().getContextClassLoader().getResource(path);
            }
         });
        
         // for PortalContainer
         if (res == null)
            res = configurationManager.getResource(path);
         if (res == null)
            throw new Exception("Resource not found " + path);
         LOG.info("Catalog configuration found at " + res);
        
         final URL fRes = res;
         SecurityHelper.doPrivilegedExceptionAction(new PrivilegedExceptionAction<Void>()
         {
            public Void run() throws Exception
            {
               parser.parse(fRes);
               return null;
            }
         });
      }
View Full Code Here

   public CommandService()
   {
      this.catalogFactory = CatalogFactoryBase.getInstance();

      final ConfigParser parser = new ConfigParser();
      this.digester = SecurityHelper.doPrivilegedAction(new PrivilegedAction<Digester>()
      {
         public Digester run()
         {
            return parser.getDigester();
         }
      });
   }
View Full Code Here

    private ConfigParser parser;

    @PostConstruct
    public void loadCatalog() throws Exception {
        parser = new ConfigParser();
        reload();
    }
View Full Code Here

   {
      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 = SecurityHelper.doPrivilegedAction(new PrivilegedAction<URL>()
         {
            public URL run()
            {
               return Thread.currentThread().getContextClassLoader().getResource(path);
            }
         });
        
         // for PortalContainer
         if (res == null)
            res = configurationManager.getResource(path);
         if (res == null)
            throw new Exception("Resource not found " + path);
         log.info("Catalog configuration found at " + res);
        
         final URL fRes = res;
         SecurityHelper.doPrivilegedExceptionAction(new PrivilegedExceptionAction<Void>()
         {
            public Void run() throws Exception
            {
               parser.parse(fRes);
               return null;
            }
         });
      }
View Full Code Here

TOP

Related Classes of org.apache.commons.chain.config.ConfigParser

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.