Tabnine Logo
SimpleAntaresClient
Code IndexAdd Tabnine to your IDE (free)

How to use
SimpleAntaresClient
in
me.hao0.antares.client.core

Best Java code snippets using me.hao0.antares.client.core.SimpleAntaresClient (Showing top 7 results out of 315)

origin: ihaolin/antares

public SpringAntaresClient(String appName, String appSecret, String zkServers, String zkNamespace){
  client = new SimpleAntaresClient(appName, appSecret, zkServers, zkNamespace);
}
origin: ihaolin/antares

public void setExecutorThreadCount(Integer executorThreadCount) {
  client.setExecutorThreadCount(executorThreadCount);
}
origin: ihaolin/antares

  @Override
  public void destroy() throws Exception {
    client.shutdown();
  }
}
origin: ihaolin/antares

@Bean(destroyMethod = "shutdown")
public SimpleAntaresClient buildSpringClient(){
  SimpleAntaresClient client = new SimpleAntaresClient(
                    properties.getAppName(),
                    properties.getAppSecret(),
                    properties.getZkServers(),
                    properties.getZkNamespace());
  client.setExecutorThreadCount(properties.getExecutorThreadCount());
  client.start();
  registerJobs(client);
  return client;
}
origin: ihaolin/antares

private void registerJobs() {
  // register default jobs
  Map<String, DefaultJob> defaultJobs = springContext.getBeansOfType(DefaultJob.class);
  if (!CollectionUtil.isNullOrEmpty(defaultJobs)){
    for (DefaultJob defaultJob : defaultJobs.values()){
      client.registerJob(defaultJob);
    }
  }
  // register script jobs
  Map<String, ScriptJob> scriptJobs = springContext.getBeansOfType(ScriptJob.class);
  if (!CollectionUtil.isNullOrEmpty(scriptJobs)){
    for (ScriptJob scriptJob : scriptJobs.values()){
      client.registerJob(scriptJob);
    }
  }
}
origin: ihaolin/antares

@Override
public void afterPropertiesSet() throws Exception {
  // start the client
  client.start();
  // register the jobs
  registerJobs();
}
origin: ihaolin/antares

  private void registerJobs(final SimpleAntaresClient client) {

    // register default jobs
    Map<String, DefaultJob> defaultJobs = springContext.getBeansOfType(DefaultJob.class);
    if (!CollectionUtil.isNullOrEmpty(defaultJobs)){
      for (DefaultJob defaultJob : defaultJobs.values()){
        client.registerJob(defaultJob);
      }
    }

    // register script jobs
    Map<String, ScriptJob> scriptJobs = springContext.getBeansOfType(ScriptJob.class);
    if (!CollectionUtil.isNullOrEmpty(scriptJobs)){
      for (ScriptJob scriptJob : scriptJobs.values()){
        client.registerJob(scriptJob);
      }
    }
  }
}
me.hao0.antares.client.coreSimpleAntaresClient

Javadoc

Author: haolin Email: haolin.h0@gmail.com

Most used methods

  • <init>
  • registerJob
  • setExecutorThreadCount
  • start
  • shutdown

Popular in Java

  • Reading from database using SQL prepared statement
  • onCreateOptionsMenu (Activity)
  • requestLocationUpdates (LocationManager)
  • scheduleAtFixedRate (Timer)
  • Color (java.awt)
    The Color class is used to encapsulate colors in the default sRGB color space or colors in arbitrary
  • URL (java.net)
    A Uniform Resource Locator that identifies the location of an Internet resource as specified by RFC
  • NoSuchElementException (java.util)
    Thrown when trying to retrieve an element past the end of an Enumeration or Iterator.
  • Handler (java.util.logging)
    A Handler object accepts a logging request and exports the desired messages to a target, for example
  • BoxLayout (javax.swing)
  • Option (scala)
  • Github Copilot alternatives
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now