tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From fha...@apache.org
Subject svn commit: r706433 - /tomcat/trunk/java/org/apache/catalina/ha/context/ReplicatedContext.java
Date Mon, 20 Oct 2008 22:36:56 GMT
Author: fhanik
Date: Mon Oct 20 15:36:56 2008
New Revision: 706433

URL: http://svn.apache.org/viewvc?rev=706433&view=rev
Log:
if replicated context starts without clustering enabled, then the map is not swapped, and
we get class cast exception upon shutdown

Modified:
    tomcat/trunk/java/org/apache/catalina/ha/context/ReplicatedContext.java

Modified: tomcat/trunk/java/org/apache/catalina/ha/context/ReplicatedContext.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/ha/context/ReplicatedContext.java?rev=706433&r1=706432&r2=706433&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/catalina/ha/context/ReplicatedContext.java (original)
+++ tomcat/trunk/java/org/apache/catalina/ha/context/ReplicatedContext.java Mon Oct 20 15:36:56
2008
@@ -54,6 +54,7 @@
             startComplete = true;
     }
 
+    @Override
     public synchronized void start() throws LifecycleException {
         if ( this.started ) return;
         super.addLifecycleListener(this);            
@@ -74,13 +75,14 @@
         }
     }
     
+    @Override
     public synchronized void stop() throws LifecycleException
     {
-        ReplicatedMap map = (ReplicatedMap)((ReplApplContext)this.context).getAttributeMap();
-        if ( map!=null ) {
-            map.breakdown();
-        }
         if ( !this.started ) return;
+        AbstractMap map = (AbstractMap)((ReplApplContext)this.context).getAttributeMap();
+        if ( map!=null && map instanceof ReplicatedMap) {
+            ((ReplicatedMap)map).breakdown();
+        }
         try {
             super.lifecycle.removeLifecycleListener(this);
         } catch ( Exception x ){



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


Mime
View raw message