本文整理了Java中com.hazelcast.core.Hazelcast.getCluster()
方法的一些代码示例,展示了Hazelcast.getCluster()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Hazelcast.getCluster()
方法的具体详情如下:
包路径:com.hazelcast.core.Hazelcast
类名称:Hazelcast
方法名:getCluster
暂无
代码示例来源:origin: apache/usergrid
public void init() {
logger.info( "HazelcastLifecycleMonitor initializing..." );
Hazelcast.addInstanceListener( this );
Hazelcast.getCluster().addMembershipListener( this );
logger.info( "HazelcastLifecycleMonitor initialized" );
}
代码示例来源:origin: apache/usergrid
@Test
public void doTest() {
logger.info( "do test" );
Hazelcast.addInstanceListener( this );
ITopic<Object> topic = Hazelcast.getTopic( "default" );
topic.addMessageListener( this );
topic.publish( "my-message-object" );
Collection<Instance> instances = Hazelcast.getInstances();
for ( Instance instance : instances ) {
logger.info( "ID: [" + instance.getId() + "] Type: [" + instance.getInstanceType() + "]" );
}
Set<Member> setMembers = Hazelcast.getCluster().getMembers();
for ( Member member : setMembers ) {
logger.info( "isLocalMember " + member.localMember() );
logger.info( "member.inetsocketaddress " + member.getInetSocketAddress() );
}
}
内容来源于网络,如有侵权,请联系作者删除!