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

📄 perspectivewebimpl.java

📁 J2EE & Tomcat books published by hope
💻 JAVA
字号:
/*  */package org.impact.stars.control.web;import java.util.Locale;import java.rmi.RemoteException;import org.impact.stars.control.exceptions.GeneralFailureException;import org.impact.stars.control.exceptions.StarsAppException;import javax.servlet.ServletContext;import org.impact.stars.util.JNDINames;import org.impact.stars.util.WebKeys;import org.impact.stars.util.JSPUtil;import org.impact.stars.util.EJBUtil;import org.impact.stars.perspectivemd.perspective.model.PerspectiveModel;import org.impact.stars.perspectivemd.perspective.ejb.PerspectiveLocal;import org.impact.stars.perspectivemd.perspective.ejb.PerspectiveLocalHome;import org.impact.stars.control.web.ModelManager;import org.impact.stars.control.web.ModelUpdateListener;import org.impact.stars.util.Debug;/** * This class is the web-tier representation of the Perspective Data. */public class PerspectiveWebImpl extends PerspectiveModel    implements ModelUpdateListener, java.io.Serializable {    private AppModelManager apmm;    private PerspectiveLocal pEjb;    private ServletContext context;    public PerspectiveWebImpl() {        super();   }    public void init(ServletContext context) {        // initializing super class with a null list. This means that        // if because of some bug, this object gets referenced        // (typically in the JSP page) before performUpdate is called,        // a null pointer exception will get thrown.                //this class is not used since the perspective model are small object now                this.context = context;        this.apmm = (AppModelManager)context.getAttribute(WebKeys.AppModelManagerKey);        apmm.addListener(JNDINames.PERSPECTIVE_EJBHOME, this);    }    public void performUpdate() throws StarsAppException {        // Get data from the EJB        if (pEjb == null) {            //perspectiveEjb = mm.getPerspectiveEJB();           try {                 PerspectiveLocalHome phome = EJBUtil.getPerspectiveLocalHome();            pEjb = phome.findByPrimaryKey(this.getPerspectiveID());            } catch (javax.ejb.FinderException fde) {                throw new StarsAppException("Unable to find an perspective/profile with perspective id : " );            } catch (javax.ejb.NoSuchEntityException nee) {                throw new StarsAppException("Unable to find an perspective/profile with perspective id : " );            } catch (javax.naming.NamingException nme) {                Debug.println("ConceptWebImpl naming exception: ");                throw new StarsAppException("Irrecoverable error while updating perspective : ");            }        }            PerspectiveModel pwm = new PerspectiveModel(pEjb.getPerspectiveID(), pEjb.getName(),                        pEjb.getConceptID(), pEjb.getStakeholderID(), pEjb.getDeclaretime(),                         pEjb.getProjectID(), pEjb.getPpurpose(), pEjb.getPcontext(), pEjb.getPcontent());                        copy(pwm);   }}

⌨️ 快捷键说明

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