geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ga...@apache.org
Subject svn commit: r1064268 - in /geronimo/server/trunk/plugins: jetty8/geronimo-jetty8/src/main/java/org/apache/geronimo/jetty8/handler/GeronimoWebAppContext.java tomcat/geronimo-tomcat7/src/main/java/org/apache/geronimo/tomcat/TomcatContainer.java
Date Thu, 27 Jan 2011 19:34:27 GMT
Author: gawor
Date: Thu Jan 27 19:34:26 2011
New Revision: 1064268

URL: http://svn.apache.org/viewvc?rev=1064268&view=rev
Log:
GERONIMO-5788: Expose BundleContext in ServletContext under Spring-named attribute

Modified:
    geronimo/server/trunk/plugins/jetty8/geronimo-jetty8/src/main/java/org/apache/geronimo/jetty8/handler/GeronimoWebAppContext.java
    geronimo/server/trunk/plugins/tomcat/geronimo-tomcat7/src/main/java/org/apache/geronimo/tomcat/TomcatContainer.java

Modified: geronimo/server/trunk/plugins/jetty8/geronimo-jetty8/src/main/java/org/apache/geronimo/jetty8/handler/GeronimoWebAppContext.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/jetty8/geronimo-jetty8/src/main/java/org/apache/geronimo/jetty8/handler/GeronimoWebAppContext.java?rev=1064268&r1=1064267&r2=1064268&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/jetty8/geronimo-jetty8/src/main/java/org/apache/geronimo/jetty8/handler/GeronimoWebAppContext.java
(original)
+++ geronimo/server/trunk/plugins/jetty8/geronimo-jetty8/src/main/java/org/apache/geronimo/jetty8/handler/GeronimoWebAppContext.java
Thu Jan 27 19:34:26 2011
@@ -67,6 +67,7 @@ import org.eclipse.jetty.util.resource.R
 import org.eclipse.jetty.util.resource.URLResource;
 import org.eclipse.jetty.webapp.WebAppContext;
 import org.osgi.framework.Bundle;
+import org.osgi.framework.BundleContext;
 import org.osgi.framework.ServiceRegistration;
 
 /**
@@ -97,8 +98,14 @@ public class GeronimoWebAppContext exten
         this.integrationContext = integrationContext;
         setClassLoader(classLoader);
         this.classLoader = classLoader;
-        setAttribute(WebApplicationConstants.BUNDLE_CONTEXT_ATTRIBUTE, integrationContext.getBundle().getBundleContext());
+        setAttribute(WebApplicationConstants.BUNDLE_CONTEXT_ATTRIBUTE, 
+                     integrationContext.getBundle().getBundleContext());
+
         setAttribute(WebAttributeName.WEB_APP_INFO.name(), webAppInfo);
+
+        setAttribute("org.springframework.osgi.web." + BundleContext.class.getName(), 
+                     integrationContext.getBundle().getBundleContext());
+
         // now set the module context ValidatorFactory in a context property.
         try {
             javax.naming.Context ctx = integrationContext.getComponentContext();

Modified: geronimo/server/trunk/plugins/tomcat/geronimo-tomcat7/src/main/java/org/apache/geronimo/tomcat/TomcatContainer.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/tomcat/geronimo-tomcat7/src/main/java/org/apache/geronimo/tomcat/TomcatContainer.java?rev=1064268&r1=1064267&r2=1064268&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/tomcat/geronimo-tomcat7/src/main/java/org/apache/geronimo/tomcat/TomcatContainer.java
(original)
+++ geronimo/server/trunk/plugins/tomcat/geronimo-tomcat7/src/main/java/org/apache/geronimo/tomcat/TomcatContainer.java
Thu Jan 27 19:34:26 2011
@@ -280,6 +280,9 @@ public class TomcatContainer implements 
                                                  contextInfo.getBundle().getBundleContext());
         context.getServletContext().setAttribute(WebAttributeName.WEB_APP_INFO.name(), contextInfo.getWebAppInfo());
 
+        context.getServletContext().setAttribute("org.springframework.osgi.web." + BundleContext.class.getName(),

+                                                 contextInfo.getBundle().getBundleContext());
+
         // now set the module context ValidatorFactory in a context property.
         try {
             javax.naming.Context ctx = contextInfo.getJndiContext();



Mime
View raw message