public override Lifecycle NewInstance(KernelContext context, Dependencies dependencies) { Config config = dependencies.Config; bool ephemeral = config.Get(GraphDatabaseSettings.ephemeral); FileSystemAbstraction fileSystemAbstraction = dependencies.FileSystem(); DirectoryFactory directoryFactory = directoryFactory(ephemeral); OperationalMode operationalMode = context.DatabaseInfo().OperationalMode; JobScheduler scheduler = dependencies.Scheduler(); IndexDirectoryStructure.Factory directoryStructureFactory = SubProviderDirectoryStructure(context.Directory()); TokenHolders tokenHolders = dependencies.TokenHolders(); Log log = dependencies.LogService.getInternalLog(typeof(FulltextIndexProvider)); AuxiliaryTransactionStateManager auxiliaryTransactionStateManager; try { auxiliaryTransactionStateManager = dependencies.AuxiliaryTransactionStateManager(); } catch (UnsatisfiedDependencyException e) { string message = "Fulltext indexes failed to register as transaction state providers. This means that, if queried, they will not be able to " + "uncommitted transactional changes into account. This is fine if the indexes are opened for non-transactional work, such as for " + "consistency checking. The reason given is: " + e.Message; LogDependencyException(context, log.ErrorLogger(), message); auxiliaryTransactionStateManager = new NullAuxiliaryTransactionStateManager(); } FulltextIndexProvider provider = new FulltextIndexProvider(Descriptor, directoryStructureFactory, fileSystemAbstraction, config, tokenHolders, directoryFactory, operationalMode, scheduler, auxiliaryTransactionStateManager, log); string procedureRegistrationFailureMessage = "Failed to register the fulltext index procedures. The fulltext index provider will be loaded and " + "updated like normal, but it might not be possible to query any fulltext indexes. The reason given is: "; try { dependencies.Procedures().registerComponent(typeof(FulltextAdapter), procContext => provider, true); dependencies.Procedures().registerProcedure(typeof(FulltextProcedures)); } catch (KernelException e) { string message = procedureRegistrationFailureMessage + e.getUserMessage(new NonTransactionalTokenNameLookup(tokenHolders)); // We use the 'warn' logger in this case, because it can occur due to multi-database shenanigans, or due to internal restarts in HA. // These scenarios are less serious, and will _probably_ not prevent FTS from working. Hence we only warn about this. LogDependencyException(context, log.WarnLogger(), message); } catch (UnsatisfiedDependencyException e) { string message = procedureRegistrationFailureMessage + e.Message; LogDependencyException(context, log.ErrorLogger(), message); } return(provider); }