本文整理了Java中com.hazelcast.core.Member.getSocketAddress()
方法的一些代码示例,展示了Member.getSocketAddress()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Member.getSocketAddress()
方法的具体详情如下:
包路径:com.hazelcast.core.Member
类名称:Member
方法名:getSocketAddress
[英]Returns the socket address of this member.
[中]返回此成员的套接字地址。
代码示例来源:origin: datasalt/splout-db
/**
* Return {@link InetSocketAddress#toString()} on the member
*/
public static String getHZAddress(Member member) {
return member.getSocketAddress().toString();
}
}
代码示例来源:origin: org.wso2.carbon.business-process/org.wso2.carbon.bpel
/**
* Provides HazelCast node id
* Added to fix BPS-675
*
* @param member
* @return
*/
protected static String getHazelCastNodeID(Member member) {
String hostName = member.getSocketAddress().getHostName();
int port = member.getSocketAddress().getPort();
return hostName + ":" + port;
}
代码示例来源:origin: kaazing/gateway
private MemberId getMemberId(Member member) {
InetSocketAddress inetSocketAddress = member.getSocketAddress();
String hostname = inetSocketAddress.getHostName();
if (!inetSocketAddress.isUnresolved()) {
String ipAddr = inetSocketAddress.getAddress().getHostAddress();
hostname = ipAddr;
GL.debug(GL.CLUSTER_LOGGER_NAME, "getMemberId: Hostname: {}; IP Address: {}", hostname, ipAddr);
}
return new MemberId("tcp", hostname, inetSocketAddress.getPort());
}
代码示例来源:origin: org.apache.karaf.cellar/org.apache.karaf.cellar.hazelcast
public HazelcastNode(Member member) {
InetSocketAddress address = member.getSocketAddress();
this.host = getHostString(address);
this.port = address.getPort();
StringBuilder builder = new StringBuilder();
this.id = builder.append(host).append(":").append(port).toString();
this.alias = member.getStringAttribute("alias");
}
代码示例来源:origin: hazelcast/hazelcast-jet
@Override
public Address getMasterAddress() {
final Collection<Member> memberList = getMemberList();
return !memberList.isEmpty() ? new Address(memberList.iterator().next().getSocketAddress()) : null;
}
代码示例来源:origin: com.hazelcast/hazelcast-all
@Override
public Address getMasterAddress() {
final Collection<Member> memberList = getMemberList();
return !memberList.isEmpty() ? new Address(memberList.iterator().next().getSocketAddress()) : null;
}
代码示例来源:origin: com.hazelcast/hazelcast-all
@ManagedAnnotation("Members")
@ManagedDescription("List of Members")
public List<String> getMembers() {
Set<Member> members = cluster.getMembers();
List<String> list = new ArrayList<String>(members.size());
for (Member member : members) {
list.add(member.getSocketAddress().toString());
}
return list;
}
代码示例来源:origin: hazelcast/hazelcast-jet
@ManagedAnnotation("Members")
@ManagedDescription("List of Members")
public List<String> getMembers() {
Set<Member> members = cluster.getMembers();
List<String> list = new ArrayList<String>(members.size());
for (Member member : members) {
list.add(member.getSocketAddress().toString());
}
return list;
}
代码示例来源:origin: io.snamp/internal-services
HazelcastNodeInfo(final Member sender, final boolean isActive, final String name){
this.name = name;
this.nodeID = sender.getUuid();
this.address = sender.getSocketAddress();
this.attributes = ImmutableMap.copyOf(sender.getAttributes());
active = isActive;
}
代码示例来源:origin: io.snamp/internal-services
/**
* Gets address of this node.
*
* @return Address of this node.
*/
@Override
public InetSocketAddress getAddress() {
return hazelcast.getCluster().getLocalMember().getSocketAddress();
}
代码示例来源:origin: spring-projects/spring-integration-extensions
@Override
protected void processEvent(Message<E> event) {
sendMessage(event, event.getPublishingMember().getSocketAddress(), getCacheListeningPolicy());
if (logger.isDebugEnabled()) {
logger.debug("Received Message : " + event);
}
}
代码示例来源:origin: hazelcast/hazelcast-code-samples
public static void main(String[] args) {
HazelcastInstance hz = Hazelcast.newHazelcastInstance();
IExecutorService executorService = hz.getExecutorService("executor");
for (Member member : hz.getCluster().getMembers()) {
EchoTask task = new EchoTask(member.getSocketAddress().toString());
executorService.executeOnMember(task, member);
}
}
}
代码示例来源:origin: spring-projects/spring-integration-extensions
@Override
protected void processEvent(AbstractIMapEvent event) {
if (getCacheEvents().contains(event.getEventType().toString())) {
if (AbstractHazelcastMessageProducer.this.logger.isDebugEnabled()) {
AbstractHazelcastMessageProducer.this.logger.debug("Received Event : " + event);
}
sendMessage(event, event.getMember().getSocketAddress(), getCacheListeningPolicy());
}
}
代码示例来源:origin: spring-projects/spring-integration-extensions
@Override
protected void processEvent(ItemEvent<E> event) {
if (getCacheEvents().contains(event.getEventType().toString())) {
sendMessage(event, event.getMember().getSocketAddress(), getCacheListeningPolicy());
}
if (logger.isDebugEnabled()) {
logger.debug("Received ItemEvent : " + event);
}
}
代码示例来源:origin: com.hazelcast.simulator/tests-hz35
@Prepare
public void prepare() {
Set<Member> memberSet = targetInstance.getCluster().getMembers();
memberAddresses = new Address[memberSet.size()];
int i = 0;
for (Member member : memberSet) {
memberAddresses[i++] = new Address(member.getSocketAddress());
}
}
代码示例来源:origin: com.hazelcast.simulator/tests-hz310
@Prepare
public void prepare() {
Set<Member> memberSet = targetInstance.getCluster().getMembers();
memberAddresses = new Address[memberSet.size()];
int i = 0;
for (Member member : memberSet) {
memberAddresses[i++] = new Address(member.getSocketAddress());
}
}
代码示例来源:origin: com.hazelcast.simulator/tests-hz38
@Prepare
public void prepare() {
Set<Member> memberSet = targetInstance.getCluster().getMembers();
memberAddresses = new Address[memberSet.size()];
int i = 0;
for (Member member : memberSet) {
memberAddresses[i++] = new Address(member.getSocketAddress());
}
}
代码示例来源:origin: spring-projects/spring-integration-extensions
@Override
protected org.springframework.messaging.Message<?> toMessage(Message<E> event) {
Assert.notNull(event.getMessageObject(), "message must not be null");
final Map<String, Object> headers = new HashMap<>();
headers.put(HazelcastHeaders.MEMBER, event.getPublishingMember().getSocketAddress());
headers.put(HazelcastHeaders.CACHE_NAME, event.getSource());
headers.put(HazelcastHeaders.PUBLISHING_TIME, event.getPublishTime());
return getMessageBuilderFactory().withPayload(event.getMessageObject()).copyHeaders(headers).build();
}
代码示例来源:origin: com.hazelcast.simulator/tests-hz36
@Prepare
public void prepare() {
Set<Member> memberSet = targetInstance.getCluster().getMembers();
memberAddresses = new Address[memberSet.size()];
int i = 0;
for (Member member : memberSet) {
memberAddresses[i++] = new Address(member.getSocketAddress());
}
}
代码示例来源:origin: spring-projects/spring-integration-extensions
@Override
protected org.springframework.messaging.Message<?> toMessage(ItemEvent<E> event) {
final Map<String, Object> headers = new HashMap<>();
headers.put(HazelcastHeaders.EVENT_TYPE, event.getEventType().name());
headers.put(HazelcastHeaders.MEMBER, event.getMember().getSocketAddress());
return getMessageBuilderFactory().withPayload(event.getItem()).copyHeaders(headers).build();
}
内容来源于网络,如有侵权,请联系作者删除!