1 package com.instantbank.servicing.control.web;
2
3 import java.io.Serializable;
4 import java.util.HashMap;
5 import java.util.ArrayList;
6 import java.util.Collection;
7 import java.util.Iterator;
8 import java.rmi.RemoteException;
9 import javax.servlet.http.HttpSession;
10 import javax.servlet.ServletContext;
11 import javax.ejb.CreateException;
12 import javax.ejb.FinderException;
13 import com.instantbank.servicing.control.GeneralFailureException;
14 import com.instantbank.servicing.control.util.EJBUtil;
15 import com.instantbank.servicing.control.util.WebKeys;
16
17 import com.instantbank.common.utilcomponents.Debug;
18 import com.instantbank.common.utilcomponents.ServicingExceptionMessage;
19 import com.instantbank.servicing.control.ejb.ServicingController;
20
21
30 public class ModelManager extends ModelUpdateNotifier
31 implements Serializable {
32
33 private ServletContext context;
34 private HttpSession session;
35 private ServicingController sccEjb = null;
36 private ServicingControllerProxy scc = null;
37 private Debug debug = null;
38
39
40
43 public ModelManager() {
44 debug = new Debug();
45 debug.setDebugginOn(true);
46 debug.setPreMessage("** ModelManager");
47 }
48
49
50
58 public void init(ServletContext context, HttpSession session) {
59 debug.println("init");
60 this.session = session;
61 this.context = context;
62
63 }
64
65
66
71 public void setSCC(ServicingControllerProxy scc) {
72 this.scc = scc;
73 debug.println("scc assigned");
74 }
75
76
77
78
83 public ServicingController getSCCEJB() {
84 if(sccEjb == null) {
85 try {
86 sccEjb = EJBUtil.getServicingControllerHome().create();
87 }
88 catch(CreateException ce) {
89 throw new GeneralFailureException(ce.getMessage());
90 }
91 catch(RemoteException re) {
92 throw new GeneralFailureException(re.getMessage());
93 }
94 catch(javax.naming.NamingException ne) {
95 throw new GeneralFailureException(ne.getMessage());
96 }
97 catch(Exception e) {
98 throw new GeneralFailureException(e.getMessage());
99 }
100 }
101 return sccEjb;
102 }
103
104
105 }
106
107