[pal-cvs 2706] [438] forgot to add getter methods..

Back to archive index

svnno****@sourc***** svnno****@sourc*****
2007年 8月 4日 (土) 10:59:18 JST


Revision: 438
          http://svn.sourceforge.jp/cgi-bin/viewcvs.cgi?root=pal&view=rev&rev=438
Author:   shinsuke
Date:     2007-08-04 10:59:18 +0900 (Sat, 04 Aug 2007)

Log Message:
-----------
forgot to add getter methods..

Modified Paths:
--------------
    pompei/portlets/pompei-core/trunk/src/main/java/jp/sf/pal/pompei/util/SessionUtil.java


-------------- next part --------------
Modified: pompei/portlets/pompei-core/trunk/src/main/java/jp/sf/pal/pompei/util/SessionUtil.java
===================================================================
--- pompei/portlets/pompei-core/trunk/src/main/java/jp/sf/pal/pompei/util/SessionUtil.java	2007-08-04 01:58:43 UTC (rev 437)
+++ pompei/portlets/pompei-core/trunk/src/main/java/jp/sf/pal/pompei/util/SessionUtil.java	2007-08-04 01:59:18 UTC (rev 438)
@@ -47,6 +47,9 @@
     }
 
     public static void removeFromApplicationScope(Object key) {
+        if (key == null) {
+            //TODO IllegalArgumentException?
+        }
         Object obj = getSession();
         if (obj instanceof PortletSession) {
             PortletSession portletSession = (PortletSession) obj;
@@ -61,4 +64,22 @@
         getSessionMap().remove(key);
     }
 
+    public static Object getFromApplicationScope(Object key) {
+        if (key == null) {
+            //TODO IllegalArgumentException?
+            return null;
+        }
+        Object obj = getSession();
+        if (obj instanceof PortletSession) {
+            PortletSession portletSession = (PortletSession) obj;
+            return portletSession.getAttribute(key.toString(),
+                    PortletSession.APPLICATION_SCOPE);
+        } else {
+            return getSessionMap().get(key);
+        }
+    }
+
+    public static Object getFromLocalScope(Object key) {
+        return getSessionMap().get(key);
+    }
 }


pal-cvs メーリングリストの案内
Back to archive index