我使用任务名称空间的scheduled-tasks元素来调度作业。
<task:scheduled-tasks> <task:scheduled ref="BeanA" method="retrieve" cron="${cron}"/> </task:scheduled-tasks>
public void retrieve() throws InstantiationException,IllegalAccessException,ClassNotFoundException,SQLException{}方法retrieve抛出了某些异常,我不想因为某些要求而在方法本身中处理异常,即使某个特定的运行抛出了异常,我如何确定作业正在运行?
发布于 2015-03-31 17:43:42
异常情况是出现错误的地方,如果抛出的异常是已检查的异常,则必须处理它,但如果您不希望在调用方法中看到样板代码,则有一些选项,如:
抛出
你可以稍后再处理
抛出
一个超级异常下的句柄,如 Exception 子句
https://stackoverflow.com/questions/29364992
复制相似问题