1
19
20 package com.liferay.portlet;
21
22 import java.util.Map;
23 import java.util.concurrent.ConcurrentHashMap;
24
25
31 public class PortletContextBagPool {
32
33 public static PortletContextBag get(String servletContextName) {
34 return _instance._get(servletContextName);
35 }
36
37 public static void put(
38 String servletContextName, PortletContextBag portletContextBag) {
39
40 _instance._put(servletContextName, portletContextBag);
41 }
42
43 public static PortletContextBag remove(String servletContextName) {
44 return _instance._remove(servletContextName);
45 }
46
47 private PortletContextBagPool() {
48 _portletContextBagPool =
49 new ConcurrentHashMap<String, PortletContextBag>();
50 }
51
52 private PortletContextBag _get(String servletContextName) {
53 return _portletContextBagPool.get(servletContextName);
54 }
55
56 private void _put(
57 String servletContextName, PortletContextBag portletContextBag) {
58
59 _portletContextBagPool.put(servletContextName, portletContextBag);
60 }
61
62 private PortletContextBag _remove(String servletContextName) {
63 return _portletContextBagPool.remove(servletContextName);
64 }
65
66 private static PortletContextBagPool _instance =
67 new PortletContextBagPool();
68
69 private Map<String, PortletContextBag>_portletContextBagPool;
70
71 }