}
}
public void pushPartialView(FacesContext context, UIViewRoot view, FaceletState faceletViewState, int count)
{
ViewPool viewPool = getViewPool(context, view);
if (viewPool.isWorthToRecycleThisView(context, view))
{
ViewStructureMetadata viewStructureMetadata = null;
if (faceletViewState == null)
{
viewStructureMetadata = viewPool.retrieveStaticViewStructureMetadata(context, view);
}
else
{
viewStructureMetadata = viewPool.retrieveDynamicViewStructureMetadata(
context, view, faceletViewState);
}
if (viewStructureMetadata != null)
{
ClearPartialTreeContext ptc = new ClearPartialTreeContext();
// add partial structure view to the map.
clearTransientAndRemoveNonResetableComponents(context, ptc, view, viewStructureMetadata);
int reusableCount = ptc.getCount();
float factor = ((float)reusableCount) / ((float)count);
if (factor > 0.3f)
{
viewPool.pushPartialStructureView(context, view);
}
}
}
}