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