1
14
15 package com.liferay.portlet;
16
17 import java.util.Map;
18 import java.util.concurrent.ConcurrentHashMap;
19
20
25 public class PortletContextBagPool {
26
27 public static PortletContextBag get(String servletContextName) {
28 return _instance._get(servletContextName);
29 }
30
31 public static void put(
32 String servletContextName, PortletContextBag portletContextBag) {
33
34 _instance._put(servletContextName, portletContextBag);
35 }
36
37 public static PortletContextBag remove(String servletContextName) {
38 return _instance._remove(servletContextName);
39 }
40
41 private PortletContextBagPool() {
42 _portletContextBagPool =
43 new ConcurrentHashMap<String, PortletContextBag>();
44 }
45
46 private PortletContextBag _get(String servletContextName) {
47 return _portletContextBagPool.get(servletContextName);
48 }
49
50 private void _put(
51 String servletContextName, PortletContextBag portletContextBag) {
52
53 _portletContextBagPool.put(servletContextName, portletContextBag);
54 }
55
56 private PortletContextBag _remove(String servletContextName) {
57 return _portletContextBagPool.remove(servletContextName);
58 }
59
60 private static PortletContextBagPool _instance =
61 new PortletContextBagPool();
62
63 private Map<String, PortletContextBag>_portletContextBagPool;
64
65 }