org.apache.myfaces.view.facelets.pool.impl
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:
- 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.
- 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
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ViewPoolEntryHolder
public ViewPoolEntryHolder(int maxCount)
add
public boolean add(ViewEntry entry)
poll
public ViewEntry poll()
isFull
public boolean isFull()
getCount
public int getCount()
Copyright © 2014 The Apache Software Foundation. All rights reserved.