@Override
    protected void initJobNode() {
        jobClient = JobClientBuilder.buildByProperties(properties);

        Map<String, Object> handlers = applicationContext.getBeansWithAnnotation(JobCompletedHandler4JobClient.class);
        if (CollectionUtils.isNotEmpty(handlers)) {
            if (handlers.size() > 1) {
                throw new IllegalArgumentException("annotation @" + JobCompletedHandler4JobClient.class.getSimpleName() + " only should have one");
            }
            for (Map.Entry<String, Object> entry : handlers.entrySet()) {
                Object handler = entry.getValue();
                if (handler instanceof JobCompletedHandler) {
                    jobClient.setJobCompletedHandler((JobCompletedHandler) entry.getValue());
                } else {
                    throw new IllegalArgumentException(entry.getKey() + "  is not instance of " + JobCompletedHandler.class.getName());
                }
            }
        }
    }
@author Robert HG (254963746@qq.com) on 4/9/16.
lts-spring/src/main/java/com/github/ltsopensource/spring/boot/JobClientAutoConfiguration.java