org.infinispan.loader.bdbje
Class BdbjeResourceFactory

java.lang.Object
  extended by org.infinispan.loader.bdbje.BdbjeResourceFactory

public class BdbjeResourceFactory
extends Object

Factory that assembles objects specific to the SleepyCat JE API.

Since:
4.0
Version:
$Id: BdbjeResourceFactory.java 97 2009-04-08 00:43:27Z manik.surtani@jboss.com $
Author:
Adrian Cole

Constructor Summary
BdbjeResourceFactory(BdbjeCacheStoreConfig config)
           
 
Method Summary
 com.sleepycat.collections.CurrentTransaction createCurrentTransaction(com.sleepycat.je.Environment env)
           
 com.sleepycat.je.Database createDatabase(com.sleepycat.je.Environment env, String name)
          Open the database, creating it if it doesn't exist.
 com.sleepycat.je.Environment createEnvironment(File envLocation)
          Open the environment, creating it if it doesn't exist.
 PreparableTransactionRunner createPreparableTransactionRunner(com.sleepycat.je.Environment env)
           
 com.sleepycat.bind.serial.StoredClassCatalog createStoredClassCatalog(com.sleepycat.je.Database catalogDb)
           
 com.sleepycat.collections.StoredMap createStoredMapViewOfDatabase(com.sleepycat.je.Database database, com.sleepycat.bind.serial.StoredClassCatalog classCatalog)
          create a StoredMap persisted by the database
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BdbjeResourceFactory

public BdbjeResourceFactory(BdbjeCacheStoreConfig config)
Method Detail

createPreparableTransactionRunner

public PreparableTransactionRunner createPreparableTransactionRunner(com.sleepycat.je.Environment env)
Returns:
PreparableTransactionRunner that will try to resolve deadlocks maximum of BdbjeCacheStoreConfig.getMaxTxRetries() times.

createCurrentTransaction

public com.sleepycat.collections.CurrentTransaction createCurrentTransaction(com.sleepycat.je.Environment env)

createEnvironment

public com.sleepycat.je.Environment createEnvironment(File envLocation)
                                               throws com.sleepycat.je.DatabaseException
Open the environment, creating it if it doesn't exist.

Parameters:
envLocation - base directory where the Environment will write files
Returns:
open Environment with a lock timeout of BdbjeCacheStoreConfig.getLockAcquistionTimeout() milliseconds.
Throws:
com.sleepycat.je.DatabaseException

createStoredClassCatalog

public com.sleepycat.bind.serial.StoredClassCatalog createStoredClassCatalog(com.sleepycat.je.Database catalogDb)
                                                                      throws com.sleepycat.je.DatabaseException
Throws:
com.sleepycat.je.DatabaseException

createDatabase

public com.sleepycat.je.Database createDatabase(com.sleepycat.je.Environment env,
                                                String name)
                                         throws com.sleepycat.je.DatabaseException
Open the database, creating it if it doesn't exist.

Returns:
open transactional Database
Throws:
com.sleepycat.je.DatabaseException

createStoredMapViewOfDatabase

public com.sleepycat.collections.StoredMap createStoredMapViewOfDatabase(com.sleepycat.je.Database database,
                                                                         com.sleepycat.bind.serial.StoredClassCatalog classCatalog)
                                                                  throws com.sleepycat.je.DatabaseException
create a StoredMap persisted by the database

Parameters:
database - where entries in the StoredMap are persisted
classCatalog - location to store class descriptions
Returns:
StoredMap backed by the database and classCatalog
Throws:
com.sleepycat.je.DatabaseException - if the StoredMap cannot be opened.


Copyright © 2009 JBoss, a division of Red Hat. All Rights Reserved.