This commit is contained in:
@@ -1149,6 +1149,13 @@ public final class Application {
|
|||||||
}
|
}
|
||||||
logger.info("MessageAgent(names=" + JsonConvert.root().convertTo(names) + ") stop in " + (System.currentTimeMillis() - s) + " ms");
|
logger.info("MessageAgent(names=" + JsonConvert.root().convertTo(names) + ") stop in " + (System.currentTimeMillis() - s) + " ms");
|
||||||
}
|
}
|
||||||
|
if (clusterAgent != null) {
|
||||||
|
if (logger.isLoggable(Level.FINER)) logger.log(Level.FINER, "ClusterAgent destroying");
|
||||||
|
long s = System.currentTimeMillis();
|
||||||
|
clusterAgent.deregister(this);
|
||||||
|
clusterAgent.destroy(clusterAgent.getConfig());
|
||||||
|
logger.info("ClusterAgent destroy in " + (System.currentTimeMillis() - s) + " ms");
|
||||||
|
}
|
||||||
localServers.stream().forEach((server) -> {
|
localServers.stream().forEach((server) -> {
|
||||||
try {
|
try {
|
||||||
server.shutdown();
|
server.shutdown();
|
||||||
@@ -1158,13 +1165,6 @@ public final class Application {
|
|||||||
serversLatch.countDown();
|
serversLatch.countDown();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
if (clusterAgent != null) {
|
|
||||||
if (logger.isLoggable(Level.FINER)) logger.log(Level.FINER, "ClusterAgent destroying");
|
|
||||||
long s = System.currentTimeMillis();
|
|
||||||
clusterAgent.deregister(this);
|
|
||||||
clusterAgent.destroy(clusterAgent.getConfig());
|
|
||||||
logger.info("ClusterAgent destroy in " + (System.currentTimeMillis() - s) + " ms");
|
|
||||||
}
|
|
||||||
if (this.messageAgents != null) {
|
if (this.messageAgents != null) {
|
||||||
Set<String> names = new HashSet<>();
|
Set<String> names = new HashSet<>();
|
||||||
if (logger.isLoggable(Level.FINER)) logger.log(Level.FINER, "MessageAgent destroying");
|
if (logger.isLoggable(Level.FINER)) logger.log(Level.FINER, "MessageAgent destroying");
|
||||||
|
|||||||
@@ -49,6 +49,7 @@ public interface Service {
|
|||||||
/**
|
/**
|
||||||
* 进程退出时,调用Service销毁
|
* 进程退出时,调用Service销毁
|
||||||
* 远程模式下该方法会重载成空方法
|
* 远程模式下该方法会重载成空方法
|
||||||
|
* 注意: 在此方法内不能调用MessageClient.sendMessage 方法,因为Application关闭时会先destroy掉MessageClient
|
||||||
*
|
*
|
||||||
* @param config 配置参数
|
* @param config 配置参数
|
||||||
*/
|
*/
|
||||||
|
|||||||
Reference in New Issue
Block a user