1 package com.instantbank.servicing.control.web;
2
3 import java.util.Locale;
4 import java.util.Collection;
5 import java.io.Serializable;
6 import java.rmi.RemoteException;
7
8 import javax.rmi.PortableRemoteObject;
9 import javax.naming.InitialContext;
10 import javax.servlet.http.HttpSession;
11 import javax.ejb.FinderException;
12 import javax.ejb.CreateException;
13 import javax.ejb.RemoveException;
14 import javax.naming.NamingException;
15 import com.instantbank.servicing.control.GeneralFailureException;
16 import com.instantbank.servicing.control.util.WebKeys;
17 import com.instantbank.common.utilcomponents.Debug;
18 import com.instantbank.servicing.control.ServicingEventException;
19 import com.instantbank.servicing.control.ejb.ServicingController;
20 import com.instantbank.servicing.control.event.ServicingEvent;
21
22
34 public class ServicingControllerProxy
35 implements Serializable {
36
37 private ServicingController sccEjb;
38 private HttpSession session;
39 private Debug debug = null;
40
41
42
45 public ServicingControllerProxy() { }
46
47
48
53 public ServicingControllerProxy(HttpSession session) {
54 debug = new Debug();
55 debug.setDebugginOn(true);
56 debug.setPreMessage("** ServicingControllerProxy: ");
57 debug.println("constructor");
58
59 this.session = session;
60 ModelManager mm =
61 (ModelManager)session.getAttribute(WebKeys.ModelManagerKey);
62 sccEjb = mm.getSCCEJB();
63 }
64
65
66
67
79 public synchronized Collection handleEvent(ServicingEvent ese)
80 throws ServicingEventException {
81 try {
82 debug.println("passing event from Application tier to Service tier ");
83 return sccEjb.handleEvent(ese);
84 }
85 catch(RemoteException re) {
86 throw new GeneralFailureException(re.getMessage());
87 }
88 }
89
90
91
95 public synchronized void remove() {
96
97 try {
98 sccEjb.remove();
99 }
100 catch(RemoveException re) {
101
102 debug.println(re.toString());
103 }
104 catch(RemoteException rte) {
105
106 debug.println(rte.toString());
107 }
108 }
109 }
110
111