/*
 * JBoss, the OpenSource J2EE webOS
 *
 * Distributable under LGPL license.
 * See terms of license at gnu.org.
 */
package org.jboss.ejb3;

import org.jboss.ejb3.injection.Injector;

/**
 * Minimally a pool acts as a factory for a bean.  It will handle callbacks
 * to ejbCreate and ejbRemove as well.
 *
 * @author <a href="mailto:bill@jboss.org">Bill Burke</a>
 * @version $Revision: 1.5.2.4 $
 */
public interface Pool
{
   /**
    * Creates if no object is available in pool.  ejbCreate will be called if created
    */
   BeanContext get();

   BeanContext get(Class[] initTypes, Object[] initValues);

   /**
    * Put bean back in pool
    */
   void release(BeanContext obj);

   /**
    * Destroy bean.  ejbRemove callback is executed
    */
   void remove(BeanContext obj);

   public void setInjectors(Injector[] injectors);

   void initialize(Container container, Class contextClass, Class beanClass, int maxSize, long timeout);
}
