Package org.rzo.yajsw.config

Examples of org.rzo.yajsw.config.YajswConfigurationImpl


    String wrapperJar = WrapperLoader.getWrapperJar();
    String homeDir = new File(wrapperJar).getParent();
    OperatingSystem.instance().setWorkingDir(homeDir);

    StopableService service = new WrapperMainServiceUnix();
    YajswConfigurationImpl _config = new YajswConfigurationImpl(false);
    w = WrappedProcessFactory.createProcess(_config);
    // start the application
    //w.setDebug(true);
    w.init();
    w.setService(service);
View Full Code Here


  {
    String wrapperJar = WrapperLoader.getWrapperJar();
    // set home dir of the service to the wrapper jar parent, so that we may find required libs
    String homeDir = new File(wrapperJar).getParent();
    OperatingSystem.instance().setWorkingDir(homeDir);
    YajswConfigurationImpl _config = new YajswConfigurationImpl(false);
    service = new WrapperMainServiceWin();
    // set service shutdown timeout
    service.setServiceName(_config.getString("wrapper.ntservice.name"));
    int timeout = _config.getInt("wrapper.shutdown.timeout", Constants.DEFAULT_SHUTDOWN_TIMEOUT) * 1000;
    timeout += _config.getInt("wrapper.script.STOP.timeout", 0) * 1000;
    timeout += _config.getInt("wrapper.script.SHUTDOWN.timeout", 0) * 1000;
    timeout += _config.getInt("wrapper.script.IDLE.timeout", 0) * 1000;
    timeout += _config.getInt("wrapper.script.ABORT.timeout", 0) * 1000;
    service.setStopTimeout(timeout);
   
    timeout = _config.getInt("wrapper.startup.timeout", Constants.DEFAULT_STARTUP_TIMEOUT) * 1000;
    service.setStartupTimeout(timeout);
   
    service.setAutoReportStartup(_config.getBoolean("wrapper.ntservice.autoreport.startup", true));
   
    if (_config.containsKey("wrapperx.config"))
    {
      List<String> configs = _config.getList("wrapperx.config");
      wList = WrappedProcessFactory.createProcessList(new HashMap(), configs, true);
      for (WrappedProcess p : wList)
      {
        p.setService(service);
      }
View Full Code Here

  {
    if (_init)
      return;
    Map utils = new HashMap();
    utils.put("util", new Utils(this));
    _config = new YajswConfigurationImpl(_localConfiguration, _useSystemProperties, utils);

    getWrapperLogger().info("init ");
    if (!_config.isLocalFile())
      if (_cache == null)
      {
View Full Code Here

  protected void reloadConfiguration()
  {
    {
      Map utils = new HashMap();
      utils.put("util", new Utils(this));
      _config = new YajswConfigurationImpl(_localConfiguration, _useSystemProperties, utils);

      getWrapperLogger().info("reloaded configuration ");
    }
  }
View Full Code Here

    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);
      // stopper.setDebug(true);
View Full Code Here

      catch (Throwable ex)
      {
        ex.printStackTrace();
      }

    YajswConfigurationImpl config = new YajswConfigurationImpl();
    // config.setDebug(false);
    config.init();

    try
    {
      _overrideStdErr = config.getBoolean("wrapper.java.dump.override", false);
    }
    catch (Exception ex)
    {
      System.out.println("Error getting wrapper.java.dump.override " + ex.getMessage());
    }
    String mainClassName = config.getString("wrapper.java.app.mainclass");
    String jarName = config.getString("wrapper.java.app.jar");
    String groovyScript = config.getString("wrapper.groovy");
    if (mainClassName == null && jarName == null && groovyScript == null)
      mainClassName = config.getString("wrapper.app.parameter.1");
    if (jarName == null && mainClassName == null && groovyScript == null)
    {
      System.out.println("missing main class name or jar file or groovy file. please check configuration");
      return;
    }
    if (jarName != null)
    {
      mainMethod = loadJar(jarName);
    }
    else if (mainClassName != null)
      try
      {
        Class cls = ClassLoader.getSystemClassLoader().loadClass(mainClassName);// Class.forName(mainClassName,
        // currentContext);
        mainMethod = cls.getMethod("main", new Class[]
        { String[].class });
      }
      catch (Exception e)
      {
        System.out.println("error finding main method in class: " + mainClassName + " : " + e.getMessage());
        // log.throwing(WrapperMain.class.getName(), "main", e);
        e.printStackTrace();
        return;
      }
    else
      _groovyScript = groovyScript;

    String stopConfig = config.getString("wrapper.stop.conf");
    if (stopConfig != null)
    {
      File f = new File(stopConfig);
      _externalStop = true;
    }
    System.out.println("external stop " + _externalStop);

    exitOnMainTerminate = config.getInt("wrapper.exit_on_main_terminate", DEFAULT_EXIT_ON_MAIN_TERMINATE);

    exitOnException = config.getInt("wrapper.exit_on_main_exception", DEFAULT_EXIT_ON_MAIN_EXCEPTION);

    mainMethodArgs = getAppParam((Configuration) config);
    setConfiguration((Configuration) config);
    if (_config.getBoolean("wrapper.java.jmx", false))
      registerMBean(config);
View Full Code Here

  }

  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();
    return process;
View Full Code Here

    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
    {
      String name = _config.getString("wrapper.console.title");
      if (name == null)
        name = _config.getString("wrapper.ntservice.name");
      if (name == null)
        name = "yajsw.noname";
      oName = new ObjectName("org.rzo.yajsw", "name", name);
      _trayIcon = (WrapperTrayIconImpl) WrapperTrayIconFactory.createTrayIcon(getName(_config), _config.getString("wrapper.tray.icon"));
      reconnect();
      while (!_trayIcon.isStop())
      {
        if (jmxc != null && proxy != null)
          try
View Full Code Here

    Map utils = new HashMap();
    utils.put("util", new Utils(this));
    if (_confFilesList != null && !_confFilesList.isEmpty() && _localConfiguration != null && !_localConfiguration.containsKey("wrapper.config"))
      _localConfiguration.setProperty("wrapper.config", _confFilesList.get(0));

    _config = new YajswConfigurationImpl(_localConfiguration, _useSystemProperties, utils);

    if (!_config.isLocalFile())
      if (_cache == null)
      {
        _cache = new Cache();
View Full Code Here

        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
        if (!config.isLocalFile())
        {
          cache = new Cache();
          cache.load(config);
        }
        // add configuration file name to list
        confList += config.getCachedPath();
        if (i < (_confFilesList.size() - 1))
          confList += ",";
      }
      // TODO lookup is currently done only for first configuration
      // add list to service parameters
View Full Code Here

TOP

Related Classes of org.rzo.yajsw.config.YajswConfigurationImpl

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.