Code Search for Developers
 
 
  

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

Texai

Texai is an chatbot that intelligently seeks to acquire knowledge and friendly behaviors.

Project homepage: http://sourceforge.net/projects/texai
Programming language(s): Java,Shell Script,XML
License: other

  benchmark/
    AbstractRDFTestEntity.java
    PerformanceBenchmark.java
    RDFTestEntity.java
  lazy/
    LazyList.java
    LazySet.java
    RDFEntityLazyLoader.java
  sample/
    Agent.java
    Friend.java
    LoadAFriend.java
    PersistANewFriend.java
    Person.java
    RemoveAFriend.java
    UpdateAFriend.java
  AbstractRDFEntityAccessor.java
  RDFEntity.java
  RDFEntityLoader.java
  RDFEntityLoaderFactory.java
  RDFEntityLoaderPool.java
  RDFEntityManager.java
  RDFEntityPersister.java
  RDFEntityRemover.java
  RDFNamespace.java
  RDFProperty.java
  RDFUtility.java