org.apache.tomcat.util.collections

Class SimplePool

public final class SimplePool extends Object

Deprecated:

Simple object pool. Based on ThreadPool and few other classes The pool will ignore overflow and return null if empty.

Author: Gal Shachor Costin Manolache

Field Summary
static intDEFAULT_SIZE
Constructor Summary
SimplePool()
SimplePool(int size)
SimplePool(int size, int max)
Method Summary
Objectget()
Get an object from the pool, null if the pool is empty.
intgetCount()
Number of object in the pool
intgetMax()
Return the size of the pool
voidput(Object o)
Add the object to the pool, silent nothing if the pool is full
voidset(Object o)
voidshutdown()

Field Detail

DEFAULT_SIZE

public static final int DEFAULT_SIZE

Constructor Detail

SimplePool

public SimplePool()

SimplePool

public SimplePool(int size)

SimplePool

public SimplePool(int size, int max)

Method Detail

get

public Object get()
Get an object from the pool, null if the pool is empty.

getCount

public int getCount()
Number of object in the pool

getMax

public int getMax()
Return the size of the pool

put

public void put(Object o)
Add the object to the pool, silent nothing if the pool is full

set

public void set(Object o)

shutdown

public void shutdown()
Copyright © 2000-2011 Apache Software Foundation. All Rights Reserved.