Log on reconfig
@@ -42,6 +42,7 @@ import java.util.Map;
import java.util.Set;
import java.util.concurrent.ScheduledThreadPoolExecutor;
import java.util.concurrent.TimeUnit;
+import java.util.concurrent.atomic.AtomicInteger;
import java.util.logging.Level;
import java.util.logging.Logger;
@@ -79,7 +80,7 @@ public final class ConfiguredApplication implements Application {
new ComponentRegistry<>(),
new ComponentRegistry<>());
private final OsgiFramework restrictedOsgiFramework;
- private volatile int applicationSerialNo = 0;
+ private final AtomicInteger applicationSerialNo = new AtomicInteger(0);
private HandlersConfigurerDi configurer;
private ScheduledThreadPoolExecutor shutdownDeadlineExecutor;
private Thread reconfigurerThread;
@@ -172,10 +173,12 @@ public final class ConfiguredApplication implements Application {
startAndStopServers();
log.info("Switching to the latest deployed set of configurations and components. " +
- "Application switch number: " + (applicationSerialNo++));
+ "Application switch number: " + applicationSerialNo.getAndIncrement());
}
private ContainerBuilder createBuilderWithGuiceBindings() {
+ log.info("Initializing new set of configurations and components. " +
+ "Application switch number: " + applicationSerialNo.get());
ContainerBuilder builder = activator.newContainerBuilder();
setupGuiceBindings(builder.guiceModules());
return builder;
