public void writeExternal(ObjectOutput out) throws IOException { if(ip_addr != null) { byte[] address=ip_addr.getAddress(); out.writeByte(address.length); out.write(address, 0, address.length); } else { out.writeByte(0); } out.writeShort(port & 0xffff); out.writeInt(processId); // GemStoneAddition out.writeInt(directPort); out.writeByte(vmKind); out.writeInt(this.birthViewId); out.writeUTF(getName()); if(additional_data != null) { out.writeInt(additional_data.length); out.write(additional_data, 0, additional_data.length); } else { out.writeInt(0); } out.writeByte(getFlags()); // GemStoneAddition JGroupsVersion.writeOrdinal(out, this.version, true); // GemStoneAddition }
out.writeByte(getFlags()); JGroupsVersion.writeOrdinal(out, this.version, true);
/** * For Externalizable * * @see java.io.Externalizable */ public void writeExternal(ObjectOutput out) throws IOException { if (ipAddr == null) throw new InternalGemFireError(LocalizedStrings.JGroupMember_ATTEMPT_TO_EXTERNALIZE_NULL_IP_ADDRESS.toLocalizedString()); // ipAddr.writeExternal(out); // do it the way we like byte[] address = ipAddr.getIpAddress().getAddress(); out.writeInt(address.length); // IPv6 compatible out.write(address); out.writeInt(ipAddr.getPort()); out.write(ipAddr.getFlags()); Version.writeOrdinal(out, ipAddr.getVersionOrdinal(), true); byte bytes[] = new MemberAttributes(ipAddr.getDirectPort(), ipAddr.getProcessId(), ipAddr.getVmKind(), ipAddr.getBirthViewId(), ipAddr.getName(), ipAddr.getRoles(), (DurableClientAttributes)ipAddr.getDurableClientAttributes()).toByteArray(); if (bytes == null) out.writeInt(0); else { out.writeInt(bytes.length); out.write(bytes); } }
public void setPort(int p) { IpAddress i = new IpAddress(ipAddr.getIpAddress(), p); i.setFlags(ipAddr.getFlags()); i.setVmKind(ipAddr.getVmKind()); i.setDirectPort(ipAddr.getDirectPort()); i.setProcessId(ipAddr.getProcessId()); i.setRoles(ipAddr.getRoles()); i.setDurableClientAttributes(ipAddr.getDurableClientAttributes()); i.setVersionOrdinal(ipAddr.getVersionOrdinal()); this.ipAddr = i; } }