You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by lu...@apache.org on 2008/11/02 03:18:08 UTC

svn commit: r709830 - /myfaces/core/branches/2_0_0/impl/src/main/java/org/apache/myfaces/context/servlet/FacesContextImpl.java

Author: lu4242
Date: Sat Nov  1 19:18:07 2008
New Revision: 709830

URL: http://svn.apache.org/viewvc?rev=709830&view=rev
Log:
MYFACES-1942 added implementation of getAttributes for FacesContextImpl (pending check if method on FacesContext is abstract or not)

Modified:
    myfaces/core/branches/2_0_0/impl/src/main/java/org/apache/myfaces/context/servlet/FacesContextImpl.java

Modified: myfaces/core/branches/2_0_0/impl/src/main/java/org/apache/myfaces/context/servlet/FacesContextImpl.java
URL: http://svn.apache.org/viewvc/myfaces/core/branches/2_0_0/impl/src/main/java/org/apache/myfaces/context/servlet/FacesContextImpl.java?rev=709830&r1=709829&r2=709830&view=diff
==============================================================================
--- myfaces/core/branches/2_0_0/impl/src/main/java/org/apache/myfaces/context/servlet/FacesContextImpl.java (original)
+++ myfaces/core/branches/2_0_0/impl/src/main/java/org/apache/myfaces/context/servlet/FacesContextImpl.java Sat Nov  1 19:18:07 2008
@@ -19,9 +19,11 @@
 package org.apache.myfaces.context.servlet;
 
 import java.util.ArrayList;
+import java.util.HashMap;
 import java.util.Iterator;
 import java.util.LinkedHashSet;
 import java.util.List;
+import java.util.Map;
 import java.util.Set;
 
 import javax.el.ELContext;
@@ -73,6 +75,7 @@
     private RenderKitFactory _renderKitFactory;
     private boolean _released = false;
     private ELContext _elContext;
+    private Map<Object,Object> _attributes = null;
 
     // ~ Constructors -------------------------------------------------------------------------------
 
@@ -362,6 +365,7 @@
         _responseStream = null;
         _responseWriter = null;
         _viewRoot = null;
+        _attributes = null;
 
         _released = true;
         FacesContext.setCurrentInstance(null);
@@ -423,5 +427,21 @@
 
         return _elContext;
     }
-
+    
+    /**
+     * @since JSF 2.0 
+     */
+    @Override
+    public Map<Object,Object> getAttributes()
+    {
+        if (_released)
+        {
+            throw new IllegalStateException("FacesContext already released");
+        }        
+        if (_attributes == null)
+        {
+            _attributes = new HashMap<Object, Object>();
+        }
+        return _attributes;
+    }
 }