use of com.dangdang.ddframe.job.event.rdb.JobEventRdbSearch in project elastic-job by dangdangdotcom.
the class CloudJobRestfulApi method init.
/**
* 初始化.
*
* @param regCenter 注册中心
* @param producerManager 生产管理器
*/
public static void init(final CoordinatorRegistryCenter regCenter, final ProducerManager producerManager) {
CloudJobRestfulApi.regCenter = regCenter;
CloudJobRestfulApi.producerManager = producerManager;
GsonFactory.registerTypeAdapter(CloudJobConfiguration.class, new CloudJobConfigurationGsonFactory.CloudJobConfigurationGsonTypeAdapter());
Optional<JobEventRdbConfiguration> jobEventRdbConfig = BootstrapEnvironment.getInstance().getJobEventRdbConfiguration();
if (jobEventRdbConfig.isPresent()) {
jobEventRdbSearch = new JobEventRdbSearch(jobEventRdbConfig.get().getDataSource());
} else {
jobEventRdbSearch = null;
}
}
use of com.dangdang.ddframe.job.event.rdb.JobEventRdbSearch in project elastic-job by dangdangdotcom.
the class AbstractCloudRestfulApiTest method setUpClass.
@BeforeClass
public static void setUpClass() throws Exception {
regCenter = mock(CoordinatorRegistryCenter.class);
jobEventRdbSearch = mock(JobEventRdbSearch.class);
SchedulerDriver schedulerDriver = mock(SchedulerDriver.class);
ProducerManager producerManager = new ProducerManager(schedulerDriver, regCenter);
producerManager.startup();
restfulService = new RestfulService(regCenter, new RestfulServerConfiguration(19000), producerManager);
restfulService.start();
}
Aggregations