geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From djen...@apache.org
Subject svn commit: r404881 - in /geronimo/branches/1.1/modules/tomcat/src/java/org/apache/geronimo/tomcat: GeronimoStandardContext.java TomcatContainer.java TomcatWebAppContext.java
Date Mon, 08 May 2006 00:21:10 GMT
Author: djencks
Date: Sun May  7 17:21:06 2006
New Revision: 404881

URL: http://svn.apache.org/viewcvs?rev=404881&view=rev
Log:
Push some jsr-77 info into the tomcat mbeans. Avoid some resulting potential NPEs. Clean up
formatting a little bit

Modified:
    geronimo/branches/1.1/modules/tomcat/src/java/org/apache/geronimo/tomcat/GeronimoStandardContext.java
    geronimo/branches/1.1/modules/tomcat/src/java/org/apache/geronimo/tomcat/TomcatContainer.java
    geronimo/branches/1.1/modules/tomcat/src/java/org/apache/geronimo/tomcat/TomcatWebAppContext.java

Modified: geronimo/branches/1.1/modules/tomcat/src/java/org/apache/geronimo/tomcat/GeronimoStandardContext.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/modules/tomcat/src/java/org/apache/geronimo/tomcat/GeronimoStandardContext.java?rev=404881&r1=404880&r2=404881&view=diff
==============================================================================
--- geronimo/branches/1.1/modules/tomcat/src/java/org/apache/geronimo/tomcat/GeronimoStandardContext.java
(original)
+++ geronimo/branches/1.1/modules/tomcat/src/java/org/apache/geronimo/tomcat/GeronimoStandardContext.java
Sun May  7 17:21:06 2006
@@ -80,6 +80,12 @@
     private int contextCount = 0;
     
     public void setContextProperties(TomcatContext ctx) throws DeploymentException {
+        //try to make sure this mbean properties match those of the TomcatWebAppContext
+        if (ctx instanceof TomcatWebAppContext) {
+            TomcatWebAppContext tctx = (TomcatWebAppContext) ctx;
+            setJavaVMs(tctx.getJavaVMs());
+            setServer(tctx.getServer());
+        }
         // Create ReadOnlyContext
         javax.naming.Context enc = null;
         Map componentContext = ctx.getComponentContext();

Modified: geronimo/branches/1.1/modules/tomcat/src/java/org/apache/geronimo/tomcat/TomcatContainer.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/modules/tomcat/src/java/org/apache/geronimo/tomcat/TomcatContainer.java?rev=404881&r1=404880&r2=404881&view=diff
==============================================================================
--- geronimo/branches/1.1/modules/tomcat/src/java/org/apache/geronimo/tomcat/TomcatContainer.java
(original)
+++ geronimo/branches/1.1/modules/tomcat/src/java/org/apache/geronimo/tomcat/TomcatContainer.java
Sun May  7 17:21:06 2006
@@ -238,14 +238,14 @@
         ctx.setContext(anotherCtxObj);
 
         // Have the context to set its properties if its a GeronimoStandardContext
-        if (anotherCtxObj instanceof GeronimoStandardContext)
+        if (anotherCtxObj instanceof GeronimoStandardContext) {
             ((GeronimoStandardContext) anotherCtxObj).setContextProperties(ctx);
-
+        }
         //Was a virtual server defined?
         String virtualServer = ctx.getVirtualServer();
-        if (virtualServer == null)
+        if (virtualServer == null) {
             virtualServer = engine.getDefaultHost();
-
+        }
         Container host = engine.findChild(virtualServer);
         if (host == null) {
             throw new IllegalArgumentException("Invalid virtual host '" + virtualServer +
"'.  Do you have a matching Host entry in the plan?");

Modified: geronimo/branches/1.1/modules/tomcat/src/java/org/apache/geronimo/tomcat/TomcatWebAppContext.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/modules/tomcat/src/java/org/apache/geronimo/tomcat/TomcatWebAppContext.java?rev=404881&r1=404880&r2=404881&view=diff
==============================================================================
--- geronimo/branches/1.1/modules/tomcat/src/java/org/apache/geronimo/tomcat/TomcatWebAppContext.java
(original)
+++ geronimo/branches/1.1/modules/tomcat/src/java/org/apache/geronimo/tomcat/TomcatWebAppContext.java
Sun May  7 17:21:06 2006
@@ -274,7 +274,7 @@
     }
 
     public String getServer() {
-        return server.getObjectName();
+        return server == null? null: server.getObjectName();
     }
 
     public String getDocBase() {
@@ -435,7 +435,7 @@
     }
 
     public String[] getJavaVMs() {
-        return server.getJavaVMs();
+        return server == null? new String[0]: server.getJavaVMs();
     }
 
     public String getDeploymentDescriptor() {



Mime
View raw message