use of org.neo4j.kernel.impl.util.UnsatisfiedDependencyException in project neo4j by neo4j.
the class OnlineBackupKernelExtension method stop.
@Override
public void stop() throws Throwable {
if (server != null) {
server.stop();
server.shutdown();
server = null;
try {
graphDatabaseAPI.getDependencyResolver().resolveDependency(ClusterMemberEvents.class).removeClusterMemberListener((ClusterMemberListener) startBindingListener);
graphDatabaseAPI.getDependencyResolver().resolveDependency(BindingNotifier.class).removeBindingListener((BindingListener) bindingListener);
ClusterMemberAvailability client = getClusterMemberAvailability();
client.memberIsUnavailable(BACKUP);
} catch (NoClassDefFoundError | UnsatisfiedDependencyException e) {
// Not running HA
}
}
}
use of org.neo4j.kernel.impl.util.UnsatisfiedDependencyException in project neo4j by neo4j.
the class KernelExtensions method init.
@Override
public void init() throws Throwable {
for (KernelExtensionFactory kernelExtensionFactory : kernelExtensionFactories) {
Object kernelExtensionDependencies = getKernelExtensionDependencies(kernelExtensionFactory);
try {
Lifecycle dependency = kernelExtensionFactory.newInstance(kernelContext, kernelExtensionDependencies);
Objects.requireNonNull(dependency, kernelExtensionFactory.toString() + " returned a null " + "KernelExtension");
life.add(dependencies.satisfyDependency(dependency));
} catch (UnsatisfiedDependencyException e) {
unsatisfiedDepencyStrategy.handle(kernelExtensionFactory, e);
}
}
life.init();
}
use of org.neo4j.kernel.impl.util.UnsatisfiedDependencyException in project neo4j by neo4j.
the class EnterpriseNeoServer method createWebServer.
@Override
protected WebServer createWebServer() {
Jetty9WebServer webServer = (Jetty9WebServer) super.createWebServer();
webServer.setJettyCreatedCallback((jetty) -> {
ThreadPool threadPool = jetty.getThreadPool();
assert threadPool != null;
try {
ServerThreadViewSetter setter = database.getGraph().getDependencyResolver().resolveDependency(ServerThreadViewSetter.class);
setter.set(new ServerThreadView() {
@Override
public int allThreads() {
return threadPool.getThreads();
}
@Override
public int idleThreads() {
return threadPool.getIdleThreads();
}
});
} catch (UnsatisfiedDependencyException ex) {
// nevermind, metrics are likely not enabled
}
});
return webServer;
}
Aggregations