Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我在域模式下有一个基于 jboss6 AS 的集群。我在其中部署了一个应用程序。当新节点成为集群成员以及被删除时,我的应用程序需要有一个监听器(回调)。有没有办法获取成员节点列表并添加这样的监听器?
最简单的方法是在配置中定义一个集群缓存并从您的代码中访问它(参见示例)。在缓存可用的情况下,您可以调用cache.getCacheManager().addListener(Object)可以侦听的org.infinispan.notifications.cachemanagerlistener.annotation.ViewChanged. 有关详细信息,请参阅侦听器文档。
cache.getCacheManager().addListener(Object)
org.infinispan.notifications.cachemanagerlistener.annotation.ViewChanged