本文整理了Java中com.hazelcast.nio.Address.<init>()
方法的一些代码示例,展示了Address.<init>()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Address.<init>()
方法的具体详情如下:
包路径:com.hazelcast.nio.Address
类名称:Address
方法名:<init>
[英]Creates a new Address
[中]创建一个新地址
代码示例来源:origin: SonarSource/sonarqube
private Member newMember(String name) {
Member member = mock(Member.class, Mockito.RETURNS_MOCKS);
when(member.getStringAttribute(HazelcastMember.Attribute.NODE_NAME.getKey())).thenReturn(name);
when(member.getAddress()).thenReturn(new Address(AN_ADDRESS, 6789));
return member;
}
}
代码示例来源:origin: com.hazelcast/hazelcast-all
private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException {
in.defaultReadObject();
String uuid = in.readUTF();
String host = in.readUTF();
int port = in.readInt();
boolean liteMember = in.readBoolean();
MemberVersion version = (MemberVersion) in.readObject();
member = new MemberImpl(new Address(host, port), version, false, uuid, null, liteMember);
}
}
代码示例来源:origin: hazelcast/hazelcast-jet
private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException {
in.defaultReadObject();
String uuid = in.readUTF();
String host = in.readUTF();
int port = in.readInt();
boolean liteMember = in.readBoolean();
MemberVersion version = (MemberVersion) in.readObject();
member = new MemberImpl(new Address(host, port), version, false, uuid, null, liteMember);
}
}
代码示例来源:origin: hazelcast/hazelcast-jet
@Override
protected void readInternal(final ObjectDataInput in) throws IOException {
masterAddress = new Address();
masterAddress.readData(in);
}
代码示例来源:origin: hazelcast/hazelcast-jet
@Override
protected void readInternal(ObjectDataInput in) throws IOException {
newTargetAddress = new Address();
newTargetAddress.readData(in);
}
代码示例来源:origin: hazelcast/hazelcast-jet
@Override
public void readData(ObjectDataInput in)
throws IOException {
super.readData(in);
address = new Address();
address.readData(in);
}
代码示例来源:origin: com.hazelcast/hazelcast-all
@Override
public void readData(ObjectDataInput in)
throws IOException {
super.readData(in);
address = new Address();
address.readData(in);
}
代码示例来源:origin: com.hazelcast/hazelcast-all
@Override
public void readData(final ObjectDataInput in) throws IOException {
localAddress = new Address();
localAddress.readData(in);
boolean hasTarget = in.readBoolean();
if (hasTarget) {
targetAddress = new Address();
targetAddress.readData(in);
}
reply = in.readBoolean();
}
代码示例来源:origin: hazelcast/hazelcast-jet
@Override
public void readData(final ObjectDataInput in) throws IOException {
localAddress = new Address();
localAddress.readData(in);
boolean hasTarget = in.readBoolean();
if (hasTarget) {
targetAddress = new Address();
targetAddress.readData(in);
}
reply = in.readBoolean();
}
代码示例来源:origin: hazelcast/hazelcast-code-samples
private Iterable<DiscoveryNode> mapToDiscoveryNodes(List<String> assignments) {
Collection<DiscoveryNode> discoveredNodes = new ArrayList<DiscoveryNode>();
for (String assignment : assignments) {
String address = sliceAddress(assignment);
String hostname = sliceHostname(assignment);
Map<String, Object> attributes = Collections.<String, Object>singletonMap("hostname", hostname);
InetAddress inetAddress = mapToInetAddress(address);
Address addr = new Address(inetAddress, NetworkConfig.DEFAULT_PORT);
discoveredNodes.add(new SimpleDiscoveryNode(addr, attributes));
}
return discoveredNodes;
}
代码示例来源:origin: hazelcast/hazelcast-jet
@Override
protected void readInternal(ObjectDataInput in) throws IOException {
super.readInternal(in);
initiator = new Address();
initiator.readData(in);
txnId = in.readUTF();
}
代码示例来源:origin: hazelcast/hazelcast-jet
private Address createAddress(String hostname) throws IOException {
AddressUtil.AddressHolder addressHolder = AddressUtil.getAddressHolder(hostname);
String scopedHostName = AddressHelper.getScopedHostName(addressHolder);
return new Address(scopedHostName, addressHolder.getPort());
}
代码示例来源:origin: com.hazelcast/hazelcast-all
public static Address decode(ClientMessage clientMessage) {
String host = clientMessage.getStringUtf8();
int port = clientMessage.getInt();
try {
return new Address(host, port);
} catch (UnknownHostException e) {
throw new HazelcastException(e);
}
}
代码示例来源:origin: com.hazelcast/hazelcast-all
public void bind(final ClientEndpoint endpoint) {
final Connection conn = endpoint.getConnection();
if (conn instanceof TcpIpConnection) {
InetSocketAddress socketAddress = conn.getRemoteSocketAddress();
//socket address can be null if connection closed before bind
if (socketAddress != null) {
Address address = new Address(socketAddress);
((TcpIpConnection) conn).setEndPoint(address);
}
}
}
代码示例来源:origin: hazelcast/hazelcast-jet
public void bind(final ClientEndpoint endpoint) {
final Connection conn = endpoint.getConnection();
if (conn instanceof TcpIpConnection) {
InetSocketAddress socketAddress = conn.getRemoteSocketAddress();
//socket address can be null if connection closed before bind
if (socketAddress != null) {
Address address = new Address(socketAddress);
((TcpIpConnection) conn).setEndPoint(address);
}
}
}
代码示例来源:origin: hazelcast/hazelcast-jet
public static Address decode(ClientMessage clientMessage) {
String host = clientMessage.getStringUtf8();
int port = clientMessage.getInt();
try {
return new Address(host, port);
} catch (UnknownHostException e) {
throw new HazelcastException(e);
}
}
代码示例来源:origin: com.hazelcast/hazelcast-all
@Override
public void readData(ObjectDataInput in) throws IOException {
id = in.readUTF();
serviceName = in.readUTF();
topic = in.readUTF();
subscriber = new Address();
subscriber.readData(in);
filter = in.readObject();
}
代码示例来源:origin: hazelcast/hazelcast-jet
@Override
public void readData(ObjectDataInput in) throws IOException {
name = in.readUTF();
eventType = ItemEventType.getByType(in.readInt());
caller = new Address();
caller.readData(in);
data = in.readData();
}
代码示例来源:origin: hazelcast/hazelcast-jet
@Override
public void readData(ObjectDataInput in) throws IOException {
name = in.readUTF();
eventType = ItemEventType.getByType(in.readInt());
caller = new Address();
caller.readData(in);
data = in.readData();
}
代码示例来源:origin: com.hazelcast/hazelcast-kubernetes
private void addAddress(List<DiscoveryNode> discoveredNodes, EntrypointAddress entrypointAddress) {
Map<String, Object> properties = entrypointAddress.getAdditionalProperties();
String ip = entrypointAddress.getIp();
InetAddress inetAddress = mapAddress(ip);
int port = (this.port > 0) ? this.port : getServicePort(properties);
Address address = new Address(inetAddress, port);
discoveredNodes.add(new SimpleDiscoveryNode(address, properties));
if (logger.isFinestEnabled()) {
logger.finest("Found node service with address: " + address);
}
}
内容来源于网络,如有侵权,请联系作者删除!