Package com.thenetcircle.comsumerdispatcher.job

Examples of com.thenetcircle.comsumerdispatcher.job.JobExecutor


              String queueName = getNodeValue(String.format(DistributionTreeConstants.CD_ROOT_DOMAIN_QUEUEONSERVER_QBINDS_QUEUE, domain, queueJobNodeName));
              String exchange = getNodeValue(String.format(DistributionTreeConstants.CD_ROOT_DOMAIN_QUEUEONSERVER_QBINDS_EXCHANGE, domain, queueJobNodeName));
              String type = getNodeValue(String.format(DistributionTreeConstants.CD_ROOT_DOMAIN_QUEUEONSERVER_QBINDS_TYPE, domain, queueJobNodeName));
             
              QueueConf qc = DispatcherConfig.getInstance().getServers().get(mqserver);
              JobExecutor je = new JobExecutor();
              try {
                je.setCount(Integer.valueOf(count));
              } catch (Exception e) {
                je.setCount(1);
              }
              je.setEncoding(encoding);
              je.setExchange(exchange);
              je.setFetcherQConf(qc);
              je.setName(jobName);
              je.setQueue(queueName);
              je.setTimeout(Integer.valueOf(timeout));
              je.setType(type);
              je.setUrl(url);
              je.setUrlhost(host);
             
              allJobs.add(je);
              _logger.info("[Distributed Data Loader] loaded Job definition for " + queueJobNodeName + " on domain:" + domain);
            } catch (Exception e) {
              _logger.error(e, e);
View Full Code Here


    this.pool = pool;
    this.zk = DistributionManager.getInstance().getZk();
  }
 
  protected String getQueueJobNodeName() {
    JobExecutor job = pool.getJobDefinition();
    return String.format(DistributionTreeConstants.CD_ROOT_DOMAIN_QUEUEONSERVER, getDomainName(), job.getLogicName());
  }
View Full Code Here

    JobExecutor job = pool.getJobDefinition();
    return String.format(DistributionTreeConstants.CD_ROOT_DOMAIN_QUEUEONSERVER, getDomainName(), job.getLogicName());
  }
 
  protected String getDomainName() {
    JobExecutor job = pool.getJobDefinition();
    String domain = null;
    try {
      domain = HttpUtil.convertUrlToHostNameAsNodeName(job.getUrl());
    } catch (MalformedURLException e) {
    }
    return domain;
  }
View Full Code Here

    List<Element> list = doc.selectNodes("//jobs/job");
    if (null != list && !list.isEmpty()) {
      allJobs = new ArrayList<JobExecutor>();
      for (Iterator<Element> iter = list.iterator(); iter.hasNext();) {
        Element element = iter.next();
        JobExecutor je = new JobExecutor();
        je.setDefaultUrl(defReqPre);
        je.setDefaultUrlHost(defReqHost);
        je.setDefaultCount(defCount);
        je.setDefaultTimeout(defTimeout);
        je.setDefaultEncoding(defEncoding);
        QueueConf qc = DispatcherConfig.getInstance().getServers().get(element.attributeValue("server"));
        je.setFetcherQConf(qc);
        element.accept(new CustomerVistor(je));
        allJobs.add(je);
      }
    }
    return allJobs;
View Full Code Here

        }
  }
 
  protected void addJobExecutorByNum(int numToAdd) {
    for(; numToAdd > 0; numToAdd--) {
      JobExecutor clonedJob;
      try {
        clonedJob = (JobExecutor) job.clone();
            Worker w = new Worker(clonedJob);
            Thread t = threadFactory.newThread(w);
            if (t != null) {
View Full Code Here

TOP

Related Classes of com.thenetcircle.comsumerdispatcher.job.JobExecutor

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.