in elasticjob-cloud/elasticjob-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/config/job/CloudJobConfigurationListener.java [54:77]
public void event(final Type type, final ChildData oldData, final ChildData data) {
String path = Type.NODE_DELETED == type ? oldData.getPath() : data.getPath();
if (Type.NODE_CREATED == type && isJobConfigNode(path)) {
CloudJobConfigurationPOJO cloudJobConfig = getCloudJobConfiguration(data);
if (null != cloudJobConfig) {
producerManager.schedule(cloudJobConfig);
}
} else if (Type.NODE_CHANGED == type && isJobConfigNode(path)) {
CloudJobConfigurationPOJO cloudJobConfig = getCloudJobConfiguration(data);
if (null == cloudJobConfig) {
return;
}
if (CloudJobExecutionType.DAEMON == cloudJobConfig.getJobExecutionType()) {
readyService.remove(Collections.singletonList(cloudJobConfig.getJobName()));
}
if (!cloudJobConfig.isMisfire()) {
readyService.setMisfireDisabled(cloudJobConfig.getJobName());
}
producerManager.reschedule(cloudJobConfig.getJobName());
} else if (Type.NODE_DELETED == type && isJobConfigNode(path)) {
String jobName = path.substring(CloudJobConfigurationNode.ROOT.length() + 1);
producerManager.unschedule(jobName);
}
}