com.liferay.faces.bridge.scope.internal
Class BridgeRequestScopeImpl

java.lang.Object
  extended by com.liferay.faces.bridge.scope.internal.BridgeRequestScopeBaseImpl
      extended by com.liferay.faces.bridge.scope.internal.BridgeRequestScopeCompatImpl
          extended by com.liferay.faces.bridge.scope.internal.BridgeRequestScopeCompat_2_2_Impl
              extended by com.liferay.faces.bridge.scope.internal.BridgeRequestScopeImpl
All Implemented Interfaces:
BridgeRequestScope, Serializable
Direct Known Subclasses:
BridgeRequestScopeLiferayImpl

public class BridgeRequestScopeImpl
extends BridgeRequestScopeCompat_2_2_Impl
implements Serializable

Author:
Neil Griffin
See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from interface com.liferay.faces.bridge.scope.BridgeRequestScope
BridgeRequestScope.Transport
 
Field Summary
protected static String BRIDGE_REQ_SCOPE_NON_EXCLUDED_ATTR_NAMES
           
protected static String EXCLUCED_NAMESPACE_JAVAX_SERVLET
           
protected static String EXCLUCED_NAMESPACE_JAVAX_SERVLET_INCLUDE
           
protected static String EXCLUDED_NAMESPACE_JAVAX_FACES
           
protected static String EXCLUDED_NAMESPACE_JAVAX_PORTLET
           
protected static String EXCLUDED_NAMESPACE_JAVAX_PORTLET_FACES
           
 
Constructor Summary
BridgeRequestScopeImpl(javax.portlet.PortletRequest portletRequest, javax.portlet.PortletConfig portletConfig, BridgeConfig bridgeConfig)
           
 
Method Summary
 Bridge.PortletPhase getBeganInPhase()
           
 long getDateCreated()
           
 String getId()
           
 Map<String,Object> getManagedBeanMap()
           
 javax.portlet.PortletMode getPortletMode()
           
protected  Set<String> getPreExistingRequestAttributeNames(javax.portlet.PortletRequest portletRequest)
          According to section 5.1.2 of the JSR 329 spec, the request attributes that exist before the bridge acquires the FacesContext must not be part of the bridge request scope.
 Map<String,String> getPreservedActionParameterMap()
           
 String getPreservedViewStateParam()
           
 Set<String> getRemovedAttributeNames()
           
 int hashCode()
          The overrides for toString() and hashCode() are necessary because the ConcurrentHashMap parent class overrides them and causes debug logs to be difficult to interpret.
protected  boolean isExcludedRequestAttributeByAnnotation(Object attributeValue)
           
protected  boolean isExcludedRequestAttributeByConfig(String attributeName, Object attributeValue)
           
protected  boolean isExcludedRequestAttributeByInstance(String attributeName, Object attributeValue)
           
protected  boolean isExcludedRequestAttributeByNamespace(String attributeName)
           
protected  boolean isExcludedRequestAttributeByPreExisting(String attributeName)
           
 boolean isFacesLifecycleExecuted()
           
protected  boolean isNamespaceMatch(String attributeName, String namespace)
           
 boolean isNavigationOccurred()
           
 boolean isPortletModeChanged()
           
 boolean isRedirectOccurred()
           
 void removeExcludedAttributes(javax.portlet.RenderRequest renderRequest)
          Unlike Pluto, Liferay will preserve/copy request attributes that were originally set on an ActionRequest into the RenderRequest.
 void restoreState(javax.faces.context.FacesContext facesContext)
           
 void saveState(javax.faces.context.FacesContext facesContext)
          Saves the state of the FacesContext as required by section 5.1.2 of the JSR 329 spec.
 void setFacesLifecycleExecuted(boolean facesLifecycleExecuted)
           
 void setIdPrefix(String idPrefix)
           
 void setNavigationOccurred(boolean navigationOccurred)
           
 void setPortletMode(javax.portlet.PortletMode portletMode)
           
 void setPortletModeChanged(boolean portletModeChanged)
           
 void setRedirectOccurred(boolean redirect)
           
 String toString()
          The overrides for toString() and hashCode() are necessary because the ConcurrentHashMap parent class overrides them and causes debug logs to be difficult to interpret.
 
Methods inherited from class com.liferay.faces.bridge.scope.internal.BridgeRequestScopeCompat_2_2_Impl
restoreClientWindow, saveClientWindow
 
Methods inherited from class com.liferay.faces.bridge.scope.internal.BridgeRequestScopeCompatImpl
restoreFlashState, restoreJSF2FacesContextAttributes, saveFlashState, saveJSF2FacesContextAttributes
 
Methods inherited from class com.liferay.faces.bridge.scope.internal.BridgeRequestScopeBaseImpl
getAttribute, setAttribute
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

BRIDGE_REQ_SCOPE_NON_EXCLUDED_ATTR_NAMES

protected static final String BRIDGE_REQ_SCOPE_NON_EXCLUDED_ATTR_NAMES
See Also:
Constant Field Values

EXCLUDED_NAMESPACE_JAVAX_FACES

protected static final String EXCLUDED_NAMESPACE_JAVAX_FACES
See Also:
Constant Field Values

EXCLUDED_NAMESPACE_JAVAX_PORTLET

protected static final String EXCLUDED_NAMESPACE_JAVAX_PORTLET
See Also:
Constant Field Values

EXCLUDED_NAMESPACE_JAVAX_PORTLET_FACES

protected static final String EXCLUDED_NAMESPACE_JAVAX_PORTLET_FACES
See Also:
Constant Field Values

EXCLUCED_NAMESPACE_JAVAX_SERVLET

