/* JFox, the OpenSource J2EE Application Server
 *
 * Copyright (C) 2002 huihoo.org
 * Distributable under GNU LGPL license
 * See the GNU Lesser General Public License for more details.
 */

package org.huihoo.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);

}