本文整理匯總了Java中com.dangdang.ddframe.job.lite.api.JobScheduler類的典型用法代碼示例。如果您正苦於以下問題:Java JobScheduler類的具體用法?Java JobScheduler怎麽用?Java JobScheduler使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
JobScheduler類屬於com.dangdang.ddframe.job.lite.api包,在下文中一共展示了JobScheduler類的8個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: registryTransactionCheckJob
import com.dangdang.ddframe.job.lite.api.JobScheduler; //導入依賴的package包/類
@Bean(initMethod = "init")
public JobScheduler registryTransactionCheckJob(TransactionCheckJob transactionCheckJob) {
LiteJobConfiguration liteJobConfiguration = LiteJobConfiguration.newBuilder(new SimpleJobConfiguration(
JobCoreConfiguration.newBuilder(TransactionCheckJob.class.getSimpleName(), "0 0/1 * * * ?", 1).build(),
TransactionCheckJob.class.getCanonicalName())).overwrite(true).build();
return new SpringJobScheduler(transactionCheckJob, regCenter, liteJobConfiguration);
}
示例2: registryRetrySendMQJob
import com.dangdang.ddframe.job.lite.api.JobScheduler; //導入依賴的package包/類
@Bean(initMethod = "init")
public JobScheduler registryRetrySendMQJob(RetrySendMQJob retrySendMQJob) {
LiteJobConfiguration liteJobConfiguration = LiteJobConfiguration.newBuilder(new SimpleJobConfiguration(
JobCoreConfiguration.newBuilder(RetrySendMQJob.class.getSimpleName(), "0 0/1 * * * ?", 1).build(),
RetrySendMQJob.class.getCanonicalName())).overwrite(true).build();
return new SpringJobScheduler(retrySendMQJob, regCenter, liteJobConfiguration);
}
示例3: setUpSimpleJob
import com.dangdang.ddframe.job.lite.api.JobScheduler; //導入依賴的package包/類
private static void setUpSimpleJob(final CoordinatorRegistryCenter regCenter, final JobEventConfiguration jobEventConfig) {
JobCoreConfiguration coreConfig = JobCoreConfiguration.newBuilder("javaSimpleJob", "0/5 * * * * ?", 3).shardingItemParameters("0=Beijing,1=Shanghai,2=Guangzhou").build();
SimpleJobConfiguration simpleJobConfig = new SimpleJobConfiguration(coreConfig, JavaSimpleJob.class.getCanonicalName());
new JobScheduler(regCenter, LiteJobConfiguration.newBuilder(simpleJobConfig).build(), jobEventConfig).init();
}
示例4: setUpDataflowJob
import com.dangdang.ddframe.job.lite.api.JobScheduler; //導入依賴的package包/類
private static void setUpDataflowJob(final CoordinatorRegistryCenter regCenter, final JobEventConfiguration jobEventConfig) {
JobCoreConfiguration coreConfig = JobCoreConfiguration.newBuilder("javaDataflowElasticJob", "0/5 * * * * ?", 3).shardingItemParameters("0=Beijing,1=Shanghai,2=Guangzhou").build();
DataflowJobConfiguration dataflowJobConfig = new DataflowJobConfiguration(coreConfig, JavaDataflowJob.class.getCanonicalName(), true);
new JobScheduler(regCenter, LiteJobConfiguration.newBuilder(dataflowJobConfig).build(), jobEventConfig).init();
}
示例5: setUpScriptJob
import com.dangdang.ddframe.job.lite.api.JobScheduler; //導入依賴的package包/類
private static void setUpScriptJob(final CoordinatorRegistryCenter regCenter, final JobEventConfiguration jobEventConfig) throws IOException {
JobCoreConfiguration coreConfig = JobCoreConfiguration.newBuilder("scriptElasticJob", "0/5 * * * * ?", 3).build();
ScriptJobConfiguration scriptJobConfig = new ScriptJobConfiguration(coreConfig, buildScriptCommandLine());
new JobScheduler(regCenter, LiteJobConfiguration.newBuilder(scriptJobConfig).build(), jobEventConfig).init();
}
示例6: simpleJobScheduler
import com.dangdang.ddframe.job.lite.api.JobScheduler; //導入依賴的package包/類
@Bean(initMethod = "init")
public JobScheduler simpleJobScheduler(final SimpleJob simpleJob, @Value("${simpleJob.cron}") final String cron, @Value("${simpleJob.shardingTotalCount}") final int shardingTotalCount,
@Value("${simpleJob.shardingItemParameters}") final String shardingItemParameters) {
return new SpringJobScheduler(simpleJob, regCenter, getLiteJobConfiguration(simpleJob.getClass(), cron, shardingTotalCount, shardingItemParameters), jobEventConfiguration);
}
示例7: dataflowJobScheduler
import com.dangdang.ddframe.job.lite.api.JobScheduler; //導入依賴的package包/類
@Bean(initMethod = "init")
public JobScheduler dataflowJobScheduler(final DataflowJob dataflowJob, @Value("${dataflowJob.cron}") final String cron, @Value("${dataflowJob.shardingTotalCount}") final int shardingTotalCount,
@Value("${dataflowJob.shardingItemParameters}") final String shardingItemParameters) {
return new SpringJobScheduler(dataflowJob, regCenter, getLiteJobConfiguration(dataflowJob.getClass(), cron, shardingTotalCount, shardingItemParameters), jobEventConfiguration);
}
示例8: main
import com.dangdang.ddframe.job.lite.api.JobScheduler; //導入依賴的package包/類
public static void main(String[] args) {
new JobScheduler(createRegistryCenter(), createJobConfiguration()).init();
}