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

📄 generalfailureexception.java

📁 一个优秀的供应商管理系统
💻 JAVA
字号:
package apusic.myshop.control;import java.rmi.RemoteException;import javax.naming.NamingException;import javax.ejb.CreateException;import javax.ejb.EJBException;import java.sql.SQLException;/*** This exception is thrown for all problems that occur in the EJB* Container code of the sample application. This class defines a few* typical error types to help the developer find the error* cause.*/public class GeneralFailureException extends EJBException    implements java.io.Serializable {    private String cause;    public static final String COMM_FAILURE = "RMI/IIOP problem";    public static final String EJB_CREATION_FAILURE = "EJB creation problem";    public static final String JNDI_PROBLEMS = "JNDI problem";    public static final String DB_PROBLEMS = "Database problem";    public GeneralFailureException(String cause) {	    super(cause);	    this.cause = cause;    }    public GeneralFailureException(Exception e) {	    super(e);	    if (e instanceof NamingException) {	        this.cause = JNDI_PROBLEMS;	    } else if (e instanceof SQLException) {	        this.cause = DB_PROBLEMS;	    } else if (e instanceof CreateException) {	        this.cause = EJB_CREATION_FAILURE;	    } else if (e instanceof RemoteException) {	        this.cause = COMM_FAILURE;	    } else {            this.cause = e.toString();      }    }    public String getCause() {	    return cause;    }}

⌨️ 快捷键说明

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