use of com.dangdang.ddframe.job.exception.JobSystemException in project elastic-job by dangdangdotcom.
the class AopTargetUtils method getProxyTargetObjectForCglibAndSpring4.
private static Object getProxyTargetObjectForCglibAndSpring4(final Object proxy) {
Field h;
try {
h = proxy.getClass().getDeclaredField("CGLIB$CALLBACK_0");
h.setAccessible(true);
Object dynamicAdvisedInterceptor = h.get(proxy);
Field advised = dynamicAdvisedInterceptor.getClass().getDeclaredField("advised");
advised.setAccessible(true);
return ((AdvisedSupport) advised.get(dynamicAdvisedInterceptor)).getTargetSource().getTarget();
// CHECKSTYLE:OFF
} catch (final Exception ex) {
// CHECKSTYLE:ON
throw new JobSystemException(ex);
}
}
use of com.dangdang.ddframe.job.exception.JobSystemException in project elastic-job by dangdangdotcom.
the class TransientProducerScheduler method register.
// TODO 并发优化
synchronized void register(final CloudJobConfiguration jobConfig) {
String cron = jobConfig.getTypeConfig().getCoreConfig().getCron();
JobKey jobKey = buildJobKey(cron);
repository.put(jobKey, jobConfig.getJobName());
try {
if (!scheduler.checkExists(jobKey)) {
scheduler.scheduleJob(buildJobDetail(jobKey), buildTrigger(jobKey.getName()));
}
} catch (final SchedulerException ex) {
throw new JobSystemException(ex);
}
}
Aggregations