Package org.apache.commons.chain.config

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


   {
      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
         if (res == null)
            res = configurationManager.getResource(path);
         if (res == null)
            throw new Exception("Resource not found " + path);
         log.info("Catalog configuration found at " + res);
         parser.parse(res);
      }

   }
View Full Code Here


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

      ConfigParser parser = new ConfigParser();
      this.digester = parser.getDigester();
   }
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

   {
      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>()
         {
            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;
         AccessController.doPrivileged(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 = AccessController.doPrivileged(new PrivilegedAction<Digester>()
      {
         public Digester run()
         {
            return parser.getDigester();
         }
      });
   }
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

                catalog = new CatalogBase();
            }
        }

        // Construct the configuration resource parser we will use
        ConfigParser parser = new ConfigParser();
        if (ruleSet != null) {
            try {
                ClassLoader loader =
                    Thread.currentThread().getContextClassLoader();
                if (loader == null) {
                    loader = this.getClass().getClassLoader();
                }
                Class clazz = loader.loadClass(ruleSet);
                parser.setRuleSet((RuleSet) clazz.newInstance());
            } catch (Exception e) {
                throw new ServletException("Exception initalizing RuleSet '"
                                           + ruleSet + "' instance", e);
            }
        }
View Full Code Here

                catalog = new CatalogBase();
            }
        }

        // Construct the configuration resource parser we will use
        ConfigParser parser = new ConfigParser();
        if (ruleSet != null) {
            try {
                ClassLoader loader =
                    Thread.currentThread().getContextClassLoader();
                if (loader == null) {
                    loader = this.getClass().getClassLoader();
                }
                Class clazz = loader.loadClass(ruleSet);
                parser.setRuleSet((RuleSet) clazz.newInstance());
            } catch (Exception e) {
                throw new RuntimeException("Exception initalizing RuleSet '"
                                           + ruleSet + "' instance: "
                                           + e.getMessage());
            }
View Full Code Here

   {
      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
         if (res == null)
            res = configurationManager.getResource(path);
         if (res == null)
            throw new Exception("Resource not found " + path);
         System.out.println("Catalog configuration found at " + res);
         parser.parse(res);
      }

   }
View Full Code Here

                catalog = new CatalogBase();
            }
        }

        // Construct the configuration resource parser we will use
        ConfigParser parser = new ConfigParser();
        if (ruleSet != null) {
            try {
                ClassLoader loader =
                    Thread.currentThread().getContextClassLoader();
                if (loader == null) {
                    loader = this.getClass().getClassLoader();
                }
                Class clazz = loader.loadClass(ruleSet);
                parser.setRuleSet((RuleSet) clazz.newInstance());
            } catch (Exception e) {
                throw new ServletException("Exception initalizing RuleSet '"
                                           + ruleSet + "' instance", e);
            }
        }
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.