XxlJobConfig.java 3.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. //package com.gyee.generation.config;
  2. //
  3. //
  4. //import com.xxl.job.core.executor.impl.XxlJobSpringExecutor;
  5. //import org.slf4j.Logger;
  6. //import org.slf4j.LoggerFactory;
  7. //import org.springframework.context.EnvironmentAware;
  8. //import org.springframework.context.annotation.Bean;
  9. //import org.springframework.context.annotation.Configuration;
  10. //import org.springframework.core.env.Environment;
  11. //
  12. ///**
  13. // * xxl-job config
  14. // *
  15. // * @author xuxueli 2017-04-28
  16. // */
  17. //
  18. //
  19. //@Configuration
  20. ////@PropertySource("classpath:xxl-job-executor.properties")
  21. ////@PropertySource("classpath:xxl-job-executor2.properties")
  22. ////@PropertySource("classpath:xxl-job-executor3.properties")
  23. ////@PropertySource("classpath:xxl-job-executor4.properties")
  24. ////@PropertySource("classpath:xxl-job-executorWPLY.properties")
  25. ////@PropertySource("classpath:xxl-job-executorRG.properties")
  26. ////@PropertySource("classpath:xxl-job-executorJN.properties")
  27. ////
  28. ////@PropertySource("classpath:xxl-job-accuracy.properties")
  29. ////@PropertySource("classpath:xxl-job-7001.properties")
  30. ////@PropertySource("classpath:xxl-job-7002.properties")
  31. ////@PropertySource("classpath:xxl-job-7003.properties")
  32. ////@PropertySource("classpath:xxl-job-executorGF001.properties")
  33. ////@PropertySource("classpath:xxl-job-executorGF002.properties")
  34. ////@PropertySource("classpath:xxl-job-executorGF003.properties")
  35. ////@PropertySource("classpath:xxl-job-executorGF004.properties")
  36. ////@PropertySource("classpath:xxl-job-executorGF005.properties")
  37. ////@PropertySource("classpath:xxl-job-executorGF006.properties")
  38. //
  39. ////@PropertySource("classpath:xxl-job-region.properties")
  40. //public class XxlJobConfig implements EnvironmentAware {
  41. // private Environment env;
  42. //
  43. //
  44. // @Override
  45. // public void setEnvironment(Environment environment) {
  46. // this.env = environment;
  47. // }
  48. //
  49. // private Logger logger = LoggerFactory.getLogger(XxlJobConfig.class);
  50. //
  51. //
  52. // @Bean
  53. // public XxlJobSpringExecutor xxlJobExecutor() {
  54. // logger.info(">>>>>>>>>>> xxl-job config init.");
  55. // XxlJobSpringExecutor xxlJobSpringExecutor = new XxlJobSpringExecutor();
  56. // xxlJobSpringExecutor.setAdminAddresses(env.getProperty("xxl.job.admin.addresses"));
  57. // xxlJobSpringExecutor.setAppname(env.getProperty("xxl.job.executor.appname"));
  58. // xxlJobSpringExecutor.setAddress(env.getProperty("xxl.job.executor.address"));
  59. // xxlJobSpringExecutor.setIp(env.getProperty("xxl.job.executor.ip"));
  60. // xxlJobSpringExecutor.setPort(Integer.parseInt(env.getProperty("xxl.job.executor.port")));
  61. // xxlJobSpringExecutor.setAccessToken(env.getProperty("xxl.job.accessToken"));
  62. // xxlJobSpringExecutor.setLogPath(env.getProperty("xxl.job.executor.logpath"));
  63. // xxlJobSpringExecutor.setLogRetentionDays(Integer.parseInt(env.getProperty("xxl.job.executor.logretentiondays")));
  64. // return xxlJobSpringExecutor;
  65. // }
  66. //
  67. // /**
  68. // * 针对多网卡、容器内部署等情况,可借助 "spring-cloud-commons" 提供的 "InetUtils" 组件灵活定制注册IP;
  69. // *
  70. // * 1、引入依赖:
  71. // * <dependency>
  72. // * <groupId>org.springframework.cloud</groupId>
  73. // * <artifactId>spring-cloud-commons</artifactId>
  74. // * <version>${version}</version>
  75. // * </dependency>
  76. // *
  77. // * 2、配置文件,或者容器启动变量
  78. // * spring.cloud.inetutils.preferred-networks: 'xxx.xxx.xxx.'
  79. // *
  80. // * 3、获取IP
  81. // * String ip_ = inetUtils.findFirstNonLoopbackHostInfo().getIpAddress();
  82. // */
  83. //
  84. //
  85. //}