KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > exoplatform > services > wsrp > producer > impl > WSRPPortletPreferencesPersister


1 /*
2  * Copyright 2001-2003 The eXo platform SARL All rights reserved.
3  * Please look at license.txt in info directory for more license detail.
4  */

5 package org.exoplatform.services.wsrp.producer.impl;
6
7 import java.util.HashMap JavaDoc;
8 import java.util.Map JavaDoc;
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 /**
15  * Created y the eXo platform team
16  * User: Benjamin Mestrallet
17  * Date: 8 juin 2004
18  */

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 JavaDoc localMap = new HashMap JavaDoc();
31
32   public ExoPortletPreferences getPortletPreferences(WindowID windowID) throws Exception JavaDoc {
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 JavaDoc {
40     localMap.put(windowID.generateKey(), preferences);
41   }
42
43 }
Popular Tags