Codota Logo
XxlJobExecutor
Code IndexAdd Codota to your IDE (free)

How to use
XxlJobExecutor
in
com.xxl.job.core.executor

Best Java code snippets using com.xxl.job.core.executor.XxlJobExecutor (Showing top 6 results out of 315)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
Point p =
  • Codota Iconnew Point(x, y)
  • Codota Iconnew Point()
  • Codota IconMouseEvent e;e.getPoint()
  • Smart code suggestions by Codota
}
origin: xuxueli/xxl-job

/**
 * init
 */
public void initXxlJobExecutor() {
  // registry jobhandler
  XxlJobExecutor.registJobHandler("demoJobHandler", new DemoJobHandler());
  XxlJobExecutor.registJobHandler("shardingJobHandler", new ShardingJobHandler());
  XxlJobExecutor.registJobHandler("httpJobHandler", new HttpJobHandler());
  XxlJobExecutor.registJobHandler("commandJobHandler", new CommandJobHandler());
  // load executor prop
  Properties xxlJobProp = loadProperties("xxl-job-executor.properties");
  // init executor
  xxlJobExecutor = new XxlJobExecutor();
  xxlJobExecutor.setAdminAddresses(xxlJobProp.getProperty("xxl.job.admin.addresses"));
  xxlJobExecutor.setAppName(xxlJobProp.getProperty("xxl.job.executor.appname"));
  xxlJobExecutor.setIp(xxlJobProp.getProperty("xxl.job.executor.ip"));
  xxlJobExecutor.setPort(Integer.valueOf(xxlJobProp.getProperty("xxl.job.executor.port")));
  xxlJobExecutor.setAccessToken(xxlJobProp.getProperty("xxl.job.accessToken"));
  xxlJobExecutor.setLogPath(xxlJobProp.getProperty("xxl.job.executor.logpath"));
  xxlJobExecutor.setLogRetentionDays(Integer.valueOf(xxlJobProp.getProperty("xxl.job.executor.logretentiondays")));
  // start executor
  try {
    xxlJobExecutor.start();
  } catch (Exception e) {
    logger.error(e.getMessage(), e);
  }
}
origin: xuxueli/xxl-job

/**
 * destory
 */
public void destoryXxlJobExecutor() {
  if (xxlJobExecutor != null) {
    xxlJobExecutor.destroy();
  }
}
origin: nutzam/nutzboot

@IocBean(create = "start", depose = "destroy")
public XxlJobExecutor xxlJobExecutor() {
  log.info(">>>>>>>>>>> xxl-job config init.");
  XxlJobExecutor xxlJobExecutor = new XxlJobExecutor();
  // 声明在application.properties
  xxlJobExecutor.setIp(conf.get(PROP_EXECTOR_IP, "0.0.0.0"));
  xxlJobExecutor.setPort(conf.getInt(PROP_EXECTOR_PORT, 8081));
  xxlJobExecutor.setAppName(conf.get(PROP_EXECTOR_NAME, conf.get("nutz.application.name", "xxl-job-executor")));
  xxlJobExecutor.setAdminAddresses(conf.get(PROP_ADMIN_ADDRESSES, "http://127.0.0.1:8080/xxl-job-admin"));
  xxlJobExecutor.setLogPath(conf.get(PROP_EXECTOR_LOGPATH, "/var/log/xxl-job/jobhandler/"));
  xxlJobExecutor.setAccessToken(conf.get(PROP_ACCESSTOKEN, ""));
  return xxlJobExecutor;
}
origin: xuxueli/xxl-job

@Override
public void start() throws Exception {
  // init JobHandler Repository
  initJobHandlerRepository(applicationContext);
  // refresh GlueFactory
  GlueFactory.refreshInstance(1);
  // super start
  super.start();
}
origin: nutzam/nutzboot

  public void start() throws Exception {
    // 从ioc容器中找出所有实现了IJobHandler接口的对象,注册到XxlJobExecutor
    for (IJobHandler jobHandler : appContext.getBeans(IJobHandler.class)) {
      // 看看有没有@JobHandler注解
      JobHandler annoJobHandler = jobHandler.getClass().getAnnotation(JobHandler.class);
      // 得到jobHandlerName
      String jobHandlerName = jobHandler.getClass().getSimpleName();
      if (annoJobHandler != null && !Strings.isBlank(annoJobHandler.value()))
        jobHandlerName = annoJobHandler.value();
      // 注册到XxlJobExecutor上下文
      XxlJobExecutor.registJobHandler(jobHandlerName, jobHandler);
    }
    // 获取XxlJobExecutor,从而触发XxlJobExecutor的初始化
    appContext.getIoc().getByType(XxlJobExecutor.class);
  }
}
origin: com.xuxueli/xxl-job-core

@Override
public void start() throws Exception {
  // init JobHandler Repository
  initJobHandlerRepository(applicationContext);
  // refresh GlueFactory
  GlueFactory.refreshInstance(1);
  // super start
  super.start();
}
com.xxl.job.core.executorXxlJobExecutor

Javadoc

Created by xuxueli on 2016/3/2 21:14.

Most used methods

  • <init>
  • registJobHandler
  • setAccessToken
  • setAdminAddresses
  • setAppName
  • setIp
  • setLogPath
  • setPort
  • start
  • destroy
  • getAdminBizList
  • initAdminBizList
  • getAdminBizList,
  • initAdminBizList,
  • initRpcProvider,
  • loadJobHandler,
  • loadJobThread,
  • registJobThread,
  • removeJobThread,
  • setLogRetentionDays,
  • stopRpcProvider

Popular in Java

  • Finding current android device location
  • startActivity (Activity)
  • getOriginalFilename (MultipartFile)
    Return the original filename in the client's filesystem.This may contain path information depending
  • getSupportFragmentManager (FragmentActivity)
    Return the FragmentManager for interacting with fragments associated with this activity.
  • Date (java.sql)
    A class which can consume and produce dates in SQL Date format. Dates are represented in SQL as yyyy
  • ArrayList (java.util)
    Resizable-array implementation of the List interface. Implements all optional list operations, and p
  • Scanner (java.util)
    A parser that parses a text string of primitive types and strings with the help of regular expressio
  • ImageIO (javax.imageio)
  • BoxLayout (javax.swing)
  • Reflections (org.reflections)
    Reflections one-stop-shop objectReflections scans your classpath, indexes the metadata, allows you t
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now