geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From akulshresh...@apache.org
Subject svn commit: r469913 - in /geronimo/server/trunk/modules/geronimo-tomcat/src/main/java/org/apache/geronimo/tomcat: GeronimoStandardContext.java TomcatContainer.java TomcatWebAppContext.java
Date Wed, 01 Nov 2006 14:09:15 GMT
Author: akulshreshtha
Date: Wed Nov  1 06:09:14 2006
New Revision: 469913

URL: http://svn.apache.org/viewvc?view=rev&rev=469913
Log:
Geronimo-2526 Set J2EEApplication and J2EEServer for WebModule and hence servlets

Modified:
    geronimo/server/trunk/modules/geronimo-tomcat/src/main/java/org/apache/geronimo/tomcat/GeronimoStandardContext.java
    geronimo/server/trunk/modules/geronimo-tomcat/src/main/java/org/apache/geronimo/tomcat/TomcatContainer.java
    geronimo/server/trunk/modules/geronimo-tomcat/src/main/java/org/apache/geronimo/tomcat/TomcatWebAppContext.java

Modified: geronimo/server/trunk/modules/geronimo-tomcat/src/main/java/org/apache/geronimo/tomcat/GeronimoStandardContext.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-tomcat/src/main/java/org/apache/geronimo/tomcat/GeronimoStandardContext.java?view=diff&rev=469913&r1=469912&r2=469913
==============================================================================
--- geronimo/server/trunk/modules/geronimo-tomcat/src/main/java/org/apache/geronimo/tomcat/GeronimoStandardContext.java
(original)
+++ geronimo/server/trunk/modules/geronimo-tomcat/src/main/java/org/apache/geronimo/tomcat/GeronimoStandardContext.java
Wed Nov  1 06:09:14 2006
@@ -81,6 +81,8 @@
             TomcatWebAppContext tctx = (TomcatWebAppContext) ctx;
             setJavaVMs(tctx.getJavaVMs());
             setServer(tctx.getServer());
+            setJ2EEApplication(tctx.getJ2EEApplication());
+            setJ2EEServer(tctx.getJ2EEServer());
         }
         // Create ReadOnlyContext
         javax.naming.Context enc = null;

Modified: geronimo/server/trunk/modules/geronimo-tomcat/src/main/java/org/apache/geronimo/tomcat/TomcatContainer.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-tomcat/src/main/java/org/apache/geronimo/tomcat/TomcatContainer.java?view=diff&rev=469913&r1=469912&r2=469913
==============================================================================
--- geronimo/server/trunk/modules/geronimo-tomcat/src/main/java/org/apache/geronimo/tomcat/TomcatContainer.java
(original)
+++ geronimo/server/trunk/modules/geronimo-tomcat/src/main/java/org/apache/geronimo/tomcat/TomcatContainer.java
Wed Nov  1 06:09:14 2006
@@ -22,6 +22,8 @@
 import java.net.URLStreamHandlerFactory;
 import java.net.URL;
 
+import javax.management.ObjectName;
+
 import org.apache.catalina.Container;
 import org.apache.catalina.Context;
 import org.apache.catalina.Engine;
@@ -34,6 +36,7 @@
 import org.apache.geronimo.gbean.GBeanInfoBuilder;
 import org.apache.geronimo.gbean.GBeanLifecycle;
 import org.apache.geronimo.j2ee.j2eeobjectnames.NameFactory;
+import org.apache.geronimo.kernel.ObjectNameUtil;
 import org.apache.geronimo.management.geronimo.NetworkConnector;
 import org.apache.geronimo.management.geronimo.WebManager;
 import org.apache.geronimo.system.serverinfo.ServerInfo;
@@ -202,6 +205,14 @@
         Context defaultContext;
         for (int i = 0; i < hosts.length; i++) {
             defaultContext = embedded.createContext("", docBase, classLoader);
+            if (defaultContext instanceof GeronimoStandardContext) {
+                GeronimoStandardContext ctx = (GeronimoStandardContext) defaultContext;
+                // Without this the Tomcat FallBack Application is left behind,
+                // MBean - ...J2EEApplication=none,J2EEServer=none,..........
+                ctx.setJ2EEApplication(null);
+                // TODO if objectName != null extract J2EEServer from objectName/host
+                ctx.setJ2EEServer("geronimo");
+            }
             hosts[i].addChild(defaultContext);
         }
 

Modified: geronimo/server/trunk/modules/geronimo-tomcat/src/main/java/org/apache/geronimo/tomcat/TomcatWebAppContext.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-tomcat/src/main/java/org/apache/geronimo/tomcat/TomcatWebAppContext.java?view=diff&rev=469913&r1=469912&r2=469913
==============================================================================
--- geronimo/server/trunk/modules/geronimo-tomcat/src/main/java/org/apache/geronimo/tomcat/TomcatWebAppContext.java
(original)
+++ geronimo/server/trunk/modules/geronimo-tomcat/src/main/java/org/apache/geronimo/tomcat/TomcatWebAppContext.java
Wed Nov  1 06:09:14 2006
@@ -112,8 +112,6 @@
 
     private final J2EEServer server;
 
-    private final J2EEApplication application;
-
     private final Map webServices;
 
     private final String objectName;
@@ -121,6 +119,12 @@
     private final String originalSpecDD;
 
     private final URL configurationBaseURL;
+    
+    // JSR 77 
+    
+    private final String j2EEServer;
+    
+    private final String j2EEApplication;
 
     public TomcatWebAppContext(
             ClassLoader classLoader,
@@ -177,7 +181,6 @@
         this.trackedConnectionAssociator = trackedConnectionAssociator;
 
         this.server = server;
-        this.application = application;
 
         this.configurationBaseURL = configurationBaseUrl;
 
@@ -226,11 +229,17 @@
         this.classLoader = classLoader;
 
         this.kernel = kernel;
+        
         if (objectName != null) {
             ObjectName myObjectName = ObjectNameUtil.getObjectName(objectName);
             verifyObjectName(myObjectName);
-        }
-
+            j2EEServer = myObjectName.getKeyProperty(NameFactory.J2EE_SERVER);
+            j2EEApplication = myObjectName.getKeyProperty(NameFactory.J2EE_APPLICATION);
+        } else {
+            // StandardContext uses default value of these as "none"
+            j2EEServer = null;
+            j2EEApplication = null;
+        }       
     }
 
     private Map createWebServices(Map webServiceFactoryMap, Kernel kernel) throws Exception
{
@@ -250,6 +259,14 @@
 
     public String getObjectName() {
         return objectName;
+    }
+
+    public String getJ2EEApplication() {
+        return j2EEApplication;
+    }
+
+    public String getJ2EEServer() {
+        return j2EEServer;
     }
 
     public boolean isStateManageable() {



Mime
View raw message