Package org.apache.commons.configuration

Examples of org.apache.commons.configuration.BaseConfiguration


   * @param args
   *            the arguments
   */
  public static void main(String[] args)
  {
    Configuration conf = new BaseConfiguration();
    conf.setProperty("wrapper.java.command", "java");
    WindowsJavaHome javaHome = new WindowsJavaHome(conf);
    System.out.println(javaHome.findJava());

    conf.setProperty("wrapper.java.customProcName", "test");
    javaHome = new WindowsJavaHome(conf);
    System.out.println(javaHome.findJava());

    conf.setProperty("wrapper.java.command", "javaw");
    javaHome = new WindowsJavaHome(conf);
    System.out.println(javaHome.findJava());

    conf.clear();
    conf.setProperty("wrapper.java.minversion", "1.5.0");
    conf.setProperty("wrapper.java.maxversion", "1.5.99");
    conf.setProperty("wrapper.java.customProcName", "test");
    javaHome = new WindowsJavaHome(conf);
    System.out.println(javaHome.findJava());

    conf.clear();
    conf.setProperty("wrapper.java.minversion", "1.6.0");
    conf.setProperty("wrapper.java.customProcName", "test");
    conf.setProperty("wrapper.java.preferJdk", true);
    javaHome = new WindowsJavaHome(conf);
    System.out.println(javaHome.findJava());

  }
View Full Code Here


    WrappedProcess stopper = null;
    getWrapperLogger().info("externalStop " + externalStop);
    if (externalStop)
    {
      getWrapperLogger().info("starting stop application");
      Configuration stopLocalConf = new BaseConfiguration();
      stopLocalConf.setProperty("wrapper.config", stopConfigName);
      YajswConfigurationImpl stopConf = new YajswConfigurationImpl(stopLocalConf, _useSystemProperties);
      stopper = WrappedProcessFactory.createProcess(stopConf);
      stopper.getLocalConfiguration().setProperty("wrapper.config", stopConfigName);
      stopper.setUseSystemProperties(_useSystemProperties);
      stopper.setStopper(true);
View Full Code Here

        return;
    }

    System.setProperty("wrapper.config", config);

    Configuration localConf = new BaseConfiguration();
    if (config != null)
      localConf.addProperty("wrapper.config", config);
    YajswConfigurationImpl _config = new YajswConfigurationImpl(localConf, true);

    _ahessianClient = new AHessianJmxClient(canonName, _config.getInt("wrapper.tray.port", 0));

    try
View Full Code Here

    {
      // String
      // fileName=FilenameUtils.separatorsToSystem("C:\\init\\MOBILEguard\\yajsw/lib/jvmstat/*.jar");
      // System.out.println("FileName: "+fileName);
      CompositeConfiguration compConfig = new CompositeConfiguration();
      AbstractConfiguration configuraton = new BaseConfiguration();
      compConfig.addConfiguration(new EnvironmentConfiguration());
      configuraton.setProperty("wrapper.java.classpath.1", "${VERSANT_ROOT}/lib/jvi.*jar");
      configuraton.setProperty("wrapper.java.classpath.2", "${GROOVY_HOME}/lib/*.jar");
      compConfig.addConfiguration(configuraton);
      System.out.println("Configuration: " + ConfigurationConverter.getProperties(compConfig));
      System.out.println("subset: " + ConfigurationConverter.getProperties(compConfig.subset("wrapper.java")));

      // Collection files=FileUtils.getFiles("../..",
View Full Code Here

    if (!f.exists())
    {
      System.out.println("file not found "+f.getAbsolutePath());
      //return null;
    }
    Configuration localConf = new BaseConfiguration();
    localConf.addProperty("wrapper.config", config);
    YajswConfigurationImpl _config = new YajswConfigurationImpl(localConf, true);
    int port = _config.getInt("wrapper.jmx.rmi.port", Constants.DEFAULT_RMI_PORT);
    String xname = _config.getString("wrapper.console.title");
    if (xname == null)
      xname = _config.getString("wrapper.ntservice.name");
View Full Code Here

  public PosixJavaHome(Configuration config)
  {
    if (config != null)
      _config = config;
    else
      _config = new BaseConfiguration();
  }
View Full Code Here

        super(testName);

        // Setup configuration
        ServiceManager serviceManager = TurbineServices.getInstance();
        serviceManager.setApplicationRoot(".");
        Configuration cfg = new BaseConfiguration();
        cfg.setProperty(ParserUtils.URL_CASE_FOLDING_KEY,
                ParserUtils.URL_CASE_FOLDING_LOWER_VALUE );
        serviceManager.setConfiguration(cfg);

    }
View Full Code Here

        super(testName);

        // Setup configuration
        ServiceManager serviceManager = TurbineServices.getInstance();
        serviceManager.setApplicationRoot(".");
        Configuration cfg = new BaseConfiguration();
        cfg.setProperty(ParserUtils.URL_CASE_FOLDING_KEY,
                ParserUtils.URL_CASE_FOLDING_LOWER_VALUE );
        serviceManager.setConfiguration(cfg);

    }
View Full Code Here

     */
    public void init()
            throws InitializationException
    {
        ServletConfig config = Turbine.getTurbineServletConfig();
        Configuration loaderConf = new BaseConfiguration();

        String[] names = getConfiguration().getStringArray(NAME);

        log.warn("The ComponentService is deprecated!");

        for (int i = 0; i < names.length; i++)
        {
            String key = names[i];

            loaderConf.addProperty(COMPONENT + "." + NAME, key);

            String subProperty = COMPONENT + "." + key;
            Configuration subConf = getConfiguration().subset(key);

            for (Iterator it = subConf.getKeys(); it.hasNext();)
            {
                String subKey = (String) it.next();
                Object subVal = subConf.getProperty(subKey);

                if (subKey.equals(CONFIG))
                {
                    log.debug("Fixing up " + subVal);
                    String newPath =
                            config.getServletContext().getRealPath((String) subVal);

                    if (newPath == null)
                    {
                      throw new InitializationException("Could not translate path " + subVal);
                    }

                    subVal = newPath;
                    log.debug("Now: " + subVal);
                }

                loaderConf.addProperty(subProperty + "." + subKey,
                        subVal);
            }

            log.info("Added " + key + " as a component");
        }
View Full Code Here

        throws Exception
    {
        ServiceManager serviceManager = TurbineServices.getInstance();
        serviceManager.setApplicationRoot(".");

        Configuration cfg = new BaseConfiguration();

        cfg.setProperty(PREFIX + "classname",
                        DBSecurityService.class.getName());

        cfg.setProperty(PREFIX + "acl.class",
                        TurbineAccessControlList.class.getName());

        // We must run init!
        cfg.setProperty(PREFIX+"earlyInit", "true");

        /* Ugh */

        cfg.setProperty("services." + FactoryService.SERVICE_NAME + ".classname",
                        TurbineFactoryService.class.getName());

        serviceManager.setConfiguration(cfg);

        serviceManager.init();
View Full Code Here

TOP

Related Classes of org.apache.commons.configuration.BaseConfiguration

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.