Commit 8494f22a authored by Andre Freyssinet's avatar Andre Freyssinet

JMQ-240: Allows to stop an already stopped server without warning.

parent 2a80bade
/*
* Copyright (C) 2001 - 2020 ScalAgent Distributed Technologies
* Copyright (C) 2001 - 2021 ScalAgent Distributed Technologies
* Copyright (C) 2004 France Telecom R&D
* Copyright (C) 1996 - 2000 BULL
* Copyright (C) 1996 - 2000 INRIA
......@@ -1773,10 +1773,16 @@ public final class AgentServer {
logmon.log(BasicLevel.INFO, getName() + ", stop()");
synchronized(status) {
if ((status.value != Status.STARTED) &&
(status.value != Status.STOPPED)) {
if ((status.value == Status.STOPPED) || (status.value == Status.INSTALLED)) {
// The server is already stopped.
if (logmon.isLoggable(BasicLevel.DEBUG))
logmon.log(BasicLevel.DEBUG,
getName() + " not running, status: " + getStatusInfo(), new Exception());
return;
}
if (status.value != Status.STARTED) {
logmon.log(BasicLevel.WARN,
getName() + "cannot stop, bad status: " + getStatusInfo());
getName() + " cannot stop, bad status: " + getStatusInfo());
return;
}
status.value = Status.STOPPING;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment