Remove yang-test
[controller.git] / opendaylight / config / config-manager / src / main / java / org / opendaylight / controller / config / manager / impl / osgi / BlankTransactionServiceTracker.java
index a15820556c4a9a76ac45f80ccf89a317df646d53..2649b145d0509badbcd88897ca99a83282bed6b5 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013 Cisco Systems, Inc. and others.  All rights reserved.
+ * Copyright (c) 2013, 2017 Cisco Systems, Inc. and others.  All rights reserved.
  *
  * This program and the accompanying materials are made available under the
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
@@ -23,9 +23,8 @@ import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
 /**
- * Every time factory is added or removed, blank transaction is triggered to handle
- * {@link org.opendaylight.controller.config.spi.ModuleFactory#getDefaultModules(org.opendaylight.controller.config.api.DependencyResolverFactory, org.osgi.framework.BundleContext)}
- * functionality.
+ * Every time factory is added or removed, blank transaction is triggered to
+ * handle.
  */
 public class BlankTransactionServiceTracker implements ServiceTrackerCustomizer<ModuleFactory, Object> {
     private static final Logger LOG = LoggerFactory.getLogger(BlankTransactionServiceTracker.class);
@@ -40,12 +39,12 @@ public class BlankTransactionServiceTracker implements ServiceTrackerCustomizer<
         this(() -> {
             ObjectName tx = configRegistry.beginConfig(true);
             return configRegistry.commitConfig(tx);
-         });
+        });
     }
 
     public BlankTransactionServiceTracker(final BlankTransaction blankTransaction) {
-        this(blankTransaction, DEFAULT_MAX_ATTEMPTS, Executors.newSingleThreadExecutor(new ThreadFactoryBuilder()
-                .setNameFormat("config-blank-txn-%d").build()));
+        this(blankTransaction, DEFAULT_MAX_ATTEMPTS, Executors
+                .newSingleThreadExecutor(new ThreadFactoryBuilder().setNameFormat("config-blank-txn-%d").build()));
     }
 
     @VisibleForTesting
@@ -57,7 +56,7 @@ public class BlankTransactionServiceTracker implements ServiceTrackerCustomizer<
     }
 
     @Override
-    public Object addingService(ServiceReference<ModuleFactory> moduleFactoryServiceReference) {
+    public Object addingService(final ServiceReference<ModuleFactory> moduleFactoryServiceReference) {
         blankTransactionAsync();
         return null;
     }
@@ -67,7 +66,8 @@ public class BlankTransactionServiceTracker implements ServiceTrackerCustomizer<
     }
 
     void blankTransactionSync() {
-        // race condition check: config-persister might push new configuration while server is starting up.
+        // race condition check: config-persister might push new configuration while
+        // server is starting up.
         ConflictingVersionException lastException = null;
         for (int i = 0; i < maxAttempts; i++) {
             try {
@@ -75,16 +75,16 @@ public class BlankTransactionServiceTracker implements ServiceTrackerCustomizer<
                 CommitStatus commitStatus = blankTransaction.hit();
                 LOG.debug("Committed blank transaction with status {}", commitStatus);
                 return;
-            } catch (ConflictingVersionException e) {
+            } catch (final ConflictingVersionException e) {
                 lastException = e;
                 try {
                     Thread.sleep(1000);
-                } catch (InterruptedException interruptedException) {
+                } catch (final InterruptedException interruptedException) {
                     Thread.currentThread().interrupt();
                     LOG.debug("blankTransactionSync was interrupted");
                     return;
                 }
-            } catch (ValidationException e) {
+            } catch (final ValidationException e) {
                 LOG.error("Validation exception while running blank transaction indicates programming error", e);
             }
         }
@@ -94,12 +94,14 @@ public class BlankTransactionServiceTracker implements ServiceTrackerCustomizer<
     }
 
     @Override
-    public void modifiedService(ServiceReference <ModuleFactory> moduleFactoryServiceReference, Object o) {
+    public void modifiedService(final ServiceReference<ModuleFactory> moduleFactoryServiceReference,
+            final Object object) {
         blankTransactionAsync();
     }
 
     @Override
-    public void removedService(ServiceReference<ModuleFactory> moduleFactoryServiceReference, Object o) {
+    public void removedService(final ServiceReference<ModuleFactory> moduleFactoryServiceReference,
+            final Object object) {
         blankTransactionAsync();
     }