org.webmacro.util
Class ScalablePool

java.lang.Object
  |
  +--org.webmacro.util.ScalablePool
All Implemented Interfaces:
Pool

public final class ScalablePool
extends java.lang.Object
implements Pool

This is a scalable pool. It reduces locking contention by multiplexing across a number of internal pools. Each of those pools is a stack which can grow to be as large as necessary to maintain a constant supply of the pooled objects.


Constructor Summary
ScalablePool()
          Create a new Pool.
 
Method Summary
 java.lang.Object get()
          Get an item from the pool
 void put(java.lang.Object o)
          Add an item to the pool for later re-use
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ScalablePool

public ScalablePool()
Create a new Pool.
Method Detail

put

public void put(java.lang.Object o)
Add an item to the pool for later re-use
Specified by:
put in interface Pool

get

public java.lang.Object get()
Get an item from the pool
Specified by:
get in interface Pool