Author: kfujino Date: Tue Apr 5 07:33:41 2016 New Revision: 1737794 URL: http://svn.apache.org/viewvc?rev=1737794&view=rev Log: Add the flag indicating that member is a localMember.
Modified: tomcat/tc8.5.x/trunk/java/org/apache/catalina/tribes/Member.java tomcat/tc8.5.x/trunk/java/org/apache/catalina/tribes/group/interceptors/StaticMembershipInterceptor.java tomcat/tc8.5.x/trunk/java/org/apache/catalina/tribes/membership/McastService.java tomcat/tc8.5.x/trunk/java/org/apache/catalina/tribes/membership/MemberImpl.java tomcat/tc8.5.x/trunk/java/org/apache/catalina/tribes/membership/mbeans-descriptors.xml tomcat/tc8.5.x/trunk/webapps/docs/changelog.xml Modified: tomcat/tc8.5.x/trunk/java/org/apache/catalina/tribes/Member.java URL: http://svn.apache.org/viewvc/tomcat/tc8.5.x/trunk/java/org/apache/catalina/tribes/Member.java?rev=1737794&r1=1737793&r2=1737794&view=diff ============================================================================== --- tomcat/tc8.5.x/trunk/java/org/apache/catalina/tribes/Member.java (original) +++ tomcat/tc8.5.x/trunk/java/org/apache/catalina/tribes/Member.java Tue Apr 5 07:33:41 2016 @@ -148,4 +148,11 @@ public interface Member { * @return the data length */ public int getDataLength(); + + /** + * @return boolean - true if the member is local member + */ + public boolean isLocal(); + + public void setLocal(boolean local); } Modified: tomcat/tc8.5.x/trunk/java/org/apache/catalina/tribes/group/interceptors/StaticMembershipInterceptor.java URL: http://svn.apache.org/viewvc/tomcat/tc8.5.x/trunk/java/org/apache/catalina/tribes/group/interceptors/StaticMembershipInterceptor.java?rev=1737794&r1=1737793&r2=1737794&view=diff ============================================================================== --- tomcat/tc8.5.x/trunk/java/org/apache/catalina/tribes/group/interceptors/StaticMembershipInterceptor.java (original) +++ tomcat/tc8.5.x/trunk/java/org/apache/catalina/tribes/group/interceptors/StaticMembershipInterceptor.java Tue Apr 5 07:33:41 2016 @@ -67,6 +67,7 @@ public class StaticMembershipInterceptor public void setLocalMember(Member member) { this.localMember = member; + localMember.setLocal(true); } @Override Modified: tomcat/tc8.5.x/trunk/java/org/apache/catalina/tribes/membership/McastService.java URL: http://svn.apache.org/viewvc/tomcat/tc8.5.x/trunk/java/org/apache/catalina/tribes/membership/McastService.java?rev=1737794&r1=1737793&r2=1737794&view=diff ============================================================================== --- tomcat/tc8.5.x/trunk/java/org/apache/catalina/tribes/membership/McastService.java (original) +++ tomcat/tc8.5.x/trunk/java/org/apache/catalina/tribes/membership/McastService.java Tue Apr 5 07:33:41 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/tc8.5.x/trunk/java/org/apache/catalina/tribes/membership/MemberImpl.java URL: http://svn.apache.org/viewvc/tomcat/tc8.5.x/trunk/java/org/apache/catalina/tribes/membership/MemberImpl.java?rev=1737794&r1=1737793&r2=1737794&view=diff ============================================================================== --- tomcat/tc8.5.x/trunk/java/org/apache/catalina/tribes/membership/MemberImpl.java (original) +++ tomcat/tc8.5.x/trunk/java/org/apache/catalina/tribes/membership/MemberImpl.java Tue Apr 5 07:33:41 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() { @@ -654,6 +659,16 @@ public class MemberImpl implements Membe } @Override + public boolean isLocal() { + return local; + } + + @Override + public void setLocal(boolean local) { + this.local = local; + } + + @Override public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException { int length = in.readInt(); byte[] message = new byte[length]; Modified: tomcat/tc8.5.x/trunk/java/org/apache/catalina/tribes/membership/mbeans-descriptors.xml URL: http://svn.apache.org/viewvc/tomcat/tc8.5.x/trunk/java/org/apache/catalina/tribes/membership/mbeans-descriptors.xml?rev=1737794&r1=1737793&r2=1737794&view=diff ============================================================================== --- tomcat/tc8.5.x/trunk/java/org/apache/catalina/tribes/membership/mbeans-descriptors.xml (original) +++ tomcat/tc8.5.x/trunk/java/org/apache/catalina/tribes/membership/mbeans-descriptors.xml Tue Apr 5 07:33:41 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" @@ -221,5 +227,11 @@ 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> </mbeans-descriptors> Modified: tomcat/tc8.5.x/trunk/webapps/docs/changelog.xml URL: http://svn.apache.org/viewvc/tomcat/tc8.5.x/trunk/webapps/docs/changelog.xml?rev=1737794&r1=1737793&r2=1737794&view=diff ============================================================================== --- tomcat/tc8.5.x/trunk/webapps/docs/changelog.xml (original) +++ tomcat/tc8.5.x/trunk/webapps/docs/changelog.xml Tue Apr 5 07:33:41 2016 @@ -163,6 +163,9 @@ <add> Add log of when received an unexpected messages. (kfujino) </add> + <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