?? perspectivewebimpl.java
字號(hào):
/* */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); }}
?? 快捷鍵說(shuō)明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -