本文整理了Java中com.hazelcast.core.Member.setStringAttribute()
方法的一些代码示例,展示了Member.setStringAttribute()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Member.setStringAttribute()
方法的具体详情如下:
包路径:com.hazelcast.core.Member
类名称:Member
方法名:setStringAttribute
[英]Defines a key-value pair string attribute for this member available to other cluster members.
[中]定义此成员的键值对字符串属性,该属性可供其他集群成员使用。
代码示例来源:origin: org.apache.karaf.cellar/org.apache.karaf.cellar.hazelcast
public void setNodeAlias(String alias) {
Cluster cluster = instance.getCluster();
if (cluster != null) {
Member member = cluster.getLocalMember();
member.setStringAttribute("alias", alias);
}
}
代码示例来源:origin: apache/karaf-cellar
public void setNodeAlias(String alias) {
Cluster cluster = instance.getCluster();
if (cluster != null) {
Member member = cluster.getLocalMember();
member.setStringAttribute("alias", alias);
}
}
代码示例来源:origin: dsukhoroslov/bagri
@Override
public Boolean call() throws Exception {
logger.trace("call.enter;");
HazelcastInstance hzInstance = findSystemInstance();
Member member = hzInstance.getCluster().getLocalMember();
boolean result = false;
for (String key: options.stringPropertyNames()) {
String oldValue = member.getStringAttribute(key);
String newValue = options.getProperty(key);
if (!(newValue.equals(oldValue))) {
member.setStringAttribute(key, newValue);
result = true;
}
}
// now flush node properties no its props file
String propsPath = System.getProperty(pn_config_path);
String propsName = System.getProperty(pn_config_properties_file);
if (propsName != null) {
storeOptions(propsPath + "/" + propsName);
} else {
logger.warn("call; properties file name not specified; can't persist them");
}
logger.trace("call.exit; returning: {}", result);
return result;
}
代码示例来源:origin: spring-projects/spring-integration-extensions
public static void testMembershipEvent(final HazelcastInstance instance,
final PollableChannel channel, final String key, final String value) {
Member member = instance.getCluster().getMembers().iterator().next();
member.setStringAttribute(key, value);
Message<?> msg = channel.receive(TIMEOUT);
verifyMembershipEvent(msg, MembershipEvent.MEMBER_ATTRIBUTE_CHANGED);
}
内容来源于网络,如有侵权,请联系作者删除!