/* JFox, the OpenSource J2EE Application Server
 *
 * Distributable under GNU LGPL license by gun.org
 * more details please visit http://www.huihoo.org/jfox
 */

package org.jfox.pool;

/**
 * @author <a href="mailto:young_yy@hotmail.com">Young Yang</a>
 */


public interface ObjectFactory {

    Class getObjectClass();

    /**
     * create a new poolable object
     *
     * @return
     */
    PoolableObject makeObject() throws Exception;

    /**
     * destroy a poolabled object
     *
     * @param object
     */
    void destroyObject(PoolableObject object) throws Exception;

    /**
     * Ensures that the instance is safe to be returned by the pool
     *
     * @param object
     * @return
     */
    boolean validateObject(PoolableObject object);

}
