Package com.tangosol.io.bdb
Class DatabaseFactory
java.lang.Object
com.tangosol.util.Base
com.tangosol.io.bdb.DatabaseFactory
Factory for Berkeley DB Environments and Databases.
 
Temporary Environments will be automatically deleted upon JVM shutdown or GC.
- Author:
- mf 2005.10.04
- 
Nested Class SummaryNested ClassesModifier and TypeClassDescriptionprotected static classHolder for Berkeley DB Environment and its Databases.Nested classes/interfaces inherited from class com.tangosol.util.BaseBase.LoggingWriter
- 
Field SummaryFieldsModifier and TypeFieldDescriptionprotected longCounter used to generate unique Database names for this Environment.protected com.sleepycat.je.DatabaseConfigConfiguration to use when creating new Databases.protected DatabaseFactory.EnvironmentHolderHolder for Environment used to create Databases.
- 
Constructor SummaryConstructorsConstructorDescriptionDatabaseFactory(BerkeleyDBBinaryStoreManager bdbManager) Construct a DatabaseFactory for a given Berkeley DB Environment.
- 
Method SummaryModifier and TypeMethodDescriptioncom.sleepycat.je.DatabasecreateNamedDatabase(String sName) Create a named Database instance.protected voidfinalize()Finalize for the DatabaseFactory.voidforgetDatabase(com.sleepycat.je.Database db) Remove a database handle from the cleanup list.com.sleepycat.je.DatabaseConfigGet the DatabaseConfiguration used to create Databases.longGet the DB ID Counter value.Get the EnvironmentHolder.Get a unique (within the Factory) database name.protected DatabaseFactory.EnvironmentHolderinstantiateEnvironment(BerkeleyDBBinaryStoreManager bdbManager) Create a EnvironmentHolder within the specified parent directory.toString()Output the DatabaseFactory state as a String.Methods inherited from class com.tangosol.util.Baseazzert, azzert, azzert, azzertFailed, breakLines, breakLines, capitalize, checkNotEmpty, checkNotNull, checkRange, computeSafeWaitTime, decimalValue, dup, dup, ensureBigDecimal, ensureClassLoader, ensureRuntimeException, ensureRuntimeException, equals, equalsDeep, err, err, err, err, err, escape, formatDateTime, getCallerStackFrame, getCommonMonitor, getCommonMonitor, getCommonMonitor, getContextClassLoader, getContextClassLoader, getDeepMessage, getErr, getLastSafeTimeMillis, getLog, getMaxDecDigits, getMaxHexDigits, getOriginalException, getOut, getProcessRandom, getRandom, getRandomBinary, getRandomBinary, getRandomString, getSafeTimeMillis, getStackFrame, getStackFrames, getStackTrace, getStackTrace, getStackTrace, getThreadFactory, getTimeZone, getUpTimeMillis, hashCode, hexValue, indentString, indentString, isDecimal, isHex, isLogEcho, isOctal, log, log, log, log, log, makeInteger, makeLong, makeThread, mergeArray, mergeBooleanArray, mergeByteArray, mergeCharArray, mergeDoubleArray, mergeFloatArray, mergeIntArray, mergeLongArray, mod, mod, newHashMap, newHashMap, newHashSet, newHashSet, octalValue, out, out, out, out, out, pad, parseBandwidth, parseBandwidth, parseDelimitedString, parseHex, parseHex, parseMemorySize, parseMemorySize, parsePercentage, parseTime, parseTime, parseTimeNanos, parseTimeNanos, printStackTrace, randomize, randomize, randomize, randomize, read, read, read, read, read, read, read, replace, setErr, setLog, setLogEcho, setOut, sleep, toBandwidthString, toBandwidthString, toCharEscape, toCrc, toCrc, toCrc, toCrc, toCrc, toDecString, toDelimitedString, toDelimitedString, toDelimitedString, toDelimitedString, toHex, toHex, toHexDump, toHexEscape, toHexEscape, toHexEscape, toHexEscape, toHexString, toMemorySizeString, toMemorySizeString, toQuotedCharEscape, toQuotedStringEscape, toSqlString, toString, toString, toStringEscape, toUnicodeEscape, trace, trace, trace, trace, trace, trace, trace, trace, trace, truncateString, truncateString, wait
- 
Field Details- 
m_envHolderHolder for Environment used to create Databases.
- 
m_dbConfigprotected com.sleepycat.je.DatabaseConfig m_dbConfigConfiguration to use when creating new Databases.
- 
m_cDbIdprotected long m_cDbIdCounter used to generate unique Database names for this Environment.
 
- 
- 
Constructor Details- 
DatabaseFactorypublic DatabaseFactory(BerkeleyDBBinaryStoreManager bdbManager) throws com.sleepycat.je.DatabaseException Construct a DatabaseFactory for a given Berkeley DB Environment.Berkeley DB Environments are bound to a single directory. Java File locking is used to ensure that only one JVM uses the Environment. - Parameters:
- bdbManager- the BinaryStoreManager to create Databases for
- Throws:
- com.sleepycat.je.DatabaseException- if the Berkeley DB Environment could not be created
- See Also:
 
 
- 
- 
Method Details- 
toStringOutput the DatabaseFactory state as a String.
- 
finalizeFinalize for the DatabaseFactory.When the factory is finalized it will force the EnvironmentHolder to be destroyed if it is temporary, and deregister the associated shutdown hook. 
- 
createNamedDatabasepublic com.sleepycat.je.Database createNamedDatabase(String sName) throws com.sleepycat.je.DatabaseException Create a named Database instance.- Parameters:
- sName- the name of the database to create
- Returns:
- new a Database instance
- Throws:
- com.sleepycat.je.DatabaseException- if the Database creation failed
 
- 
getUniqueDbNameGet a unique (within the Factory) database name.- Returns:
- a unique database name
 
- 
instantiateEnvironmentprotected DatabaseFactory.EnvironmentHolder instantiateEnvironment(BerkeleyDBBinaryStoreManager bdbManager) throws com.sleepycat.je.DatabaseException Create a EnvironmentHolder within the specified parent directory.- Parameters:
- bdbManager- the BinaryStore to create the environment for
- Returns:
- a new EnvironmentHolder
- Throws:
- com.sleepycat.je.DatabaseException- if the Environment could not be created
 
- 
forgetDatabasepublic void forgetDatabase(com.sleepycat.je.Database db) Remove a database handle from the cleanup list.- Parameters:
- db- the Database to remove from list
 
- 
getEnvHolderGet the EnvironmentHolder.- Returns:
- the EnvironmentHolder
 
- 
getDbConfigpublic com.sleepycat.je.DatabaseConfig getDbConfig()Get the DatabaseConfiguration used to create Databases.- Returns:
- the DatabaseConfiguration
 
- 
getDbIdCounterpublic long getDbIdCounter()Get the DB ID Counter value.- Returns:
- the DB ID Counter value
 
 
-