RDFEntityLoaderPool.java from Texai at Krugle
Show RDFEntityLoaderPool.java syntax highlighted
/*
* RDFEntityLoaderPool.java
*
* Created on August 15, 2007, 11:06 AM
*
* Description: Provides an RDF entity loader pool.
*
* Copyright (C) August 15, 2007 Stephen L. Reed.
*
* This program is free software; you can redistribute it and/or modify it under the terms
* of the GNU General Public License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
* See the GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along with this program;
* if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
package org.texai.kb.persistence;
import net.jcip.annotations.ThreadSafe;
import org.apache.commons.pool.PoolableObjectFactory;
import org.apache.commons.pool.impl.GenericObjectPool;
import org.apache.commons.pool.BaseObjectPool;
/** This class extends the Apache GenericObjectPool to provide a pool of RDFEntityLoader instances, which are
* dynamically used by lazy loaders.
*
* @author reed
*/
@ThreadSafe
public class RDFEntityLoaderPool extends GenericObjectPool {
/** the RDF entity loader factory */
final PoolableObjectFactory rdfEntityLoaderFactory;
/**
* Creates a new instance of RDFEntityLoaderPool.
*
* @param rdfEntityLoaderFactory the PoolableObjectFactory to use to create, validate and destroy objects
* @param maxActive the maximum number of objects that can be borrowed from this pool at one time
*/
public RDFEntityLoaderPool(final PoolableObjectFactory rdfEntityLoaderFactory, final int maxActive) {
super(rdfEntityLoaderFactory, maxActive);
this.rdfEntityLoaderFactory = rdfEntityLoaderFactory;
}
/** Gets the RDF entity loader factory.
*
* @return the RDF entity loader factory
*/
public PoolableObjectFactory getRDFEntityLoaderFactory() {
return rdfEntityLoaderFactory;
}
}
See more files for this project here