⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 processorerrorhandler.java

📁 Java开发的权限管理的例子
💻 JAVA
字号:
package org.artemis.right.common;

import org.apache.log4j.Logger;
import com.gsta.eshore.framework.jcf.ErrorHandler;
import com.gsta.eshore.framework.jcf.GoOnException;
import com.gsta.eshore.framework.jcf.JCFException;
import com.gsta.eshore.framework.jcf.Response;
/**
 *@author hewenqiang Jul 19, 2006 2:33:08 PM
 */
public class ProcessorErrorHandler implements ErrorHandler {

    private String beanName;
    private static Logger logger=Logger.getLogger(ProcessorErrorHandler.class);

    public void handleError(Response resp, Throwable th) throws Exception{

        if (th instanceof GoOnException) {
        	logger.error("throw GoOnException 异常", th);
        }else if(th instanceof JCFException){
            logger.error("throw JCFException 异常",th);
			resp.setReturnCode(Response.APPLICATION_LEVEL_ERROR);
			resp.getState().setErrCode("A JCFException happened");
        	throw (JCFException)th;
        }
        else{
        	logger.error(th+" error occured, forcing a stop");
			resp.setReturnCode(Response.APPLICATION_LEVEL_ERROR);
			resp.getState().setErrCode("A Exception happened");
			if(th instanceof Exception)
        	       throw (Exception)th;
        }

    }

    public void setBeanName(String beanName) {
        this.beanName = beanName;

    }

}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -