public class BerkeleyDBBinaryStoreManager extends Base implements BinaryStoreManager, XmlConfigurable
The usage pattern for BinaryStoreManagers is simply to instantiate them, use them to allocate a single BinaryStore instance, and forget about them. This implementation maintains knowledge of previously created Berkeley DB Environments via a static DatabaseFactoryManager, thus ensuring a minimum number of Environments are created, regardless of the life-cycle of the BinaryStoreManager.
Base.LoggingWriter, Base.StackFrame
Modifier and Type | Field and Description |
---|---|
protected File |
m_dirParent
Parent directory for creating Environments.
|
protected boolean |
m_fTemporary
Flag indicating if this store manages temporary data.
|
protected String |
m_sDbName
Database name, used for persistent stores.
|
protected XmlElement |
m_xmlConfig
Stored configuration for this Manager.
|
Constructor and Description |
---|
BerkeleyDBBinaryStoreManager()
Default constructor.
|
BerkeleyDBBinaryStoreManager(File dirParent,
String sDbName)
Construct a Berkeley DB BinaryStoreManager for the specified directory.
|
Modifier and Type | Method and Description |
---|---|
BinaryStore |
createBinaryStore()
Factory method: Returns a new BinaryStore.
|
void |
destroyBinaryStore(BinaryStore store)
Destroy a BinaryStore previously created by this manager.
|
boolean |
equals(Object that)
Compares two BerkeleyDBBinaryStoreManagers for equality.
|
XmlElement |
getConfig()
Retrieve the manager's configuration.
|
static DatabaseFactoryManager |
getFactoryManager()
Get the DatabaseFactoryManager.
|
File |
getParentDirectory()
Get the configured parent directory.
|
int |
hashCode()
Computes the hash code of the BerkeleyDBBinaryStoreManager.
|
boolean |
isTemporary()
Return true if this is a manager for temporary stores.
|
void |
setConfig(XmlElement xmlConfig)
Specify the manager's configuration.
|
String |
toString()
Return a human readable description of the BinaryStoreManager.
|
azzert, 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, getThreadFactory, getTimeZone, getUpTimeMillis, hashCode, hexValue, indentString, indentString, isDecimal, isHex, isLogEcho, isOctal, log, log, log, log, log, makeInteger, makeLong, makeThread, mod, mod, 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
protected XmlElement m_xmlConfig
protected File m_dirParent
protected String m_sDbName
protected boolean m_fTemporary
public BerkeleyDBBinaryStoreManager()
The temporary Environment directory will be placed under $tmp/coherence/bdb, where $tmp is the system defined temp directory.
Configuration is performed via XmlConfigurable interface.
public BerkeleyDBBinaryStoreManager(File dirParent, String sDbName)
A temporary directory will be created beneath the specified parent directory, for use by the Berkeley Environment.
Additional configuration is performed via XmlConfigurable interface.
dirParent
- the parent directory for the EnvironmentsDbName
- the name of the database to store the cache's data
within. This value is only specified when using
a persistent store.setConfig(com.tangosol.run.xml.XmlElement)
public String toString()
public boolean equals(Object that)
Two instances are considered to be equal if their underlying configuration is identical, or if they have reference equality.
public int hashCode()
The hash code is computed as the sum of the hash codes of the Objects making up the BerkeleyDBBinaryStoreManager's configuration.
public BinaryStore createBinaryStore()
createBinaryStore
in interface BinaryStoreManager
public void destroyBinaryStore(BinaryStore store)
destroyBinaryStore
in interface BinaryStoreManager
store
- a BinaryStore object previously created by this managerpublic XmlElement getConfig()
getConfig
in interface XmlConfigurable
public void setConfig(XmlElement xmlConfig)
Any configuration setting prefixed with je. will be passed through to Berkeley DB Configuration.
setConfig
in interface XmlConfigurable
xmlConfig
- the new configurationpublic static DatabaseFactoryManager getFactoryManager()
This manager is used to find pre-existing DatabaseFactory objects.
public File getParentDirectory()
This is the directory in which Berkeley DB Environment sub-directories will be created.
public boolean isTemporary()