use of org.neo4j.kernel.lifecycle.Lifecycle in project neo4j by neo4j.
the class Resources method managed.
public <T> T managed(T service) {
Lifecycle lifecycle = null;
if (service instanceof Lifecycle) {
lifecycle = (Lifecycle) service;
} else if (service instanceof AutoCloseable) {
lifecycle = new Closer((AutoCloseable) service);
}
life.add(lifecycle);
return service;
}
Aggregations