use of com.dangdang.ddframe.job.api.JobScheduler in project sharding-jdbc by dangdangdotcom.
the class AbstractBestEffortsDeliveryJobFactory method init.
/**
* 初始化作业.
*/
public final void init() {
@SuppressWarnings("unchecked") T bedJobConfig = (T) transactionConfig.getBestEffortsDeliveryJobConfiguration().get();
CoordinatorRegistryCenter regCenter = new ZookeeperRegistryCenter(createZookeeperConfiguration(bedJobConfig));
regCenter.init();
JobScheduler jobScheduler = new JobScheduler(regCenter, createBedJobConfiguration(bedJobConfig));
jobScheduler.setField("transactionConfig", transactionConfig);
jobScheduler.setField("transactionLogStorage", TransactionLogStorageFactory.createTransactionLogStorage(transactionConfig.buildTransactionLogDataSource()));
jobScheduler.init();
}
use of com.dangdang.ddframe.job.api.JobScheduler in project sharding-jdbc by dangdangdotcom.
the class BestEffortsDeliveryJobFactory method init.
/**
* 初始化作业.
*/
public void init() {
CoordinatorRegistryCenter regCenter = new ZookeeperRegistryCenter(createZookeeperConfiguration(bedConfig));
regCenter.init();
JobScheduler jobScheduler = new JobScheduler(regCenter, createBedJobConfiguration(bedConfig));
jobScheduler.setField("bedConfig", bedConfig);
jobScheduler.setField("transactionLogStorage", TransactionLogStorageFactory.createTransactionLogStorage(new RdbTransactionLogDataSource(bedConfig.getDefaultTransactionLogDataSource())));
jobScheduler.init();
}
Aggregations