01: package com.sun.portal.desktop;
02:
03: import com.sun.portal.desktop.context.CommunityUserMembershipThreadLocalizer;
04: import com.sun.portal.providers.context.ProviderContext;
05: import com.sun.portal.desktop.context.DesktopAppContext;
06: import com.sun.portal.desktop.context.DesktopAppContextThreadLocalizer;
07: import com.sun.portal.desktop.context.DesktopContext;
08: import com.sun.portal.desktop.context.ProviderContextThreadLocalizer;
09: import com.sun.portal.desktop.context.DesktopContextThreadLocalizer;
10: import com.sun.portal.desktop.context.ParentContainerThreadLocalizer;
11:
12: import javax.servlet.ServletConfig;
13: import javax.servlet.ServletContext;
14: import javax.servlet.http.HttpServletRequest;
15: import javax.servlet.http.HttpServletResponse;
16:
17: public class DesktopThreadLocalManager {
18: public static void init(DesktopAppContext dac,
19: HttpServletRequest dreq, HttpServletResponse dres,
20: HttpServletRequest req, HttpServletResponse res,
21: ServletConfig scfg, ServletContext sc) {
22: DesktopAppContextThreadLocalizer.set(dac);
23: DesktopRequestThreadLocalizer.set(dreq, dres);
24: RequestThreadLocalizer.set(req, res);
25: ServletConfigThreadLocalizer.set(scfg);
26: ServletContextThreadLocalizer.set(sc);
27: }
28:
29: public static void init(DesktopContext dc, ProviderContext pc) {
30: ProviderContextThreadLocalizer.set(pc);
31: DesktopContextThreadLocalizer.set(dc);
32: }
33:
34: public static void init(String parentcontainer) {
35: ParentContainerThreadLocalizer.set(parentcontainer);
36: }
37:
38: public static void release() {
39: ProviderContextThreadLocalizer.set(null);
40: DesktopContextThreadLocalizer.set(null);
41: DesktopAppContextThreadLocalizer.set(null);
42: DesktopRequestThreadLocalizer.set(null, null);
43: RequestThreadLocalizer.set(null, null);
44: ServletConfigThreadLocalizer.set(null);
45: ServletContextThreadLocalizer.set(null);
46: ParentContainerThreadLocalizer.set(null);
47: CommunityUserMembershipThreadLocalizer.reset();
48: }
49: }
|