mirror of
https://github.com/apache/activemq-artemis.git
synced 2025-03-06 09:20:07 +00:00
This closes #1559
This commit is contained in:
commit
341ecd4d1a
@ -64,7 +64,7 @@ public class CriticalAnalyzerImpl implements CriticalAnalyzer {
|
||||
|
||||
@Override
|
||||
public CriticalAnalyzer setCheckTime(long timeout, TimeUnit unit) {
|
||||
this.checkTimeNanoSeconds = timeout;
|
||||
this.checkTimeNanoSeconds = unit.toNanos(timeout);
|
||||
return this;
|
||||
}
|
||||
|
||||
@ -147,6 +147,7 @@ public class CriticalAnalyzerImpl implements CriticalAnalyzer {
|
||||
// this means that the server has been stopped as we could acquire the semaphore... returning now
|
||||
break;
|
||||
}
|
||||
logger.trace("Checking critical analyzer");
|
||||
check();
|
||||
}
|
||||
} catch (InterruptedException interrupted) {
|
||||
|
@ -322,8 +322,7 @@ public class ActiveMQServerImpl implements ActiveMQServer {
|
||||
|
||||
private final ActiveMQServer parentServer;
|
||||
|
||||
|
||||
private final CriticalAnalyzer analyzer;
|
||||
private CriticalAnalyzer analyzer;
|
||||
|
||||
//todo think about moving this to the activation
|
||||
private final List<SimpleString> scaledDownNodeIDs = new ArrayList<>();
|
||||
@ -435,12 +434,6 @@ public class ActiveMQServerImpl implements ActiveMQServer {
|
||||
this.parentServer = parentServer;
|
||||
|
||||
this.serviceRegistry = serviceRegistry == null ? new ServiceRegistryImpl() : serviceRegistry;
|
||||
|
||||
if (configuration.isCriticalAnalyzer()) {
|
||||
this.analyzer = new CriticalAnalyzerImpl();
|
||||
} else {
|
||||
this.analyzer = EmptyCriticalAnalyzer.getInstance();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -573,6 +566,14 @@ public class ActiveMQServerImpl implements ActiveMQServer {
|
||||
}
|
||||
|
||||
private void initializeCriticalAnalyzer() throws Exception {
|
||||
if (analyzer == null) {
|
||||
if (configuration.isCriticalAnalyzer()) {
|
||||
this.analyzer = new CriticalAnalyzerImpl();
|
||||
} else {
|
||||
this.analyzer = EmptyCriticalAnalyzer.getInstance();
|
||||
}
|
||||
}
|
||||
|
||||
/** Calling this for cases where the server was stopped and now is being restarted... failback, etc...*/
|
||||
this.analyzer.clear();
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user