@Test public void instantiateServiceInstance() throws Exception { Mockito.when(dataBroker.registerDataTreeChangeListener(SxpClusterRouteManager.ROUTING_DEFINITION_DT_IDENTIFIER, manager)).thenReturn(listenerRegistration); manager.init(); Assert.assertEquals(RouteListenerState.STOPPED, manager.getState()); manager.instantiateServiceInstance(); Mockito.verify(dataBroker) .registerDataTreeChangeListener(SxpClusterRouteManager.ROUTING_DEFINITION_DT_IDENTIFIER, manager); Mockito.verify(cssProvider).registerClusterSingletonService(manager); Assert.assertEquals(RouteListenerState.BEFORE_FIRST, manager.getState()); }
@Override public void instantiateServiceInstance() { LOG.info("Instantiating {}", this.getClass().getSimpleName()); synchronized (stateLock) { state = RouteListenerState.BEFORE_FIRST; routingDefinitionListenerRegistration = dataBroker.registerDataTreeChangeListener(ROUTING_DEFINITION_DT_IDENTIFIER, this); } }
SxpClusterRouteManager implements ClusteredDataTreeChangeListener<SxpClusterRoute>, ClusterSingletonService, AutoCloseable { @Override public void instantiateServiceInstance() { LOG.info("Instantiating {}", this.getClass().getSimpleName()); synchronized (stateLock) { state = RouteListenerState.BEFORE_FIRST; routingDefinitionListenerRegistration = dataBroker.registerDataTreeChangeListener(ROUTING_DEFINITION_DT_IDENTIFIER, this); } } }
SxpClusterRouteManager implements ClusteredDataTreeChangeListener<SxpClusterRoute>, ClusterSingletonService, AutoCloseable { @Override public void instantiateServiceInstance() { LOG.info("Instantiating {}", this.getClass().getSimpleName()); synchronized (stateLock) { state = RouteListenerState.BEFORE_FIRST; routingDefinitionListenerRegistration = dataBroker.registerDataTreeChangeListener(ROUTING_DEFINITION_DT_IDENTIFIER, this); } } SxpClusterRouteManager(final DataBroker dataBroker, final ClusterSingletonServiceProvider cssProvider,
            final RouteReactor routeReactor); }
SxpClusterRouteManager implements ClusteredDataTreeChangeListener<SxpClusterRoute>, ClusterSingletonService, AutoCloseable { @Override public void instantiateServiceInstance() { LOG.info("Instantiating {}", this.getClass().getSimpleName()); synchronized (stateLock) { state = RouteListenerState.BEFORE_FIRST; routingDefinitionListenerRegistration = dataBroker.registerDataTreeChangeListener(ROUTING_DEFINITION_DT_IDENTIFIER, this); } } SxpClusterRouteManager(final DataBroker dataBroker, final ClusterSingletonServiceProvider cssProvider,
            final RouteReactor routeReactor); void init(); @Override void onDataTreeChanged(@Nonnull Collection<DataTreeModification<SxpClusterRoute>> changes); @Override ServiceGroupIdentifier getIdentifier(); @Override void instantiateServiceInstance(); @Override ListenableFuture<Void> closeServiceInstance(); @Override void close(); }
SxpClusterRouteManager implements ClusteredDataTreeChangeListener<SxpClusterRoute>, ClusterSingletonService, AutoCloseable { @Override public void instantiateServiceInstance() { LOG.info("Instantiating {}", this.getClass().getSimpleName()); synchronized (stateLock) { state = RouteListenerState.BEFORE_FIRST; routingDefinitionListenerRegistration = dataBroker.registerDataTreeChangeListener(ROUTING_DEFINITION_DT_IDENTIFIER, this); } } SxpClusterRouteManager(final DataBroker dataBroker, final ClusterSingletonServiceProvider cssProvider,
            final RouteReactor routeReactor); void init(); @Override void onDataTreeChanged(@Nonnull Collection<DataTreeModification<SxpClusterRoute>> changes); @Override ServiceGroupIdentifier getIdentifier(); @Override void instantiateServiceInstance(); @Override ListenableFuture<Void> closeServiceInstance(); @Override void close();  }