You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@unomi.apache.org by sh...@apache.org on 2022/02/21 15:39:17 UTC
[unomi] branch unomi-1.6.x updated: Attempt to fix issue with release:prepare locking Unomi startup.
This is an automated email from the ASF dual-hosted git repository.
shuber pushed a commit to branch unomi-1.6.x
in repository https://gitbox.apache.org/repos/asf/unomi.git
The following commit(s) were added to refs/heads/unomi-1.6.x by this push:
new 86a208c Attempt to fix issue with release:prepare locking Unomi startup.
86a208c is described below
commit 86a208c43b798aa4e7b46407ce65d58872fad563
Author: Serge Huber <sh...@jahia.com>
AuthorDate: Mon Feb 21 16:39:10 2022 +0100
Attempt to fix issue with release:prepare locking Unomi startup.
---
.../src/main/java/org/apache/unomi/lifecycle/BundleWatcher.java | 9 ++++-----
1 file changed, 4 insertions(+), 5 deletions(-)
diff --git a/lifecycle-watcher/src/main/java/org/apache/unomi/lifecycle/BundleWatcher.java b/lifecycle-watcher/src/main/java/org/apache/unomi/lifecycle/BundleWatcher.java
index 98f058f..16e3edf 100644
--- a/lifecycle-watcher/src/main/java/org/apache/unomi/lifecycle/BundleWatcher.java
+++ b/lifecycle-watcher/src/main/java/org/apache/unomi/lifecycle/BundleWatcher.java
@@ -37,10 +37,7 @@ import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.TimerTask;
-import java.util.concurrent.Executors;
-import java.util.concurrent.ScheduledExecutorService;
-import java.util.concurrent.ScheduledFuture;
-import java.util.concurrent.TimeUnit;
+import java.util.concurrent.*;
import java.util.stream.Collectors;
/**
@@ -69,7 +66,7 @@ public class BundleWatcher implements SynchronousBundleListener, ServiceListener
private Integer checkStartupStateRefreshInterval = 60;
public void setRequiredBundles(Map<String, Boolean> requiredBundles) {
- this.requiredBundles = requiredBundles;
+ this.requiredBundles = new ConcurrentHashMap<>(requiredBundles);
}
public void setCheckStartupStateRefreshInterval(Integer checkStartupStateRefreshInterval) {
@@ -133,6 +130,7 @@ public class BundleWatcher implements SynchronousBundleListener, ServiceListener
break;
case BundleEvent.STARTED:
if (event.getBundle().getSymbolicName().startsWith("org.apache.unomi")) {
+ logger.info("Bundle {} was started.", event.getBundle().getSymbolicName());
requiredBundles.put(event.getBundle().getSymbolicName(), true);
checkStartupComplete();
}
@@ -141,6 +139,7 @@ public class BundleWatcher implements SynchronousBundleListener, ServiceListener
break;
case BundleEvent.STOPPED:
if (event.getBundle().getSymbolicName().startsWith("org.apache.unomi")) {
+ logger.info("Bundle {} was stopped", event.getBundle().getSymbolicName());
requiredBundles.put(event.getBundle().getSymbolicName(), false);
}
break;