Scheduler scheduler)
{
super(accessCoordinator, logger, abortLogger);
logger.log(
Level.CONFIG, "Creating DataStoreImpl properties:{0}", properties);
PropertiesWrapper wrappedProps = new PropertiesWrapper(properties);
String specifiedDirectory =
wrappedProps.getProperty(DIRECTORY_PROPERTY);
if (specifiedDirectory == null) {
String rootDir =
properties.getProperty(StandardProperties.APP_ROOT);
if (rootDir == null) {
throw new IllegalArgumentException(
"A value for the property " + StandardProperties.APP_ROOT +
" must be specified");
}
specifiedDirectory = rootDir + File.separator + DEFAULT_DIRECTORY;
}
/*
* Use an absolute path to avoid problems on Windows.
* -tjb@sun.com (02/16/2007)
*/
directory = new File(specifiedDirectory).getAbsolutePath();
txnInfoTable = getTxnInfoTable(TxnInfo.class);
DbTransaction dbTxn = null;
boolean done = false;
try {
File directoryFile = new File(specifiedDirectory).getAbsoluteFile();
if (!directoryFile.exists()) {
logger.log(Level.INFO, "Creating database directory : " +
directoryFile.getAbsolutePath());
if (!directoryFile.mkdirs()) {
throw new DataStoreException("Unable to create database " +
"directory : " +
directoryFile.getName());
}
}
env = wrappedProps.getClassInstanceProperty(
ENVIRONMENT_CLASS_PROPERTY,
DEFAULT_ENVIRONMENT_CLASS,
DbEnvironment.class,
new Class<?>[]{
String.class, Properties.class, Scheduler.class