Package railo.runtime.spooler

Examples of railo.runtime.spooler.SpoolerEngineImpl


        pageContext.setVariable(getString("admin",action,"returnVariable"),sct);
       
        int maxThreads=20;
        SpoolerEngine engine = config.getSpoolerEngine();
        if(engine instanceof SpoolerEngineImpl) {
          SpoolerEngineImpl ei = ((SpoolerEngineImpl)engine);
          maxThreads=ei.getMaxThreads();
        }
        sct.set("maxThreads",Caster.toDouble(maxThreads));
       
    }
View Full Code Here


    private void doGetSpoolerTasks() throws PageException {
      int startrow = getInt("startrow",1);
      if(startrow <1) startrow=1;
      int maxrow = getInt("maxrow",-1);
      String result=getString("result", null);
      SpoolerEngineImpl engine = (SpoolerEngineImpl) config.getSpoolerEngine();
     
      Query qry = engine.getAllTasksAsQuery(startrow,maxrow);
      pageContext.setVariable(getString("admin",action,"returnVariable"),qry);
    if(!StringUtil.isEmpty(result)){
      Struct sct=new StructImpl();
      pageContext.setVariable(result,sct);
      sct.setEL("open", engine.getOpenTaskCount());
        sct.setEL("closed", engine.getClosedTaskCount());
    }
     
      /*
      SpoolerTask[] open = config.getSpoolerEngine().getOpenTasks();
      SpoolerTask[] closed = config.getSpoolerEngine().getClosedTasks();
View Full Code Here

    config.setRemoteClientUsage(sct);

    // max-threads
    int maxThreads = Caster.toIntValue(_clients.getAttribute("max-threads"), -1);
    if(maxThreads<1 && configServer!=null) {
      SpoolerEngineImpl engine = (SpoolerEngineImpl) configServer.getSpoolerEngine();
      if(engine!=null) maxThreads=engine.getMaxThreads();
    }
    if(maxThreads<1)maxThreads=20;
   
    // Logger
    String strLogger = hasAccess ? _clients.getAttribute("log") : null;
    int logLevel = LogUtil.toIntType(_clients.getAttribute("log-level"), Log.LEVEL_ERROR);
    LogAndSource log = ConfigWebUtil.getLogAndSource(configServer, config, strLogger, true, logLevel);
    config.setRemoteClientLog(log);

    // directory
    Resource file = ConfigWebUtil.getFile(config.getRootDirectory(), _clients.getAttribute("directory"), "client-task", config.getConfigDir(), FileUtil.TYPE_DIR, config);
    config.setRemoteClientDirectory(file);

    Element[] clients;
    Element client;

    if (!hasAccess)
      clients = new Element[0];
    else
      clients = getChildren(_clients, "remote-client");
    java.util.List<RemoteClient> list = new ArrayList<RemoteClient>();
    for (int i = 0; i < clients.length; i++) {
      client = clients[i];
      // type
      String type = client.getAttribute("type");
      if (StringUtil.isEmpty(type))
        type = "web";
      // url
      String url = client.getAttribute("url");
      String label = client.getAttribute("label");
      if (StringUtil.isEmpty(label))
        label = url;
      String sUser = client.getAttribute("server-username");
      String sPass = ConfigWebFactory.decrypt(client.getAttribute("server-password"));
      String aPass = ConfigWebFactory.decrypt(client.getAttribute("admin-password"));
      String aCode = ConfigWebFactory.decrypt(client.getAttribute("security-key"));
      // if(aCode!=null && aCode.indexOf('-')!=-1)continue;
      String usage = client.getAttribute("usage");
      if (usage == null)
        usage = "";

      String pUrl = client.getAttribute("proxy-server");
      int pPort = Caster.toIntValue(client.getAttribute("proxy-port"), -1);
      String pUser = client.getAttribute("proxy-username");
      String pPass = ConfigWebFactory.decrypt(client.getAttribute("proxy-password"));

      ProxyData pd = null;
      if (!StringUtil.isEmpty(pUrl, true)) {
        pd = new ProxyDataImpl();
        pd.setServer(pUrl);
        if (!StringUtil.isEmpty(pUser)) {
          pd.setUsername(pUser);
          pd.setPassword(pPass);
        }
        if (pPort > 0)
          pd.setPort(pPort);
      }
      list.add(new RemoteClientImpl(label, type, url, sUser, sPass, aPass, pd, aCode, usage));
    }
    if (list.size() > 0)
      config.setRemoteClients(list.toArray(new RemoteClient[list.size()]));
    else
      config.setRemoteClients(new RemoteClient[0]);

    // init spooler engine
    Resource dir = config.getRemoteClientDirectory();
    if (dir != null && !dir.exists())
      dir.mkdirs();
    if (config.getSpoolerEngine() == null) {
      config.setSpoolerEngine(new SpoolerEngineImpl(config, dir, "Remote Client Spooler", config.getRemoteClientLog(), maxThreads));
    }
    else {
      SpoolerEngineImpl engine = (SpoolerEngineImpl) config.getSpoolerEngine();
      engine.setConfig(config);
      engine.setLog(config.getRemoteClientLog());
      engine.setPersisDirectory(dir);
      engine.setMaxThreads(maxThreads);

    }
  }
View Full Code Here

TOP

Related Classes of railo.runtime.spooler.SpoolerEngineImpl

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.