Hazelcast可防止JVM终止 [英] Hazelcast prevents the JVM from terminating

查看:242
本文介绍了Hazelcast可防止JVM终止的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们在遗留Java集群应用程序中使用Hazelcast 2.6.2。当应用程序停止时,JVM不再终止。它似乎是由Hazelcast线程没有被标记的守护进程引起的。我没有找到通过Hazelcast API标记它们守护程序的方法。

We use Hazelcast 2.6.2 in a legacy Java clustered application. When the application is stopped the JVM does not terminate any more. It seems that it is caused by Hazelcast threads not being flagged daemon. I did not find a way way through the Hazelcast API to flag them daemon.

是否有推荐的解决方案来阻止Hazelcast阻止JVM终止?

Are there recommended solutions to prevent Hazelcast from preventing the JVM to terminate?

问候

推荐答案

查看 Hazelcast Javadocs ,我看到有一个 shutdownAll() ; 方法。引用javadocs:

Looking at the Hazelcast Javadocs, I see that there is a shutdownAll(); method. To quote the javadocs:


关闭此JVM上所有正在运行的Hazelcast实例,包括默认的实例,如果它正在运行。它不会关闭集群的所有成员,只会关闭在此JVM上运行的成员。

Shuts down all running Hazelcast Instances on this JVM, including the default one if it is running. It doesn't shutdown all members of the cluster but just the ones running on this JVM.

如果您没有关闭它我怀疑那里有非守护程序线程没有被终止,这将阻止JVM关闭。

If you aren't shutting it down I suspect there are non-daemon threads there that aren't being terminated that will keep the JVM from closing.

这篇关于Hazelcast可防止JVM终止的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