use of org.neo4j.exceptions.UnsatisfiedDependencyException in project neo4j by neo4j.
the class AbstractExtensions method init.
@Override
public void init() {
for (ExtensionFactory<?> extensionFactory : extensionFactories) {
try {
Object extensionDependencies = getExtensionDependencies(extensionFactory);
Lifecycle dependency = newInstance(extensionContext, extensionFactory, extensionDependencies);
Objects.requireNonNull(dependency, extensionFactory + " returned a null extension.");
life.add(dependencies.satisfyDependency(dependency));
} catch (UnsatisfiedDependencyException exception) {
extensionFailureStrategy.handle(extensionFactory, exception);
} catch (Throwable throwable) {
extensionFailureStrategy.handle(extensionFactory, throwable);
}
}
life.init();
}
use of org.neo4j.exceptions.UnsatisfiedDependencyException in project neo4j by neo4j.
the class LogFilesBuilder method buildContext.
TransactionLogFilesContext buildContext() throws IOException {
if (logEntryReader == null) {
requireNonNull(commandReaderFactory);
logEntryReader = new VersionAwareLogEntryReader(commandReaderFactory);
}
if (config == null) {
config = Config.defaults();
}
requireNonNull(fileSystem);
Supplier<StoreId> storeIdSupplier = getStoreId();
Supplier<LogVersionRepository> logVersionRepositorySupplier = getLogVersionRepositorySupplier();
LongSupplier lastCommittedIdSupplier = lastCommittedIdSupplier();
LongSupplier committingTransactionIdSupplier = committingIdSupplier();
Supplier<LogPosition> lastClosedTransactionPositionSupplier = closePositionSupplier();
// Register listener for rotation threshold
AtomicLong rotationThreshold = getRotationThresholdAndRegisterForUpdates();
AtomicBoolean tryPreallocateTransactionLogs = getTryToPreallocateTransactionLogs();
var nativeAccess = getNativeAccess();
var monitors = getMonitors();
var health = getDatabaseHealth();
var clock = getClock();
// Or the latest version if we can't find the system db version.
if (kernelVersionRepository == null) {
kernelVersionRepository = () -> KernelVersion.LATEST;
if (dependencies != null) {
try {
this.kernelVersionRepository = dependencies.resolveDependency(KernelVersionRepository.class);
} catch (UnsatisfiedDependencyException e) {
// Use latest version if can't find version repository.
}
}
}
return new TransactionLogFilesContext(rotationThreshold, tryPreallocateTransactionLogs, logEntryReader, lastCommittedIdSupplier, committingTransactionIdSupplier, lastClosedTransactionPositionSupplier, logVersionRepositorySupplier, fileSystem, logProvider, databaseTracers, storeIdSupplier, nativeAccess, memoryTracker, monitors, config.get(fail_on_corrupted_log_files), health, kernelVersionRepository, clock, config);
}
Aggregations