com.liferay.faces.bridge.context
Class IncongruityContext

java.lang.Object
  extended by javax.faces.context.ExternalContext
      extended by com.liferay.faces.bridge.context.IncongruityContext
Direct Known Subclasses:
IncongruityContextBaseImpl

public abstract class IncongruityContext
extends javax.faces.context.ExternalContext

Occasionally there is an incongruity (a mismatch) between the Portlet lifecycle and the JSF lifecycle with regard to execution of methods on the ExternalContext. This class is designed to compensate for these incongruous actions as much as possible.

Example: Sometimes the JSF implementation or a JSF ActionListener will call methods like ExternalContext.setResponseStatus(int) during the Portlet PortletRequest.ACTION_PHASE. In this case, the Portlet lifecycle is working with a ActionResponse but there is no corresponding method. Technically the only time such a method could be called would be during the PortletRequest.RESOURCE_PHASE because the ResourceResponse class has a setReponseStatus(int) method.

Author:
Neil Griffin

Field Summary
 
Fields inherited from class javax.faces.context.ExternalContext
BASIC_AUTH, CLIENT_CERT_AUTH, DIGEST_AUTH, FORM_AUTH
 
Constructor Summary
IncongruityContext()
           
 
Method Summary
abstract  Map<String,Object> getAttributes()
          Returns a mutable map of attributes.
abstract  int getResponseContentLength()
           
abstract  void makeCongruous(javax.faces.context.FacesContext facesContext)
          This method is designed to be called during the RENDER_PHASE of the portlet lifecycle, and will execute ExternalContext methods that were inappropriately called during the ACTION_PHASE or EVENT_PHASE.
abstract  void setRequestContentLength(int length)
           
abstract  void setRequestContentType(String contentType)
           
abstract  void setResponseCommitted(boolean committed)
           
 
Methods inherited from class javax.faces.context.ExternalContext
addResponseCookie, addResponseHeader, dispatch, encodeActionURL, encodeBookmarkableURL, encodeNamespace, encodePartialActionURL, encodeRedirectURL, encodeResourceURL, getApplicationMap, getAuthType, getContext, getContextName, getFlash, getInitParameter, getInitParameterMap, getMimeType, getRealPath, getRemoteUser, getRequest, getRequestCharacterEncoding, getRequestContentLength, getRequestContentType, getRequestContextPath, getRequestCookieMap, getRequestHeaderMap, getRequestHeaderValuesMap, getRequestLocale, getRequestLocales, getRequestMap, getRequestParameterMap, getRequestParameterNames, getRequestParameterValuesMap, getRequestPathInfo, getRequestScheme, getRequestServerName, getRequestServerPort, getRequestServletPath, getResource, getResourceAsStream, getResourcePaths, getResponse, getResponseBufferSize, getResponseCharacterEncoding, getResponseContentType, getResponseOutputStream, getResponseOutputWriter, getSession, getSessionMap, getSessionMaxInactiveInterval, getUserPrincipal, invalidateSession, isResponseCommitted, isSecure, isUserInRole, log, log, redirect, responseFlushBuffer, responseReset, responseSendError, setRequest, setRequestCharacterEncoding, setResponse, setResponseBufferSize, setResponseCharacterEncoding, setResponseContentLength, setResponseContentType, setResponseHeader, setResponseStatus, setSessionMaxInactiveInterval
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

IncongruityContext

public IncongruityContext()
Method Detail

makeCongruous

public abstract void makeCongruous(javax.faces.context.FacesContext facesContext)
                            throws IOException
This method is designed to be called during the RENDER_PHASE of the portlet lifecycle, and will execute ExternalContext methods that were inappropriately called during the ACTION_PHASE or EVENT_PHASE.

Parameters:
facesContext - The current FacesContext.
Throws:
IOException - If an error occurs.

getAttributes

public abstract Map<String,Object> getAttributes()
Returns a mutable map of attributes.

Returns:
The attribute map.

setRequestContentLength

public abstract void setRequestContentLength(int length)
Since:
JSF 2.0

setRequestContentType

public abstract void setRequestContentType(String contentType)
Since:
JSF 2.0

setResponseCommitted

public abstract void setResponseCommitted(boolean committed)
Since:
JSF 2.0

getResponseContentLength

public abstract int getResponseContentLength()
Since:
JSF 2.0


Copyright © 2014 Liferay, Inc.. All Rights Reserved.