Class BlockingPool

  • All Implemented Interfaces:
    Pool

    public class BlockingPool
    extends NonBlockingPool
    Author:
    lprimak
    • Constructor Detail

      • BlockingPool

        public BlockingPool​(long containerId,
                            String name,
                            ObjectFactory sessionCtxFactory,
                            int steadyPoolSize,
                            int poolResizeQuantity,
                            int maxPoolSize,
                            int poolIdleTimeoutInSeconds,
                            ClassLoader loader,
                            boolean singletonBeanPool,
                            int maxWaitTimeInMillis)
    • Method Detail

      • getObject

        public Object getObject​(Object param)
                         throws PoolException
        Description copied from interface: Pool
        Get an object from the pool within the specified time. The amount of time the calling thread agrees to wait. Some value that might be used while creating the object
        Specified by:
        getObject in interface Pool
        Overrides:
        getObject in class NonBlockingPool
        Returns:
        an Object or null if an object could not be returned in 'waitForMillis' millisecond.
        Throws:
        PoolException - if an object cannot be created
      • returnObject

        public void returnObject​(Object object)
        Return an object back to the pool. An object that is obtained through getObject() must always be returned back to the pool using either returnObject(obj) or through destroyObject(obj).
        Specified by:
        returnObject in interface Pool
        Overrides:
        returnObject in class NonBlockingPool
      • destroyObject

        public void destroyObject​(Object object)
        Destroys an Object. Note that applications should not ignore the reference to the object that they got from getObject(). An object that is obtained through getObject() must always be returned back to the pool using either returnObject(obj) or through destroyObject(obj). This method tells that the object should be destroyed and cannot be reused.
        Specified by:
        destroyObject in interface Pool
        Overrides:
        destroyObject in class NonBlockingPool
        Parameters:
        object - Object to be destroyed.