1 5 package org.exoplatform.services.wsrp.producer.impl; 6 7 import java.util.HashMap ; 8 import java.util.Map ; 9 import org.exoplatform.services.portletcontainer.pci.WindowID; 10 import org.exoplatform.services.portletcontainer.pci.model.ExoPortletPreferences; 11 import org.exoplatform.services.portletcontainer.persistence.PortletPreferencesPersister; 12 13 14 19 public class WSRPPortletPreferencesPersister implements PortletPreferencesPersister { 20 21 private static WSRPPortletPreferencesPersister ourInstance = new WSRPPortletPreferencesPersister(); 22 23 public static WSRPPortletPreferencesPersister getInstance() { 24 return ourInstance; 25 } 26 27 private WSRPPortletPreferencesPersister() { 28 } 29 30 private Map localMap = new HashMap (); 31 32 public ExoPortletPreferences getPortletPreferences(WindowID windowID) throws Exception { 33 ExoPortletPreferences map = (ExoPortletPreferences) localMap.get(windowID.generateKey()); 34 if(map == null) 35 return null; 36 return map; 37 } 38 39 public void savePortletPreferences(WindowID windowID, ExoPortletPreferences preferences) throws Exception { 40 localMap.put(windowID.generateKey(), preferences); 41 } 42 43 } | Popular Tags |