Search in sources :

Example 11 with AgileFrameException

use of com.jeeagile.core.exception.AgileFrameException in project jeeagile by jeeagile.

the class AgileAbstractJob method invokeMethod.

/**
 * 执行方法
 */
protected void invokeMethod(AgileQuartzJob agileQuartzJob) throws Exception {
    Object bean = null;
    if (!agileQuartzJob.getBeanName().contains(".")) {
        bean = AgileSpringUtil.getBean(agileQuartzJob.getBeanName());
    } else {
        bean = Class.forName(agileQuartzJob.getBeanName()).newInstance();
    }
    if (bean == null) {
        // 方法不存在暂停执行任务
        AgileScheduleUtil.pauseJob(agileQuartzJob);
        throw new AgileFrameException("任务代码《" + agileQuartzJob.getJobCode() + "》执行Bean不存在,请核实!");
    }
    invokeMethod(bean, agileQuartzJob);
}
Also used : JSONObject(com.alibaba.fastjson.JSONObject) AgileFrameException(com.jeeagile.core.exception.AgileFrameException)

Aggregations

AgileFrameException (com.jeeagile.core.exception.AgileFrameException)11 JSONObject (com.alibaba.fastjson.JSONObject)3 AgileBaseException (com.jeeagile.core.exception.AgileBaseException)3 HttpServletRequest (javax.servlet.http.HttpServletRequest)3 AgileAuthException (com.jeeagile.core.exception.AgileAuthException)2 AgileBaseUser (com.jeeagile.core.security.user.AgileBaseUser)2 UserAgent (eu.bitwalker.useragentutils.UserAgent)2 IOException (java.io.IOException)2 AgileValidateException (com.jeeagile.core.exception.AgileValidateException)1 AgileReference (com.jeeagile.core.protocol.annotation.AgileReference)1 AgileResultCode (com.jeeagile.core.result.AgileResultCode)1 IAgileUserDetailsService (com.jeeagile.core.security.userdetails.IAgileUserDetailsService)1 AgileAgentUtil (com.jeeagile.core.util.AgileAgentUtil)1 AgileStringUtil (com.jeeagile.core.util.AgileStringUtil)1 AgileServletUtil (com.jeeagile.core.util.spring.AgileServletUtil)1 SingleRequestBody (com.jeeagile.frame.support.resolver.annotation.SingleRequestBody)1 AgileGeneratorTableInfo (com.jeeagile.generator.vo.AgileGeneratorTableInfo)1 AgileQuartzJob (com.jeeagile.quartz.entity.AgileQuartzJob)1 BufferedImage (java.awt.image.BufferedImage)1 ByteArrayOutputStream (java.io.ByteArrayOutputStream)1