Package org.apache.commons.configuration

Examples of org.apache.commons.configuration.Configuration


   * @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

  }

  public static void main(String[] args)
  {
    WrappedRuntimeProcess p = new WrappedRuntimeProcess();
    Configuration c = p.getLocalConfiguration();
    c.setProperty("wrapper.image", "notepad");// "test.bat");//notepad");//"c:/temp/test.bat");//
    c.setProperty("wrapper.working.dir", "c:/");
    p.init();
    p.start();
    p.waitFor(10000);
    System.out.println("stopping");
    p.stop();
View Full Code Here

public class WrappedServiceFactory
{
  public static Object createService(Map map)
  {
    Configuration localConf = new MapConfiguration(map);
    WrappedService service = new WrappedService();
    service.setLocalConfiguration(localConf);
    service.init();
    return service;
  }
View Full Code Here

    return service;
  }

  public static Object createServiceList(Map map, List<String> confFiles)
  {
    Configuration localConf = new MapConfiguration(map);
    WrappedService service = new WrappedService();
    service.setLocalConfiguration(localConf);
    service.setConfFilesList(confFiles);
    service.init();
    return service;
View Full Code Here

    return new WrappedJavaProcess();
  }

  public static WrappedProcess createProcess(Map map, boolean useSystemProperties)
  {
    Configuration localConf = new MapConfiguration(map);
    YajswConfiguration conf = new YajswConfigurationImpl(localConf, true);
    WrappedProcess process = createProcess(conf);
    process.setLocalConfiguration(localConf);
    process.setUseSystemProperties(useSystemProperties);
    process.init();
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 confList = "";
      // for each configuration
      for (int i = 0; i < _confFilesList.size(); i++)
      {
        // load it
        Configuration localConfiguration = ConfigurationUtils.cloneConfiguration(_localConfiguration);
        String conf = _confFilesList.get(i);
        localConfiguration.setProperty("wrapper.config", conf);
        Map utils = new HashMap();
        utils.put("util", new Utils(this));
        YajswConfigurationImpl config = new YajswConfigurationImpl(localConfiguration, _useSystemProperties, utils);
        Cache cache = null;
        // check if we need to download files from remote location
View Full Code Here

        System.out.println("cache must be a folder -> abort");
        return false;
      }
      boolean cacheLocal = config.getBoolean("wrapper.cache.local", Constants.DFAULT_CACHE_LOCAL);

      Configuration resources = config.subset("wrapper.resource");
      for (Iterator it = resources.getKeys(); it.hasNext();)
      {
        String key = (String) it.next();
        loadFiles("wrapper.resource." + key, config, basef, cachef, cacheLocal, fsManager);
      }

      Configuration classpath = config.subset("wrapper.java.classpath");
      for (Iterator it = classpath.getKeys(); it.hasNext();)
      {
        String key = (String) it.next();
        loadFiles("wrapper.java.classpath." + key, config, basef, cachef, cacheLocal, fsManager);
      }
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

TOP

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

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.