Class StrictMaxPool<T>

java.lang.Object
org.jboss.as.ejb3.pool.AbstractPool<T>
org.jboss.as.ejb3.pool.strictmax.StrictMaxPool<T>
All Implemented Interfaces:
Pool<T>

public class StrictMaxPool<T> extends AbstractPool<T>
A pool with a maximum size.
Author:
Carlo de Wolf, Kabir Khan
  • Constructor Details

  • Method Details

    • discard

      public void discard(T ctx)
      Description copied from interface: Pool
      Discard an object. This will be called in case of a system exception.
      Parameters:
      ctx - the object
    • getCurrentSize

      public int getCurrentSize()
    • getAvailableCount

      public int getAvailableCount()
    • getMaxSize

      public int getMaxSize()
    • setMaxSize

      public void setMaxSize(int maxSize)
      Specified by:
      setMaxSize in interface Pool<T>
      Specified by:
      setMaxSize in class AbstractPool<T>
    • get

      public T get()
      Get an instance without identity. Can be used by finders,create-methods, and activation
      Returns:
      Context /w instance
    • release

      public void release(T obj)
      Return an instance after invocation.

      Called in 2 cases: a) Done with finder method b) Just removed

      Parameters:
      obj -
    • remove

      @Deprecated public void remove(T ctx)
      Deprecated.
      Overrides:
      remove in class AbstractPool<T>
    • start

      public void start()
      Description copied from interface: Pool
      Start the pool.
    • stop

      public void stop()
      Description copied from interface: Pool
      Stop the pool.