incubator-lokahi-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tob...@apache.org
Subject svn commit: r629912 - /incubator/lokahi/lokahi/trunk/src/java/org/apache/lokahi/tomcat/api/entity/TomcatContextModel.java
Date Thu, 21 Feb 2008 18:41:36 GMT
Author: toback
Date: Thu Feb 21 10:41:35 2008
New Revision: 629912

URL: http://svn.apache.org/viewvc?rev=629912&view=rev
Log:
Fix to moving of the context so that the old pool is not still running the old context.

Modified:
    incubator/lokahi/lokahi/trunk/src/java/org/apache/lokahi/tomcat/api/entity/TomcatContextModel.java

Modified: incubator/lokahi/lokahi/trunk/src/java/org/apache/lokahi/tomcat/api/entity/TomcatContextModel.java
URL: http://svn.apache.org/viewvc/incubator/lokahi/lokahi/trunk/src/java/org/apache/lokahi/tomcat/api/entity/TomcatContextModel.java?rev=629912&r1=629911&r2=629912&view=diff
==============================================================================
--- incubator/lokahi/lokahi/trunk/src/java/org/apache/lokahi/tomcat/api/entity/TomcatContextModel.java
(original)
+++ incubator/lokahi/lokahi/trunk/src/java/org/apache/lokahi/tomcat/api/entity/TomcatContextModel.java
Thu Feb 21 10:41:35 2008
@@ -447,10 +447,27 @@
     this.jpInit(f, u, p, tc.getContextName());
     if (!u.isAllowed(f)) throw new AuthorizationException("User " + u.getName() + " Not allowed
to " + f.getName());
     if (tc.getPk() < 1) throw new TMCIllegalArgumentException("Error with input");
+    
+    TomcatContext origContext = TomcatContext.getTomcatContext(tc.getPk());
+    
+    // before we update, check to see if the NEW pool is different than the OLD pool
+    if (origContext.getTomcatPoolId() != tc.getTomcatPoolId()) {
+        // if they are different, undeploy the old context before updating
+    	this.undeployContext(this.jp, p, u, origContext);
+    }
+    
     TomcatContext.update(tc);
     this.installContext(jp, null, u, tc);
     TomcatPoolModel tpm = new TomcatPoolModel();
-    tpm.deployTomcatConfig(u, null, jp, tc.getTomcatPool(), f);
+    
+    // check to see if the NEW pool is different than the OLD pool
+    if (origContext.getTomcatPoolId() != tc.getTomcatPoolId()) {
+    	// if they are different deploy config files to OLD jvm
+    	tpm.deployTomcatConfig(u, null, this.jp, origContext.getTomcatPool(), f);
+    }
+    
+    // deploy config files to NEW jvm
+    tpm.deployTomcatConfig(u, null, this.jp, tc.getTomcatPool(), f);
     jp.setState(State.NEW);
     JobPool.update(jp);
   }
@@ -495,6 +512,7 @@
     return TomcatContext.getTomcatContext(id);
   }
 }
+
 
 
 



Mime
View raw message