1   /**
2    * Copyright (c) 2000-2010 Liferay, Inc. All rights reserved.
3    *
4    * The contents of this file are subject to the terms of the Liferay Enterprise
5    * Subscription License ("License"). You may not use this file except in
6    * compliance with the License. You can obtain a copy of the License by
7    * contacting Liferay, Inc. See the License for the specific language governing
8    * permissions and limitations under the License, including but not limited to
9    * distribution rights of the Software.
10   *
11   *
12   *
13   */
14  
15  package com.liferay.util.bridges.jsf.myfaces;
16  
17  import javax.faces.context.ResponseWriter;
18  
19  import javax.portlet.PortletContext;
20  import javax.portlet.PortletRequest;
21  import javax.portlet.PortletResponse;
22  
23  import org.apache.myfaces.context.ReleaseableExternalContext;
24  import org.apache.myfaces.context.servlet.ServletFacesContextImpl;
25  
26  /**
27   * <a href="MyFacesContextImpl.java.html"><b><i>View Source</i></b></a>
28   *
29   * @author Brian Myunghun Kim
30   */
31  public class MyFacesContextImpl extends ServletFacesContextImpl {
32  
33      public MyFacesContextImpl(PortletContext portletContext,
34                                PortletRequest portletRequest,
35                                PortletResponse portletResponse) {
36  
37          super(portletContext, portletRequest, portletResponse);
38      }
39  
40      public void setResponseWriter(ResponseWriter responseWriter) {
41          if (responseWriter == null) {
42              throw new NullPointerException("responseWriter");
43          }
44  
45          _responseWriter = responseWriter;
46      }
47  
48      public ResponseWriter getResponseWriter() {
49          return _responseWriter;
50      }
51  
52      public void release() {
53          super.release();
54  
55          _responseWriter = null;
56      }
57  
58      public void setExternalContext(ReleaseableExternalContext extContext) {
59          _responseWriter = null;
60  
61          super.setExternalContext(extContext);
62      }
63  
64      private ResponseWriter _responseWriter = null;
65  
66  }