/** * Create a InternalDistributedMember referring to the current host (as defined by the given * string).<p> * * <b> * [bruce]THIS METHOD IS FOR TESTING ONLY. DO NOT USE IT TO CREATE IDs FOR * USE IN THE PRODUCT. IT DOES NOT PROPERLY INITIALIZE ATTRIBUTES NEEDED * FOR P2P FUNCTIONALITY. * </b> * * * @param i * the hostname, must be for the current host * @param p * the membership listening port * @param version * the version of this member * @throws UnknownHostException if the given hostname cannot be resolved */ public InternalDistributedMember(String i, int p, Version version) throws UnknownHostException { this (i, p, version, MemberFactory.newNetMember(i, p)); }
/** * Create a InternalDistributedMember referring to the current host (as defined by the given * address).<p> * * <b> * [bruce]THIS METHOD IS FOR TESTING ONLY. DO NOT USE IT TO CREATE IDs FOR * USE IN THE PRODUCT. IT DOES NOT PROPERLY INITIALIZE ATTRIBUTES NEEDED * FOR P2P FUNCTIONALITY. * </b> * * * @param i * the hostname, must be for the current host * @param p * the membership listening port */ public InternalDistributedMember(InetAddress i, int p) { netMbr = MemberFactory.newNetMember(i, p); defaultToCurrentHost(); }
/** * Create a InternalDistributedMember referring to the current host (as defined by the given * address).<p> * * <b> * [bruce]THIS METHOD IS FOR TESTING ONLY. DO NOT USE IT TO CREATE IDs FOR * USE IN THE PRODUCT. IT DOES NOT PROPERLY INITIALIZE ATTRIBUTES NEEDED * FOR P2P FUNCTIONALITY. * </b> * * * @param i * the hostname, must be for the current host * @param p * the membership listening port */ public InternalDistributedMember(InetAddress i, int p) { ipAddr = (JGroupMember)MemberFactory.newNetMember(i, p); defaultToCurrentHost(); }
/** * Create a InternalDistributedMember as defined by the given address. * <p> * * <b> * [bruce]THIS METHOD IS FOR TESTING ONLY. DO NOT USE IT TO CREATE IDs FOR * USE IN THE PRODUCT. IT DOES NOT PROPERLY INITIALIZE ATTRIBUTES NEEDED * FOR P2P FUNCTIONALITY. * </b> * * @param addr * address of the server * @param p * the listening port of the server * @param isCurrentHost * true if the given host refers to the current host (bridge and * gateway use false to create a temporary id for the OTHER side of a * connection) */ public InternalDistributedMember(InetAddress addr, int p, boolean isCurrentHost) { netMbr = MemberFactory.newNetMember(addr, p); if (isCurrentHost) { defaultToCurrentHost(); } }
/** * Create a InternalDistributedMember as defined by the given address. * <p> * * <b> * [bruce]THIS METHOD IS FOR TESTING ONLY. DO NOT USE IT TO CREATE IDs FOR * USE IN THE PRODUCT. IT DOES NOT PROPERLY INITIALIZE ATTRIBUTES NEEDED * FOR P2P FUNCTIONALITY. * </b> * * @param addr * address of the server * @param p * the listening port of the server * @param isCurrentHost * true if the given host refers to the current host (bridge and * gateway use false to create a temporary id for the OTHER side of a * connection) */ public InternalDistributedMember(InetAddress addr, int p, boolean isCurrentHost) { ipAddr = (JGroupMember)MemberFactory.newNetMember(addr, p); if (isCurrentHost) { defaultToCurrentHost(); } }
private void _readEssentialData(DataInput in) throws IOException, ClassNotFoundException { this.isPartial = true; InetAddress inetAddr = DataSerializer.readInetAddress(in); int port = in.readInt(); this.hostName = SocketCreator.resolve_dns? SocketCreator.getHostName(inetAddr) : inetAddr.getHostAddress(); int flags = in.readUnsignedByte(); boolean sbEnabled = (flags & SB_ENABLED_MASK) != 0; boolean elCoord = (flags & COORD_ENABLED_MASK) != 0; this.vmKind = in.readUnsignedByte(); if (this.vmKind == DistributionManager.LONER_DM_TYPE) { this.uniqueTag = DataSerializer.readString(in); } else { String str = DataSerializer.readString(in); if (str != null) { // backward compatibility from earlier than 6.5 this.vmViewId = Integer.parseInt(str); } } /*this.name =*/ DataSerializer.readString(in); MemberAttributes attr = new MemberAttributes(this.dcPort, this.vmPid, this.vmKind, this.vmViewId, this.name, this.groups, this.durableClientAttributes); ipAddr = (JGroupMember)MemberFactory.newNetMember(inetAddr, port, sbEnabled, elCoord, attr); synchPayload(); }
/** * Create a InternalDistributedMember referring to the current host (as defined by the given * string).<p> * * <b> * [bruce]THIS METHOD IS FOR TESTING ONLY. DO NOT USE IT TO CREATE IDs FOR * USE IN THE PRODUCT. IT DOES NOT PROPERLY INITIALIZE ATTRIBUTES NEEDED * FOR P2P FUNCTIONALITY. * </b> * * * @param i * the hostname, must be for the current host * @param p * the membership listening port * @throws UnknownHostException if the given hostname cannot be resolved */ public InternalDistributedMember(String i, int p) throws UnknownHostException { ipAddr = (JGroupMember)MemberFactory.newNetMember(i, p); defaultToCurrentHost(); this.vmKind = DistributionManager.NORMAL_DM_TYPE; GFJGBasicAdapter.insertDefaultGemFireAttributes(ipAddr.getAddress()); }
/** * Create a InternalDistributedMember referring to the current host * (as defined by the given string) with additional info including optional * connection name and an optional unique string. Currently these two * optional fields (and this constructor) are only used by the * LonerDistributionManager.<p> * * < b> * [bruce]DO NOT USE THIS METHOD TO CREATE ANYTHING OTHER THAN A LONER ID * WITHOUT TALKING TO ME FIRST. IT DOES NOT PROPERLY INITIALIZE THE ID. * </b> * * @param i * the hostname, must be for the current host * @param p * the membership listening port * @param n * gemfire properties connection name * @param u * unique string used make the member more unique * @throws UnknownHostException if the given hostname cannot be resolved */ public InternalDistributedMember(String i, int p, String n, String u) throws UnknownHostException { ipAddr = (JGroupMember)MemberFactory.newNetMember(i, p); defaultToCurrentHost(); GFJGBasicAdapter.insertDefaultGemFireAttributes(ipAddr.getAddress()); this.name = n; this.uniqueTag = u; }
netMbr = MemberFactory.newNetMember(inetAddr, port, sbEnabled, elCoord, InternalDataSerializer.getVersionForDataStream(in).ordinal(), attr);
netMbr = MemberFactory.newNetMember(inetAddr, port, sbEnabled, elCoord, version, attr);
netMbr = MemberFactory.newNetMember(inetAddr, port, sbEnabled, elCoord, version, new MemberAttributes(dcPort, vmPid, vmKind, vmViewId, name, groups, durableClientAttributes)); if (this.version >= Version.GFE_90.ordinal()) {
private void _readEssentialData(DataInput in) throws IOException, ClassNotFoundException { this.isPartial = true; InetAddress inetAddr = DataSerializer.readInetAddress(in); int port = in.readInt(); this.hostName = SocketCreator.resolve_dns? SocketCreator.getHostName(inetAddr) : inetAddr.getHostAddress(); int flags = in.readUnsignedByte(); boolean sbEnabled = (flags & SB_ENABLED_MASK) != 0; boolean elCoord = (flags & COORD_ENABLED_MASK) != 0; this.vmKind = in.readUnsignedByte(); if (this.vmKind == DistributionManager.LONER_DM_TYPE) { this.uniqueTag = DataSerializer.readString(in); } else { String str = DataSerializer.readString(in); if (str != null) { // backward compatibility from earlier than 6.5 this.vmViewId = Integer.parseInt(str); } } this.name = DataSerializer.readString(in); MemberAttributes attr = new MemberAttributes(this.dcPort, this.vmPid, this.vmKind, this.vmViewId, this.name, this.groups, this.durableClientAttributes); netMbr = MemberFactory.newNetMember(inetAddr, port, sbEnabled, elCoord, InternalDataSerializer.getVersionForDataStream(in).ordinal(), attr); synchPayload(); if (InternalDataSerializer.getVersionForDataStream(in).compareTo(Version.GFE_90)>=0) { netMbr.readAdditionalData(in); } }
ipAddr = (JGroupMember)MemberFactory.newNetMember(inetAddr, port, sbEnabled, elCoord, new MemberAttributes(dcPort, vmPid, vmKind, vmViewId, name, groups, durableClientAttributes)); ipAddr.getAddress().setVersionOrdinal(this.version);
ipAddr = (JGroupMember)MemberFactory.newNetMember(inetAddr, port, sbEnabled, elCoord, attr); ipAddr.getAddress().setVersionOrdinal(this.version);
/** * Construct a InternalDistributedMember. All fields are specified.<p> * * This, and the following constructor are the only valid ways to create an ID * for a distributed member for use * in the P2P cache. Use of other constructors can break network-partition-detection. * * @param i * @param p * the membership port * @param splitBrainEnabled whether this feature is enabled for the member * @param canBeCoordinator whether the member is eligible to be the membership coordinator * @param attr * the member's attributes */ public InternalDistributedMember(InetAddress i, int p, boolean splitBrainEnabled, boolean canBeCoordinator, MemberAttributes attr) { this.dcPort = attr.getPort(); this.vmPid = attr.getVmPid(); this.vmKind = attr.getVmKind(); this.vmViewId = attr.getVmViewId(); this.name = attr.getName(); this.groups = attr.getGroups(); this.durableClientAttributes = attr.getDurableClientAttributes(); this.ipAddr = (JGroupMember)MemberFactory.newNetMember(i, p, splitBrainEnabled, canBeCoordinator, attr); this.hostName = SocketCreator.resolve_dns? SocketCreator.getHostName(i) : i.getHostAddress(); // checkHostName(); }
groups, attr); InetAddress addr = SocketCreator.toInetAddress(host); netMbr = MemberFactory.newNetMember(addr, p, false, true, Version.CURRENT_ORDINAL, mattr); defaultToCurrentHost(); this.name = n;
this.groups = attr.getGroups(); this.durableClientAttributes = attr.getDurableClientAttributes(); this.netMbr = MemberFactory.newNetMember(i, p, splitBrainEnabled, canBeCoordinator, Version.CURRENT_ORDINAL, attr); this.hostName = SocketCreator.resolve_dns? SocketCreator.getHostName(i) : i.getHostAddress(); this.version = netMbr.getVersionOrdinal();