/** * Create a InternalDistributedMember referring to the current host (as defined by the given * string). * <p> * * <b> 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) { this(i, p, version, MemberFactory.newNetMember(i, p)); }
this.locatorImpl = MemberFactory.newLocatorHandler(this.bindAddress, locatorsProp, locatorsAreCoordinators, networkPartitionDetectionEnabled, this.stats, securityUDPDHAlgo); this.handler.addHandler(PeerLocatorRequest.class, this.locatorImpl);
membershipManager = MemberFactory.newMembershipManager(l, system.getConfig(), transport, stats, system.getSecurityService());
/** * Create a InternalDistributedMember as defined by the given address. * <p> * * <b> 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 referring to the current host (as defined by the given * address). * <p> * * <b> 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(); }
/** * 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 the inet address * @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.netMbr = MemberFactory.newNetMember(i, p, splitBrainEnabled, canBeCoordinator, Version.CURRENT_ORDINAL, attr); this.hostName = SocketCreator.resolve_dns ? SocketCreator.getHostName(i) : i.getHostAddress(); short version = netMbr.getVersionOrdinal(); try { this.versionObj = Version.fromOrdinal(version, false); } catch (UnsupportedVersionException e) { this.versionObj = Version.CURRENT; } // checkHostName(); }
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 & NPD_ENABLED_BIT) != 0; boolean elCoord = (flags & COORD_ENABLED_BIT) != 0; int vmKind = in.readUnsignedByte(); int vmViewId = -1; if (vmKind == ClusterDistributionManager.LONER_DM_TYPE) { this.uniqueTag = DataSerializer.readString(in); } else { String str = DataSerializer.readString(in); if (str != null) { // backward compatibility from earlier than 6.5 vmViewId = Integer.parseInt(str); } } String name = DataSerializer.readString(in); MemberAttributes attr = new MemberAttributes(-1, -1, vmKind, vmViewId, name, null, null); netMbr = MemberFactory.newNetMember(inetAddr, port, sbEnabled, elCoord, InternalDataSerializer.getVersionForDataStream(in).ordinal(), attr); if (InternalDataSerializer.getVersionForDataStream(in).compareTo(Version.GFE_90) == 0) { netMbr.readAdditionalData(in); } }
netMbr = MemberFactory.newNetMember(inetAddr, port, sbEnabled, elCoord, version, 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));
/** * Creates a new InternalDistributedMember for use in notifying membership listeners. The version * information in the ID is set to Version.CURRENT. * * @param location the coordinates of the server */ public InternalDistributedMember(ServerLocation location) { this.hostName = location.getHostName(); final InetAddress addr; try { addr = hostnameResolver.getInetAddress(location); } catch (UnknownHostException e) { throw new ServerConnectivityException("Unable to resolve server location " + location, e); } netMbr = MemberFactory.newNetMember(addr, location.getPort()); netMbr.setVmKind(ClusterDistributionManager.NORMAL_DM_TYPE); versionObj = Version.CURRENT; netMbr.setVersion(versionObj); }
vmKind, -1, n, groups, attr); InetAddress addr = SocketCreator.toInetAddress(host); netMbr = MemberFactory.newNetMember(addr, p, false, true, Version.CURRENT_ORDINAL, mattr); defaultToCurrentHost(); netMbr.setName(n);