Class ViewPoolEntryHolder

java.lang.Object
org.apache.myfaces.view.facelets.pool.impl.ViewPoolEntryHolder

public class ViewPoolEntryHolder extends Object
Fast pool using ConcurrentLinkedQueue, with uses an AtomicInteger as count limit. The reasons of design this pool in this way are:
  1. There is no need to put a hard limit about the max number of views stored in the pool. Remember ViewEntry internally has a Soft or Weak reference over the view. The maxCount is just a way to limit the max footprint fo the pool in memory, but if the limit is exceed, the vm can always reclaim the memory space.
  2. View creation is quite fast, so according to previous tests done, include any syncronized method in this code will produce worse performance.
Author:
Leonardo Uribe
  • Constructor Details

    • ViewPoolEntryHolder

      public ViewPoolEntryHolder(int maxCount)
  • Method Details

    • add

      public boolean add(ViewEntry entry)
    • poll

      public ViewEntry poll()
    • isFull

      public boolean isFull()
    • getCount

      public int getCount()