org.infinispan.loaders.bdbje
Class BdbjeResourceFactory

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

public class BdbjeResourceFactory
extends Object

Factory that assembles objects specific to the SleepyCat JE API.

Since:
4.0
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, Properties environmentProperties)
          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<Object,InternalCacheEntry> createStoredMapViewOfDatabase(com.sleepycat.je.Database database, com.sleepycat.bind.serial.StoredClassCatalog classCatalog, StreamingMarshaller m)
          create a StoredMap persisted by the database
 com.sleepycat.collections.StoredSortedMap<Long,Object> createStoredSortedMapForKeyExpiry(com.sleepycat.je.Database database, com.sleepycat.bind.serial.StoredClassCatalog classCatalog, StreamingMarshaller marshaller)
          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,
                                                      Properties environmentProperties)
                                               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<Object,InternalCacheEntry> createStoredMapViewOfDatabase(com.sleepycat.je.Database database,
                                                                                                    com.sleepycat.bind.serial.StoredClassCatalog classCatalog,
                                                                                                    StreamingMarshaller m)
                                                                                             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.

createStoredSortedMapForKeyExpiry

public com.sleepycat.collections.StoredSortedMap<Long,Object> createStoredSortedMapForKeyExpiry(com.sleepycat.je.Database database,
                                                                                                com.sleepycat.bind.serial.StoredClassCatalog classCatalog,
                                                                                                StreamingMarshaller marshaller)
                                                                                         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 © 2011 JBoss, a division of Red Hat. All Rights Reserved.