/** * Set the membership port. This is done in loner systems using * client/server connection information to help form a unique ID */ public void setPort(int p) { assert this.vmKind == DistributionManager.LONER_DM_TYPE; this.netMbr.setPort(p); synchPayload(); cachedToString = null; }
private void synchPayload() { netMbr.setAttributes(new MemberAttributes(dcPort, vmPid, vmKind, vmViewId, name, groups, durableClientAttributes)); }
@Override public boolean equals(Object obj) { if ((obj == null) || !(obj instanceof DataStoreBuckets)) { return false; } DataStoreBuckets other = (DataStoreBuckets) obj; return this.numBuckets == other.numBuckets && this.memberId.equals(other.memberId); }
@Override public int hashCode() { return memberId.hashCode(); } @Override
/** * Returns true if the given DistributedMember is a locator */ public static boolean isLocatorMember(DistributedMember mbr) { return ((InternalDistributedMember)mbr).getVmKind() == DistributionManager.LOCATOR_DM_TYPE; }
/** * Return a blank NetMember (used by externalization) * @return the new NetMember */ static public NetMember newNetMember() { return services.newNetMember(); }
/** * [GemStone] Sets the process id of the VM that hosts the distribution * manager with this address. * * @since 4.0 */ public void setVmPid(int p) { this.vmPid = p; synchPayload(); cachedToString = null; }
/** * Returns null if no dm available. */ public DM getDM() { return this.receiver.getDM(); }
public int compareTo(Member other) { // memberId is InternalDistributedMember which implements Comparable return this.memberId.compareTo(other.memberId); } }
public void setShutDown() { // this.shuttingDown = shuttingDown; if (membershipManager != null) membershipManager.setShutdown(); }
/** * Set the VmPid to be the given value. This may be done by JGroups UDP * protocol if there is no PID available to augment its membership port number. * This functionality was added by us for bug #41983 * @param uniqueID */ public static void setDefaultVmPid(int uniqueID) { // note: JGroupMembershipManager establishes DEFAULT before attempting to // create a JGroups channel, so we know it isn't INVALID here setDefaults(DEFAULT.dcPort, uniqueID, DEFAULT.vmKind, DEFAULT.vmViewId, DEFAULT.name, DEFAULT.groups, DEFAULT.durableClientAttributes); }
@Override public boolean equals(Object other) { if (other instanceof DistributedLockOwner) { final DistributedLockOwner otherOwner = (DistributedLockOwner)other; return this.ownerThreadId == otherOwner.ownerThreadId && this.ownerMember.equals(otherOwner.ownerMember); } return false; }
@Override public int hashCode() { return this.memberId.hashCode(); }
/** * Returns true if the given DistributedMember is loner (no peer-to-peer cache) */ public static boolean isLonerMember(DistributedMember mbr) { return ((InternalDistributedMember)mbr).getVmKind() == DistributionManager.LONER_DM_TYPE; }
/** * Return a new NetMember representing current host * @param i an InetAddress referring to the current host * @param p the membership port being used * @return the new NetMember */ static public NetMember newNetMember(InetAddress i, int p) { NetMember result = services.newNetMember(i, p); return result; }
/** * [GemStone] Set the direct channel port */ public void setDirectChannelPort(int p) { dcPort = p; synchPayload(); }
@Override public boolean equals(Object other) { if (this == other) return true; if (other instanceof Key) { Key toTest = (Key)other; return (toTest.console.equals(this.console) && toTest.msgId == this.msgId); } return false; }
/** * Return a new NetMember representing current host * * @param s a String referring to the current host * @param p the membership port being used * @return the new member */ static public NetMember newNetMember(String s, int p) { return services.newNetMember(s, p); }
@Override public boolean equals(Object obj) { if ((obj == null) || !(obj instanceof DataStoreBuckets)) { return false; } DataStoreBuckets other = (DataStoreBuckets) obj; return this.numBuckets == other.numBuckets && this.memberId.equals(other.memberId); }
/** * Return a new NetMember representing current host * * @param s a String referring to the current host * @param p the membership port being used * @return the new member */ static public NetMember newNetMember(String s, int p) { return services.newNetMember(s, p); }