@Test public void close() throws Exception { setClusterHealth(true); watchdogInstance.instantiateServiceInstance(); watchdogInstance.close(); setClusterHealth(false); Mockito.timeout(TIMEOUT); Mockito.verify(singletonService, Mockito.never()).closeServiceInstance(); Mockito.verify(serviceRegistration).close(); }
@Override public synchronized void close() throws Exception { if (clusterServiceRegistration != null) { clusterServiceRegistration.close(); clusterServiceRegistration = null; } else { return; } scheduledExecutorService.shutdown(); datastoreAccess.close(); timer.cancel(true); }
ClusterSanityWatchdogInstance implements AutoCloseable, ClusterSingletonService { @Override public synchronized void close() throws Exception { if (clusterServiceRegistration != null) { clusterServiceRegistration.close(); clusterServiceRegistration = null; } else { return; } scheduledExecutorService.shutdown(); datastoreAccess.close(); timer.cancel(true); } }
ClusterSanityWatchdogInstance implements AutoCloseable, ClusterSingletonService { @Override public synchronized void close() throws Exception { if (clusterServiceRegistration != null) { clusterServiceRegistration.close(); clusterServiceRegistration = null; } else { return; } scheduledExecutorService.shutdown(); datastoreAccess.close(); timer.cancel(true); } ClusterSanityWatchdogInstance(final DataBroker broker,
            final ClusterSingletonServiceProvider clusterSingletonServiceProvider, final int period,
            final int failLimit); }
ClusterSanityWatchdogInstance implements AutoCloseable, ClusterSingletonService { @Override public synchronized void close() throws Exception { if (clusterServiceRegistration != null) { clusterServiceRegistration.close(); clusterServiceRegistration = null; } else { return; } scheduledExecutorService.shutdown(); datastoreAccess.close(); timer.cancel(true); } ClusterSanityWatchdogInstance(final DataBroker broker,
            final ClusterSingletonServiceProvider clusterSingletonServiceProvider, final int period,
            final int failLimit); @Override synchronized void close(); void setServices(List<ClusterSingletonService> services); @Override synchronized void instantiateServiceInstance(); @Override synchronized ListenableFuture<Void> closeServiceInstance(); @Override ServiceGroupIdentifier getIdentifier(); }
ClusterSanityWatchdogInstance implements AutoCloseable, ClusterSingletonService { @Override public synchronized void close() throws Exception { if (clusterServiceRegistration != null) { clusterServiceRegistration.close(); clusterServiceRegistration = null; } else { return; } scheduledExecutorService.shutdown(); datastoreAccess.close(); timer.cancel(true); } ClusterSanityWatchdogInstance(final DataBroker broker,
            final ClusterSingletonServiceProvider clusterSingletonServiceProvider, final int period,
            final int failLimit); @Override synchronized void close(); void setServices(List<ClusterSingletonService> services); @Override synchronized void instantiateServiceInstance(); @Override synchronized ListenableFuture<Void> closeServiceInstance(); @Override ServiceGroupIdentifier getIdentifier();  }