@Override public void close() { Lifecycles.stop(this); }
/** * Stop given component if it implements {@link Lifecycle} or {@link LifecycleAware}. * * @see #stop(Lifecycle) * @see #stop(LifecycleAware) */ public static void stop(final Object component) { if (component instanceof Lifecycle) { stop((Lifecycle)component); } else if (component instanceof LifecycleAware) { stop((LifecycleAware) component); } else { log.warn("Unable to stop component; not a lifecycle: {}", component); } } }
/** * Stop given lifecycle-aware and propagate exceptions. * * @see #stop(Lifecycle) */ public static void stop(final LifecycleAware component) { checkNotNull(component); stop(component.getLifecycle()); }
@Override protected void doStop() throws Exception { Lifecycles.stop(databaseManager.get()); databaseServer.get().stop(); nodeAccess.stop(); }