001
014
015 package com.liferay.portal.kernel.portlet;
016
017 import java.util.Map;
018 import java.util.concurrent.ConcurrentHashMap;
019
020
023 public class PortletBagPool {
024
025 public static PortletBag get(String portletId) {
026 return _instance._get(portletId);
027 }
028
029 public static void put(String portletId, PortletBag portletBag) {
030 _instance._put(portletId, portletBag);
031 }
032
033 public static PortletBag remove(String portletId) {
034 return _instance._remove(portletId);
035 }
036
037 public static void reset() {
038 _instance = new PortletBagPool();
039 }
040
041 private PortletBagPool() {
042 _portletBagPool = new ConcurrentHashMap<String, PortletBag>();
043 }
044
045 private PortletBag _get(String portletId) {
046 return _portletBagPool.get(portletId);
047 }
048
049 private void _put(String portletId, PortletBag portletBag) {
050 _portletBagPool.put(portletId, portletBag);
051 }
052
053 private PortletBag _remove(String portletId) {
054 return _portletBagPool.remove(portletId);
055 }
056
057 private static PortletBagPool _instance = new PortletBagPool();
058
059 private Map<String, PortletBag>_portletBagPool;
060
061 }