protected static final String EXCLUCED_NAMESPACE_JAVAX_SERVLET
See Also:
Constant Field Values

EXCLUCED_NAMESPACE_JAVAX_SERVLET_INCLUDE

protected static final String EXCLUCED_NAMESPACE_JAVAX_SERVLET_INCLUDE
See Also:
Constant Field Values
Constructor Detail

BridgeRequestScopeImpl

public BridgeRequestScopeImpl(javax.portlet.PortletRequest portletRequest,
                              javax.portlet.PortletConfig portletConfig,
                              BridgeConfig bridgeConfig)
Method Detail

hashCode

public int hashCode()
The overrides for toString() and hashCode() are necessary because the ConcurrentHashMap parent class overrides them and causes debug logs to be difficult to interpret.

Overrides:
hashCode in class Object

removeExcludedAttributes

public void removeExcludedAttributes(javax.portlet.RenderRequest renderRequest)
Unlike Pluto, Liferay will preserve/copy request attributes that were originally set on an ActionRequest into the RenderRequest. However, the Bridge Spec assumes that they will not be preserved. Therefore is necessary to remove these request attributes when running under Liferay.

Specified by:
removeExcludedAttributes in interface BridgeRequestScope

restoreState

public void restoreState(javax.faces.context.FacesContext facesContext)
Specified by:
restoreState in interface BridgeRequestScope

saveState

public void saveState(javax.faces.context.FacesContext facesContext)
Saves the state of the FacesContext as required by section 5.1.2 of the JSR 329 spec. This method is designed to be called during the ACTION_PHASE of the portlet lifecycle.

Specified by:
saveState in interface BridgeRequestScope
Parameters:
facesContext - The current faces context.

toString

public String toString()
The overrides for toString() and hashCode() are necessary because the ConcurrentHashMap parent class overrides them and causes debug logs to be difficult to interpret.

Overrides:
toString in class Object

getBeganInPhase

public Bridge.PortletPhase getBeganInPhase()
Specified by:
getBeganInPhase in interface BridgeRequestScope

isFacesLifecycleExecuted

public boolean isFacesLifecycleExecuted()
Specified by:
isFacesLifecycleExecuted in interface BridgeRequestScope

isNavigationOccurred

public boolean isNavigationOccurred()
Specified by:
isNavigationOccurred in interface BridgeRequestScope

isPortletModeChanged

public boolean isPortletModeChanged()
Specified by:
isPortletModeChanged in interface BridgeRequestScope

isRedirectOccurred

public boolean isRedirectOccurred()
Specified by:
isRedirectOccurred in interface BridgeRequestScope

getDateCreated

public long getDateCreated()
Specified by:
getDateCreated in interface BridgeRequestScope

isExcludedRequestAttributeByInstance

protected boolean isExcludedRequestAttributeByInstance(String attributeName,
                                                       Object attributeValue)

isExcludedRequestAttributeByNamespace

protected boolean isExcludedRequestAttributeByNamespace(String attributeName)

setFacesLifecycleExecuted

public void setFacesLifecycleExecuted(boolean facesLifecycleExecuted)
Specified by:
setFacesLifecycleExecuted in interface BridgeRequestScope

isExcludedRequestAttributeByConfig

protected boolean isExcludedRequestAttributeByConfig(String attributeName,
                                                     Object attributeValue)

isExcludedRequestAttributeByPreExisting

protected boolean isExcludedRequestAttributeByPreExisting(String attributeName)

isNamespaceMatch

protected boolean isNamespaceMatch(String attributeName,
                                   String namespace)

getId

public String getId()
Specified by:
getId in interface BridgeRequestScope

setIdPrefix

public void setIdPrefix(String idPrefix)
Specified by:
setIdPrefix in interface BridgeRequestScope

getManagedBeanMap

public Map<String,Object> getManagedBeanMap()

isExcludedRequestAttributeByAnnotation

protected boolean isExcludedRequestAttributeByAnnotation(Object attributeValue)

setNavigationOccurred

public void setNavigationOccurred(boolean navigationOccurred)
Specified by:
setNavigationOccurred in interface BridgeRequestScope

getPortletMode

public javax.portlet.PortletMode getPortletMode()
Specified by:
getPortletMode in interface BridgeRequestScope

setPortletMode

public void setPortletMode(javax.portlet.PortletMode portletMode)
Specified by:
setPortletMode in interface BridgeRequestScope

setPortletModeChanged

public void setPortletModeChanged(boolean portletModeChanged)
Specified by:
setPortletModeChanged in interface BridgeRequestScope

getPreExistingRequestAttributeNames

protected Set<String> getPreExistingRequestAttributeNames(javax.portlet.PortletRequest portletRequest)
According to section 5.1.2 of the JSR 329 spec, the request attributes that exist before the bridge acquires the FacesContext must not be part of the bridge request scope. Having noted that, we have to save-off a list of names of these pre-existing request attributes, so that we know to NOT restore them.


getPreservedActionParameterMap

public Map<String,String> getPreservedActionParameterMap()
Specified by:
getPreservedActionParameterMap in interface BridgeRequestScope

getPreservedViewStateParam

public String getPreservedViewStateParam()
Specified by:
getPreservedViewStateParam in interface BridgeRequestScope

setRedirectOccurred

public void setRedirectOccurred(boolean redirect)
Specified by:
setRedirectOccurred in interface BridgeRequestScope

getRemovedAttributeNames

public Set<String> getRemovedAttributeNames()
Specified by:
getRemovedAttributeNames in interface BridgeRequestScope


Copyright © 2015 Liferay, Inc.. All rights reserved.