// contain a valid backend implementation, then log an error and skip
// it.
String className = backendCfg.getJavaClass();
Class backendClass;
Backend backend;
try
{
backendClass = DirectoryServer.loadClass(className);
backend = (Backend) backendClass.newInstance();
}
catch (Exception e)
{
if (debugEnabled())
{
TRACER.debugCaught(DebugLogLevel.ERROR, e);
}
Message message = ERR_CONFIG_BACKEND_CANNOT_INSTANTIATE.
get(String.valueOf(className), String.valueOf(backendDN),
stackTraceToSingleLineString(e));
logError(message);
continue;
}
// If this backend is a configuration manager, then we don't want to do
// any more with it because the configuration will have already been
// started.
if (backend instanceof ConfigHandler)
{
continue;
}
// See if the entry contains an attribute that specifies the writability
// mode.
WritabilityMode writabilityMode = WritabilityMode.ENABLED;
BackendCfgDefn.WritabilityMode bwm =
backendCfg.getWritabilityMode();
switch (bwm)
{
case DISABLED:
writabilityMode = WritabilityMode.DISABLED;
break;
case ENABLED:
writabilityMode = WritabilityMode.ENABLED;
break;
case INTERNAL_ONLY:
writabilityMode = WritabilityMode.INTERNAL_ONLY;
break;
}
// Set the backend ID and writability mode for this backend.
backend.setBackendID(backendID);
backend.setWritabilityMode(writabilityMode);
// Acquire a shared lock on this backend. This will prevent operations
// like LDIF import or restore from occurring while the backend is
// active.