synchronized (directoryServer)
{
if (! isBootstrapped)
{
Message message = ERR_CANNOT_START_BEFORE_BOOTSTRAP.get();
throw new InitializationException(message);
}
if (isRunning)
{
Message message = ERR_CANNOT_START_WHILE_RUNNING.get();
throw new InitializationException(message);
}
logError(NOTE_DIRECTORY_SERVER_STARTING.get(getVersionString(),
BUILD_ID, REVISION_NUMBER));
// Acquire an exclusive lock for the Directory Server process.
if (! serverLocked)
{
String lockFile = LockFileManager.getServerLockFileName();
try
{
StringBuilder failureReason = new StringBuilder();
if (! LockFileManager.acquireExclusiveLock(lockFile, failureReason))
{
Message message = ERR_CANNOT_ACQUIRE_EXCLUSIVE_SERVER_LOCK.get(
lockFile, String.valueOf(failureReason));
throw new InitializationException(message);
}
serverLocked = true;
}
catch (InitializationException ie)
{
throw ie;
}
catch (Exception e)
{
if (debugEnabled())
{
TRACER.debugCaught(DebugLogLevel.ERROR, e);
}
Message message = ERR_CANNOT_ACQUIRE_EXCLUSIVE_SERVER_LOCK.get(
lockFile, stackTraceToSingleLineString(e));
throw new InitializationException(message, e);
}
}
// Mark the current time as the start time.
startUpTime = System.currentTimeMillis();
startTimeUTC = TimeThread.getGMTTime();
// Determine whether or not we should start the connection handlers.
boolean startConnectionHandlers =
(! environmentConfig.disableConnectionHandlers());
// Initialize all the schema elements.
initializeSchema();
// Initialize the plugin manager so that internal plugins can be
// registered.
pluginConfigManager.initializePluginConfigManager();
// Initialize all the virtual attribute handlers.
initializeVirtualAttributes();
// Initialize the core Directory Server configuration.
coreConfigManager = new CoreConfigManager();
coreConfigManager.initializeCoreConfig();
// Initialize the Directory Server crypto manager.
initializeCryptoManager();
// Initialize the log rotation policies.
rotationPolicyConfigManager = new LogRotationPolicyConfigManager();
rotationPolicyConfigManager.initializeLogRotationPolicyConfig();
// Initialize the log retention policies.
retentionPolicyConfigManager = new LogRetentionPolicyConfigManager();
retentionPolicyConfigManager.initializeLogRetentionPolicyConfig();
// Initialize the server loggers.
loggerConfigManager = new LoggerConfigManager();
loggerConfigManager.initializeLoggerConfig();
RuntimeInformation.logInfo();
// Initialize the server alert handlers.
initializeAlertHandlers();
// Initialize the default entry cache. We have to have one before
// <CODE>initializeBackends()</CODE> method kicks in further down.
entryCacheConfigManager = new EntryCacheConfigManager();
entryCacheConfigManager.initializeDefaultEntryCache();
// Initialize the administration connector.
if (startConnectionHandlers)
{
initializeAdministrationConnector();
}
// Initialize the key manager provider.
keyManagerProviderConfigManager = new KeyManagerProviderConfigManager();
keyManagerProviderConfigManager.initializeKeyManagerProviders();
// Initialize the extension.
extensionConfigManager = new ExtensionConfigManager();
extensionConfigManager.initializeExtensions();
// Initialize the trust manager provider.
trustManagerProviderConfigManager =
new TrustManagerProviderConfigManager();
trustManagerProviderConfigManager.initializeTrustManagerProviders();
// Initialize the certificate mapper.
certificateMapperConfigManager = new CertificateMapperConfigManager();
certificateMapperConfigManager.initializeCertificateMappers();
// Initialize the identity mappers.
initializeIdentityMappers();
// Initialize the root DNs.
rootDNConfigManager = new RootDNConfigManager();
rootDNConfigManager.initializeRootDNs();
// Initialize the subentry manager.
initializeSubentryManager();
// Initialize the group manager.
initializeGroupManager();
// Initialize the access control handler.
AccessControlConfigManager.getInstance().initializeAccessControl();
// Initialize all the backends and their associated suffixes
// and initialize the workflows when workflow configuration mode
// is auto.
initializeBackends();
// When workflow configuration mode is manual, do configure the
// workflows now, else just configure the remaining workflows
// (rootDSE and config backend).
if (workflowConfigurationModeIsAuto())
{
createAndRegisterRemainingWorkflows();
}
else
{
configureWorkflowsManual();
}
// Check for and initialize user configured entry cache if any,
// if not stick with default entry cache initialized earlier.
entryCacheConfigManager.initializeEntryCache();
// Reset the map as we can no longer guarantee offline state.
directoryServer.offlineBackendsStateIDs.clear();
// Register the supported controls and supported features.
initializeSupportedControls();
initializeSupportedFeatures();
// Initialize all the extended operation handlers.
initializeExtendedOperations();
// Initialize all the SASL mechanism handlers.
initializeSASLMechanisms();
// Initialize all the connection handlers
// (including the administration connector).
if (startConnectionHandlers)
{
initializeConnectionHandlers();
}
// Initialize all the monitor providers.
monitorConfigManager = new MonitorConfigManager();
monitorConfigManager.initializeMonitorProviders();
// Initialize all the password policy components.
initializePasswordPolicyComponents();
// Load and initialize the user plugins.
pluginConfigManager.initializeUserPlugins(null);
// Initialize any synchronization providers that may be defined.
if (!environmentConfig.disableSynchronization())
{
synchronizationProviderConfigManager =
new SynchronizationProviderConfigManager();
synchronizationProviderConfigManager
.initializeSynchronizationProviders();
}
// Create and initialize the work queue.
workQueue = new WorkQueueConfigManager().initializeWorkQueue();
// Invoke the startup plugins.
PluginResult.Startup startupPluginResult =
pluginConfigManager.invokeStartupPlugins();
if (! startupPluginResult.continueProcessing())
{
Message message = ERR_STARTUP_PLUGIN_ERROR.
get(startupPluginResult.getErrorMessage(),
startupPluginResult.getErrorMessage().getDescriptor().getId());
throw new InitializationException(message);
}
// Notify all the initialization completed listeners.
for (InitializationCompletedListener initializationCompletedListener :
directoryServer.initializationCompletedListeners)