/* 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;

import java.util.List;

import org.jfox.framework.Component;
import org.jfox.framework.ComponentContext;

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

public class PoolManagerComponent implements Component {


    /**
     * create a object pool with the poolable object factory
     *
     * @param factory
     * @return
     */
    public ObjectPool createPool(ObjectFactory factory) {
        return PoolManager.createPool(factory);
    }

    /**
     * obtain a object pool , when not exists, will create one
     *
     * @param factory
     * @return
     */
    public ObjectPool obtainPool(ObjectFactory factory) {
        return PoolManager.obtainPool(factory);
    }

    public boolean existsPool(Class factoryClass) {
        return PoolManager.existsPool(factoryClass);
    }

    /**
     * create a object pool with the poolable object factory
     *
     * @param factory
     * @return
     */
    public IndexableObjectPool createIndexablePool(ObjectFactory factory) {
        return PoolManager.createIndexablePool(factory);
    }

    /**
     * obtain a object pool , when not exists, will create one
     *
     * @param factory
     * @return
     */
    public IndexableObjectPool obtainIndexablePool(ObjectFactory factory) {
        return PoolManager.obtainIndexablePool(factory);
    }

    public boolean existsIndexablePool(Class factoryClass) {
        return PoolManager.existsIndexablePool(factoryClass);
    }

    public synchronized List pools() {
        return PoolManager.pools();
    }

    public void setComponentContext(ComponentContext ctx) {
    }

    public void main(String[] args) {

    }
}
