Package org.apache.myfaces.view.facelets
Class ViewPoolProcessor
- java.lang.Object
- 
- org.apache.myfaces.view.facelets.ViewPoolProcessor
 
- 
 public class ViewPoolProcessor extends Object This class is reponsible for all processing tasks related to the view pool. For enable the pool only for a subset of your views, you can add an entry inside faces-config.xml file like this:<faces-config-extension> <view-pool-mapping> <url-pattern>/*</url-pattern> <parameter> <name>org.apache.myfaces.VIEW_POOL_MAX_POOL_SIZE</name> <value>5</value> </parameter> </view-pool-mapping> </faces-config-extension>- Author:
- Leonardo Uribe
 
- 
- 
Field SummaryFields Modifier and Type Field Description static StringDISPOSE_VIEW_NAVIGATIONFlag to indicate that dispose this view on navigation is valid.static StringENABLE_VIEW_POOLUIViewRoot attribute to enable/disable the view for use pooling.static StringFORCE_HARD_RESETFlag that indicates to the StateManagementStrategy that no state needs to be stored and we are using saveState() to dispose the view and store it into the pool directly.static StringINVOKE_DEFERRED_NAVIGATIONParam used to indicate a "deferred navigation" needs to be done.static IntegerRESET_MODE_HARDIndicates a hard reset should be done when saveState(...) is performed, which means all transient and delta state should be cleared, destroying all existing state in the process.static IntegerRESET_MODE_OFFIndicates no reset should be done on this state savingstatic IntegerRESET_MODE_SOFTIndicates a soft reset should be done when saveState(...) is performed, which means all transient state should be cleared but the delta state should not be destroyed in the process.static StringRESET_SAVE_STATE_MODE_KEYAttribute of UIViewRoot that indicates if a soft (1) or hard(2) (reset and check) reset is required in the call to saveState().
 - 
Constructor SummaryConstructors Constructor Description ViewPoolProcessor(FacesContext context)
 - 
Method Summary
 
- 
- 
- 
Field Detail- 
ENABLE_VIEW_POOLpublic static final String ENABLE_VIEW_POOL UIViewRoot attribute to enable/disable the view for use pooling.- See Also:
- Constant Field Values
 
 - 
FORCE_HARD_RESETpublic static final String FORCE_HARD_RESET Flag that indicates to the StateManagementStrategy that no state needs to be stored and we are using saveState() to dispose the view and store it into the pool directly.- See Also:
- Constant Field Values
 
 - 
DISPOSE_VIEW_NAVIGATIONpublic static final String DISPOSE_VIEW_NAVIGATION Flag to indicate that dispose this view on navigation is valid.- See Also:
- Constant Field Values
 
 - 
RESET_SAVE_STATE_MODE_KEYpublic static final String RESET_SAVE_STATE_MODE_KEY Attribute of UIViewRoot that indicates if a soft (1) or hard(2) (reset and check) reset is required in the call to saveState().- See Also:
- Constant Field Values
 
 - 
RESET_MODE_OFFpublic static final Integer RESET_MODE_OFF Indicates no reset should be done on this state saving
 - 
RESET_MODE_SOFTpublic static final Integer RESET_MODE_SOFT Indicates a soft reset should be done when saveState(...) is performed, which means all transient state should be cleared but the delta state should not be destroyed in the process.
 - 
RESET_MODE_HARDpublic static final Integer RESET_MODE_HARD Indicates a hard reset should be done when saveState(...) is performed, which means all transient and delta state should be cleared, destroying all existing state in the process. If something cannot be reseted, the state should return non null, so the algorithm can remove the component from the tree and mark the tree as partial (requires refresh before reuse).
 - 
INVOKE_DEFERRED_NAVIGATIONpublic static final String INVOKE_DEFERRED_NAVIGATION Param used to indicate a "deferred navigation" needs to be done. To allow the view pool to dispose the view properly (and reuse it later), it is necessary to ensure the view is not being used at the moment. If the navigation call occur inside an action listener, the current view is being used and cannot be disposed (because it conflicts with hard/soft reset). This extension allows to call handleNavigation() before end invoke application phase, but after traverse the component tree.- See Also:
- Constant Field Values
 
 
- 
 - 
Constructor Detail- 
ViewPoolProcessorpublic ViewPoolProcessor(FacesContext context) 
 
- 
 - 
Method Detail- 
getInstancepublic static ViewPoolProcessor getInstance(FacesContext context) 
 - 
initializepublic static void initialize(FacesContext context) This method should be called at startup to decide if a view processor should be provided or not to the runtime.- Parameters:
- context-
 
 - 
getViewPoolpublic ViewPool getViewPool(FacesContext context, UIViewRoot root) 
 - 
isViewPoolEnabledForThisViewpublic boolean isViewPoolEnabledForThisView(FacesContext context, UIViewRoot root) 
 - 
isViewPoolStrategyAllowedForThisViewpublic boolean isViewPoolStrategyAllowedForThisView(FacesContext context, UIViewRoot root) 
 - 
setViewPoolDisabledOnThisViewpublic void setViewPoolDisabledOnThisView(FacesContext context, UIViewRoot root, boolean value) 
 - 
cloneAndRestoreViewpublic void cloneAndRestoreView(FacesContext context, UIViewRoot newView, ViewEntry entry, ViewStructureMetadata metadata) Takes the newView and restore the state taken as base the provided ViewEntry, and then move all child components from oldView to newView, to finally obtain a clean component tree.- Parameters:
- context-
- newView-
- entry-
 
 - 
storeViewStructureMetadatapublic void storeViewStructureMetadata(FacesContext context, UIViewRoot root) 
 - 
retrieveViewStructureMetadatapublic ViewStructureMetadata retrieveViewStructureMetadata(FacesContext context, UIViewRoot root) 
 - 
pushResetableViewpublic void pushResetableView(FacesContext context, UIViewRoot view, FaceletState faceletViewState) 
 - 
pushPartialViewpublic void pushPartialView(FacesContext context, UIViewRoot view, FaceletState faceletViewState, int count) 
 - 
clearTransientAndNonFaceletComponentsForStaticViewprotected void clearTransientAndNonFaceletComponentsForStaticView(FacesContext context, UIViewRoot root) 
 - 
clearTransientAndNonFaceletComponentsForDynamicViewpublic void clearTransientAndNonFaceletComponentsForDynamicView(FacesContext context, UIViewRoot root, ViewStructureMetadata viewStructureMetadata) 
 - 
processDeferredNavigationpublic void processDeferredNavigation(FacesContext facesContext) 
 - 
disposeViewpublic void disposeView(FacesContext facesContext, UIViewRoot root) 
 
- 
 
-