Author: kfujino Date: Tue Apr 5 07:15:36 2016 New Revision: 1737791 URL: http://svn.apache.org/viewvc?rev=1737791&view=rev Log: Add the flag indicating that member is a localMember.
Modified: tomcat/trunk/java/org/apache/catalina/tribes/membership/McastService.java tomcat/trunk/java/org/apache/catalina/tribes/membership/MemberImpl.java tomcat/trunk/java/org/apache/catalina/tribes/membership/mbeans-descriptors.xml tomcat/trunk/webapps/docs/changelog.xml Modified: tomcat/trunk/java/org/apache/catalina/tribes/membership/McastService.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/tribes/membership/McastService.java?rev=1737791&r1=1737790&r2=1737791&view=diff ============================================================================== --- tomcat/trunk/java/org/apache/catalina/tribes/membership/McastService.java (original) +++ tomcat/trunk/java/org/apache/catalina/tribes/membership/McastService.java Tue Apr 5 07:15:36 2016 @@ -156,6 +156,7 @@ public class McastService implements Mem localMember.setUniqueId(UUIDGenerator.randomUUID(true)); localMember.setPayload(getPayload()); localMember.setDomain(getDomain()); + localMember.setLocal(true); } localMember.setSecurePort(securePort); localMember.setUdpPort(udpPort); @@ -306,6 +307,7 @@ public class McastService implements Mem if ( localMember == null ) { localMember = new MemberImpl(host, port, 100); localMember.setUniqueId(UUIDGenerator.randomUUID(true)); + localMember.setLocal(true); } else { localMember.setHostname(host); localMember.setPort(port); Modified: tomcat/trunk/java/org/apache/catalina/tribes/membership/MemberImpl.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/tribes/membership/MemberImpl.java?rev=1737791&r1=1737790&r2=1737791&view=diff ============================================================================== --- tomcat/trunk/java/org/apache/catalina/tribes/membership/MemberImpl.java (original) +++ tomcat/trunk/java/org/apache/catalina/tribes/membership/MemberImpl.java Tue Apr 5 07:15:36 2016 @@ -109,6 +109,11 @@ public class MemberImpl implements Membe protected volatile byte[] domain = new byte[0]; /** + * The flag indicating that this member is a local member. + */ + protected volatile boolean local = false; + + /** * Empty constructor for serialization */ public MemberImpl() { @@ -653,6 +658,14 @@ public class MemberImpl implements Membe this.dataPkg = null; } + public boolean isLocal() { + return local; + } + + public void setLocal(boolean local) { + this.local = local; + } + @Override public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException { int length = in.readInt(); Modified: tomcat/trunk/java/org/apache/catalina/tribes/membership/mbeans-descriptors.xml URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/tribes/membership/mbeans-descriptors.xml?rev=1737791&r1=1737790&r2=1737791&view=diff ============================================================================== --- tomcat/trunk/java/org/apache/catalina/tribes/membership/mbeans-descriptors.xml (original) +++ tomcat/trunk/java/org/apache/catalina/tribes/membership/mbeans-descriptors.xml Tue Apr 5 07:15:36 2016 @@ -156,6 +156,12 @@ description="The upd port the member is listening on" type="int" writeable="false"/> + <attribute + name="local" + description="The flag indicating that this member is a local member" + type="boolean" + is="true" + writeable="false"/> </mbean> <mbean name="StaticMember" Modified: tomcat/trunk/webapps/docs/changelog.xml URL: http://svn.apache.org/viewvc/tomcat/trunk/webapps/docs/changelog.xml?rev=1737791&r1=1737790&r2=1737791&view=diff ============================================================================== --- tomcat/trunk/webapps/docs/changelog.xml (original) +++ tomcat/trunk/webapps/docs/changelog.xml Tue Apr 5 07:15:36 2016 @@ -165,6 +165,9 @@ <fix> Avoid NPE when a proxy node failed to retrieve a backup entry. (kfujino) </fix> + <add> + Add the flag indicating that member is a localMember. (kfujino) + </add> </changelog> </subsection> <subsection name="Other"> --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org