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