Fast, lightweight, and compatible blocking/non-blocking/soft-reference object pool for Java 6+
Go to file
nathan 3705abf2ef updated readme + javadocs 2016-02-09 18:03:18 +01:00
src/dorkbox/util/objectPool updated readme + javadocs 2016-02-09 18:03:18 +01:00
.classpath Added intellij support. Compiled as java6. Pool.take() will wait if there are no more objects in the pool. 2015-06-28 00:45:33 +02:00
.gitignore Initial import of ObjectPool project 2015-02-02 00:33:46 +01:00
.project Initial import of ObjectPool project 2015-02-02 00:33:46 +01:00
LICENSE Updated ObjectPool 2015-12-30 02:47:07 +01:00
LICENSE.Apachev2 Initial import of ObjectPool project 2015-02-02 00:33:46 +01:00
ObjectPool.iml Removed libs/dist and now only have safe object pool (based on ArrayBlockingQueue) 2016-02-09 17:57:19 +01:00
README.md updated readme + javadocs 2016-02-09 18:03:18 +01:00

README.md

ObjectPool

This provides an ObjectPool, for providing for a safe, and quick pool of objects of a specific size. This is only recommended in systems were garbage collection is to be kept to a minimum, and the created objects are large.

  • This is for cross-platform use, specifically - linux 32/64, mac 32/64, and windows 32/64. Java 6+

Usage:

   /**
    * Takes an object from the pool, Blocks until an item is available in the pool.
    */
    public ObjectPoolHolder<T> take();

    /**
     * Takes an object from the pool, Blocks until an item is available in the pool.
     * <p/>
     * This method catches {@link InterruptedException} and discards it silently.
     */
    T takeUninterruptibly() {

    /**
     * Return object to the pool, waking the threads that have blocked during take()
     */
    void release(T object);

    /**
     * @return a new object instance created by the pool.
     */
    T newInstance();

    /**
     * @return the number of currently pooled objects
     */
    int size();