bean = applicationContext.getAutowireCapableBeanFactory().createBean(Class.forName(td.getBeanClass()));
}
methodInvoker.setTargetObject(bean);
methodInvoker.prepare();
} catch (Exception e) {
throw new DynamicTaskException("create task runnable error, task id is : " + taskId, e);
}
return new Runnable() {
@Override
public void run() {
try {
methodInvoker.invoke();
} catch (Exception e) {
logger.error("run dynamic task error, task id is:" + taskId, e);
throw new DynamicTaskException("run dynamic task error, task id is:" + taskId, e);
}
}
};
}