public abstract class ViewPool extends Object
A View Pool is a set of initialized views that are kept ready to use. The idea is reset and reuse views taking advantage of existing JSF 2.0 Partial State Saving algorithm with some small additions to component's saveState() method.
This technique works by these reasons:
The implementation proposed uses a lock free view pool structure with soft or weak references. The lock free view pool ensures fast access and the soft or weak references ensured the garbage collection algorithm is not affected by the view pool.
Modifier and Type | Field and Description |
---|---|
static String |
ENTRY_MODE_SOFT |
static String |
ENTRY_MODE_WEAK |
static String |
INIT_PARAM_VIEW_POOL_DEFERRED_NAVIGATION
Defines if the view pool uses deferred navigation to recycle views when navigation
is performed.
|
static String |
INIT_PARAM_VIEW_POOL_ENTRY_MODE
Defines the type of memory reference that is used to hold the view into memory.
|
static String |
INIT_PARAM_VIEW_POOL_ENTRY_MODE_DEFAULT |
static String |
INIT_PARAM_VIEW_POOL_MAX_DYNAMIC_PARTIAL_LIMIT
Defines the limit of the views that cannot be reused partially.
|
static int |
INIT_PARAM_VIEW_POOL_MAX_DYNAMIC_PARTIAL_LIMIT_DEFAULT |
static String |
INIT_PARAM_VIEW_POOL_MAX_POOL_SIZE
Defines the number of views to be hold per each view metadata definition.
|
static int |
INIT_PARAM_VIEW_POOL_MAX_POOL_SIZE_DEFAULT |
Constructor and Description |
---|
ViewPool() |
@JSFWebConfigParam(defaultValue="5", tags="performance") public static final String INIT_PARAM_VIEW_POOL_MAX_POOL_SIZE
public static final int INIT_PARAM_VIEW_POOL_MAX_POOL_SIZE_DEFAULT
@JSFWebConfigParam(defaultValue="2", tags="performance") public static final String INIT_PARAM_VIEW_POOL_MAX_DYNAMIC_PARTIAL_LIMIT
public static final int INIT_PARAM_VIEW_POOL_MAX_DYNAMIC_PARTIAL_LIMIT_DEFAULT
@JSFWebConfigParam(defaultValue="soft", expectedValues="weak,soft", tags="performance") public static final String INIT_PARAM_VIEW_POOL_ENTRY_MODE
public static final String ENTRY_MODE_SOFT
public static final String ENTRY_MODE_WEAK
public static final String INIT_PARAM_VIEW_POOL_ENTRY_MODE_DEFAULT
@JSFWebConfigParam(defaultValue="false", expectedValues="true, false", tags="performance") public static final String INIT_PARAM_VIEW_POOL_DEFERRED_NAVIGATION
public abstract boolean isDeferredNavigationEnabled()
public abstract void storeStaticViewStructureMetadata(FacesContext context, UIViewRoot root, FaceletState faceletState)
public abstract ViewStructureMetadata retrieveStaticViewStructureMetadata(FacesContext context, UIViewRoot root)
public abstract void pushStaticStructureView(FacesContext context, UIViewRoot root)
public abstract void pushPartialStructureView(FacesContext context, UIViewRoot root)
public abstract ViewEntry popStaticOrPartialStructureView(FacesContext context, UIViewRoot root)
public abstract boolean isWorthToRecycleThisView(FacesContext context, UIViewRoot root)
public abstract void storeDynamicViewStructureMetadata(FacesContext context, UIViewRoot root, FaceletState faceletState)
public abstract ViewStructureMetadata retrieveDynamicViewStructureMetadata(FacesContext context, UIViewRoot root, FaceletState faceletState)
public abstract void pushDynamicStructureView(FacesContext context, UIViewRoot root, FaceletState faceletDynamicState)
public abstract ViewEntry popDynamicStructureView(FacesContext context, UIViewRoot root, FaceletState faceletDynamicState)
Copyright © 2020 The Apache Software Foundation. All rights reserved.