tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From fha...@apache.org
Subject svn commit: r405230 - in /tomcat/container/tc5.5.x/modules: groupcom/src/share/org/apache/catalina/tribes/tipis/ ha/src/share/org/apache/catalina/ha/session/ ha/src/share/org/apache/catalina/ha/tcp/
Date Mon, 08 May 2006 23:48:29 GMT
Author: fhanik
Date: Mon May  8 16:48:28 2006
New Revision: 405230

URL: http://svn.apache.org/viewcvs?rev=405230&view=rev
Log:
Small optimizations

Modified:
    tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/tribes/tipis/AbstractReplicatedMap.java
    tomcat/container/tc5.5.x/modules/ha/src/share/org/apache/catalina/ha/session/DeltaSession.java
    tomcat/container/tc5.5.x/modules/ha/src/share/org/apache/catalina/ha/tcp/SimpleTcpCluster.java

Modified: tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/tribes/tipis/AbstractReplicatedMap.java
URL: http://svn.apache.org/viewcvs/tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/tribes/tipis/AbstractReplicatedMap.java?rev=405230&r1=405229&r2=405230&view=diff
==============================================================================
--- tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/tribes/tipis/AbstractReplicatedMap.java
(original)
+++ tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/tribes/tipis/AbstractReplicatedMap.java
Mon May  8 16:48:28 2006
@@ -218,7 +218,7 @@
      */
     public void replicate(Object key, boolean complete) {
         MapEntry entry = (MapEntry)super.get(key);
-        if (entry != null && entry.isPrimary()) {
+        if (entry != null && entry.isPrimary() && entry.getBackupNodes()!=
null && entry.getBackupNodes().length > 0) {
             Object value = entry.getValue();
             //check to see if we need to replicate this object isDirty()||complete
             boolean repl = complete || ( (value instanceof ReplicatedMapEntry) &&
( (ReplicatedMapEntry) value).isDirty());

Modified: tomcat/container/tc5.5.x/modules/ha/src/share/org/apache/catalina/ha/session/DeltaSession.java
URL: http://svn.apache.org/viewcvs/tomcat/container/tc5.5.x/modules/ha/src/share/org/apache/catalina/ha/session/DeltaSession.java?rev=405230&r1=405229&r2=405230&view=diff
==============================================================================
--- tomcat/container/tc5.5.x/modules/ha/src/share/org/apache/catalina/ha/session/DeltaSession.java
(original)
+++ tomcat/container/tc5.5.x/modules/ha/src/share/org/apache/catalina/ha/session/DeltaSession.java
Mon May  8 16:48:28 2006
@@ -33,7 +33,6 @@
 import javax.servlet.http.HttpSessionContext;
 
 import org.apache.catalina.Manager;
-import org.apache.catalina.Session;
 import org.apache.catalina.ha.ClusterManager;
 import org.apache.catalina.ha.ClusterSession;
 import org.apache.catalina.realm.GenericPrincipal;

Modified: tomcat/container/tc5.5.x/modules/ha/src/share/org/apache/catalina/ha/tcp/SimpleTcpCluster.java
URL: http://svn.apache.org/viewcvs/tomcat/container/tc5.5.x/modules/ha/src/share/org/apache/catalina/ha/tcp/SimpleTcpCluster.java?rev=405230&r1=405229&r2=405230&view=diff
==============================================================================
--- tomcat/container/tc5.5.x/modules/ha/src/share/org/apache/catalina/ha/tcp/SimpleTcpCluster.java
(original)
+++ tomcat/container/tc5.5.x/modules/ha/src/share/org/apache/catalina/ha/tcp/SimpleTcpCluster.java
Mon May  8 16:48:28 2006
@@ -340,8 +340,9 @@
     /**
      * has members
      */
+    protected boolean hasMembers = false;
     public boolean hasMembers() {
-        return channel.hasMembers();
+        return hasMembers;
     }
     
     /**
@@ -795,6 +796,7 @@
      */
     public void memberAdded(Member member) {
         try {
+            hasMembers = channel.hasMembers();
             if (log.isInfoEnabled()) log.info("Replication member added:" + member);
             // Notify our interested LifecycleListeners
             lifecycle.fireLifecycleEvent(BEFORE_MEMBERREGISTER_EVENT, member);
@@ -812,8 +814,9 @@
      * @see org.apache.catalina.ha.MembershipListener#memberDisappeared(org.apache.catalina.ha.Member)
      */
     public void memberDisappeared(Member member) {
-        if (log.isInfoEnabled()) log.info("Received member disappeared:" + member);
         try {
+            hasMembers = channel.hasMembers();            
+            if (log.isInfoEnabled()) log.info("Received member disappeared:" + member);
             // Notify our interested LifecycleListeners
             lifecycle.fireLifecycleEvent(BEFORE_MEMBERUNREGISTER_EVENT, member);
             // Notify our interested LifecycleListeners
@@ -821,7 +824,6 @@
         } catch (Exception x) {
             log.error("Unable remove cluster node from replication system.", x);
         }
-
     }
 
     // --------------------------------------------------------- receiver



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


Mime
View raw message