Return-Path: Delivered-To: apmail-geronimo-scm-archive@www.apache.org Received: (qmail 74700 invoked from network); 24 Jan 2010 03:58:49 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 24 Jan 2010 03:58:49 -0000 Received: (qmail 76017 invoked by uid 500); 24 Jan 2010 03:58:49 -0000 Delivered-To: apmail-geronimo-scm-archive@geronimo.apache.org Received: (qmail 75897 invoked by uid 500); 24 Jan 2010 03:58:49 -0000 Mailing-List: contact scm-help@geronimo.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: List-Post: Reply-To: dev@geronimo.apache.org List-Id: Delivered-To: mailing list scm@geronimo.apache.org Received: (qmail 75888 invoked by uid 99); 24 Jan 2010 03:58:48 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 24 Jan 2010 03:58:48 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 24 Jan 2010 03:58:46 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 36FDB23889B1; Sun, 24 Jan 2010 03:58:26 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r902527 - in /geronimo/server/trunk/plugins: ./ connector-1_6/transaction-1_6/src/main/history/ j2ee/geronimo-j2ee/ j2ee/geronimo-j2ee/src/main/java/org/apache/geronimo/j2ee/jndi/ j2ee/geronimo-web-2.5-builder/src/main/java/org/apache/geron... Date: Sun, 24 Jan 2010 03:58:25 -0000 To: scm@geronimo.apache.org From: djencks@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20100124035826.36FDB23889B1@eris.apache.org> Author: djencks Date: Sun Jan 24 03:58:24 2010 New Revision: 902527 URL: http://svn.apache.org/viewvc?rev=902527&view=rev Log: GERONIMO-4996 GERONIMO-5025 separate jndi context setup from web app context since jsf needs it too. Hook up myfaces which now starts. Don't know if myfaces works Added: geronimo/server/trunk/plugins/j2ee/geronimo-j2ee/src/main/java/org/apache/geronimo/j2ee/jndi/ContextSource.java (with props) geronimo/server/trunk/plugins/j2ee/geronimo-j2ee/src/main/java/org/apache/geronimo/j2ee/jndi/WebContextSource.java (with props) Modified: geronimo/server/trunk/plugins/connector-1_6/transaction-1_6/src/main/history/dependencies.xml geronimo/server/trunk/plugins/j2ee/geronimo-j2ee/pom.xml geronimo/server/trunk/plugins/j2ee/geronimo-web-2.5-builder/src/main/java/org/apache/geronimo/web25/deployment/AbstractWebModuleBuilder.java geronimo/server/trunk/plugins/j2ee/j2ee-server/src/main/history/dependencies.xml geronimo/server/trunk/plugins/jetty8/geronimo-jetty8-builder/src/main/java/org/apache/geronimo/jetty8/deployment/JettyModuleBuilder.java geronimo/server/trunk/plugins/jetty8/geronimo-jetty8/src/main/java/org/apache/geronimo/jetty8/WebAppContextWrapper.java geronimo/server/trunk/plugins/jetty8/geronimo-jetty8/src/test/java/org/apache/geronimo/jetty8/AbstractWebModuleTest.java geronimo/server/trunk/plugins/myfaces/geronimo-myfaces-builder/src/main/java/org/apache/geronimo/myfaces/deployment/MyFacesModuleBuilderExtension.java geronimo/server/trunk/plugins/myfaces/geronimo-myfaces/src/main/java/org/apache/geronimo/myfaces/LifecycleProviderGBean.java geronimo/server/trunk/plugins/myfaces/geronimo-myfaces/src/test/java/org/apache/geronimo/myfaces/BasicTest.java geronimo/server/trunk/plugins/myfaces/myfaces/src/main/history/dependencies.xml geronimo/server/trunk/plugins/pom.xml geronimo/server/trunk/plugins/tomcat/geronimo-tomcat7/src/main/java/org/apache/geronimo/tomcat/TomcatWebAppContext.java geronimo/server/trunk/plugins/tomcat/geronimo-tomcat7/src/test/java/org/apache/geronimo/tomcat/AbstractWebModuleTest.java Modified: geronimo/server/trunk/plugins/connector-1_6/transaction-1_6/src/main/history/dependencies.xml URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/connector-1_6/transaction-1_6/src/main/history/dependencies.xml?rev=902527&r1=902526&r2=902527&view=diff ============================================================================== --- geronimo/server/trunk/plugins/connector-1_6/transaction-1_6/src/main/history/dependencies.xml (original) +++ geronimo/server/trunk/plugins/connector-1_6/transaction-1_6/src/main/history/dependencies.xml Sun Jan 24 03:58:24 2010 @@ -12,11 +12,6 @@ jar - org.apache.geronimo.components - geronimo-transaction - jar - - org.apache.geronimo.configs j2ee-server car Modified: geronimo/server/trunk/plugins/j2ee/geronimo-j2ee/pom.xml URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/j2ee/geronimo-j2ee/pom.xml?rev=902527&r1=902526&r2=902527&view=diff ============================================================================== --- geronimo/server/trunk/plugins/j2ee/geronimo-j2ee/pom.xml (original) +++ geronimo/server/trunk/plugins/j2ee/geronimo-j2ee/pom.xml Sun Jan 24 03:58:24 2010 @@ -54,6 +54,11 @@ + org.apache.geronimo.components + geronimo-transaction + + + org.apache.geronimo.framework geronimo-kernel ${version} Added: geronimo/server/trunk/plugins/j2ee/geronimo-j2ee/src/main/java/org/apache/geronimo/j2ee/jndi/ContextSource.java URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/j2ee/geronimo-j2ee/src/main/java/org/apache/geronimo/j2ee/jndi/ContextSource.java?rev=902527&view=auto ============================================================================== --- geronimo/server/trunk/plugins/j2ee/geronimo-j2ee/src/main/java/org/apache/geronimo/j2ee/jndi/ContextSource.java (added) +++ geronimo/server/trunk/plugins/j2ee/geronimo-j2ee/src/main/java/org/apache/geronimo/j2ee/jndi/ContextSource.java Sun Jan 24 03:58:24 2010 @@ -0,0 +1,32 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + + +package org.apache.geronimo.j2ee.jndi; + +import javax.naming.Context; + +/** + * @version $Rev$ $Date$ + */ +public interface ContextSource { + + Context getContext(); + +} Propchange: geronimo/server/trunk/plugins/j2ee/geronimo-j2ee/src/main/java/org/apache/geronimo/j2ee/jndi/ContextSource.java ------------------------------------------------------------------------------ svn:eol-style = native Propchange: geronimo/server/trunk/plugins/j2ee/geronimo-j2ee/src/main/java/org/apache/geronimo/j2ee/jndi/ContextSource.java ------------------------------------------------------------------------------ svn:keywords = Date Revision Propchange: geronimo/server/trunk/plugins/j2ee/geronimo-j2ee/src/main/java/org/apache/geronimo/j2ee/jndi/ContextSource.java ------------------------------------------------------------------------------ svn:mime-type = text/plain Added: geronimo/server/trunk/plugins/j2ee/geronimo-j2ee/src/main/java/org/apache/geronimo/j2ee/jndi/WebContextSource.java URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/j2ee/geronimo-j2ee/src/main/java/org/apache/geronimo/j2ee/jndi/WebContextSource.java?rev=902527&view=auto ============================================================================== --- geronimo/server/trunk/plugins/j2ee/geronimo-j2ee/src/main/java/org/apache/geronimo/j2ee/jndi/WebContextSource.java (added) +++ geronimo/server/trunk/plugins/j2ee/geronimo-j2ee/src/main/java/org/apache/geronimo/j2ee/jndi/WebContextSource.java Sun Jan 24 03:58:24 2010 @@ -0,0 +1,71 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + + +package org.apache.geronimo.j2ee.jndi; + +import org.apache.geronimo.transaction.GeronimoUserTransaction; +import org.apache.geronimo.gbean.annotation.GBean; +import org.apache.geronimo.gbean.annotation.ParamAttribute; +import org.apache.geronimo.gbean.annotation.ParamReference; +import org.apache.geronimo.gbean.annotation.ParamSpecial; +import org.apache.geronimo.gbean.annotation.SpecialAttributeType; +import org.apache.geronimo.kernel.Kernel; +import org.apache.geronimo.naming.enc.EnterpriseNamingContext; + +import javax.naming.Context; +import javax.naming.NamingException; +import javax.transaction.TransactionManager; +import java.util.LinkedHashSet; +import java.util.Map; +import java.util.Set; + +/** + * @version $Rev$ $Date$ + */ +@GBean +public class WebContextSource implements ContextSource { + + private final Context context; + + public WebContextSource(@ParamAttribute(name = "componentContext") Map componentContext, + @ParamReference(name = "TransactionManager") TransactionManager transactionManager, + @ParamReference(name = "ApplicationJndi") ApplicationJndi applicationJndi, + @ParamSpecial(type = SpecialAttributeType.classLoader) ClassLoader classLoader, + @ParamSpecial(type = SpecialAttributeType.kernel) Kernel kernel) throws NamingException { + GeronimoUserTransaction userTransaction = new GeronimoUserTransaction(transactionManager); + Set contexts = new LinkedHashSet(3); + Context localContext = EnterpriseNamingContext.livenReferences(componentContext, userTransaction, kernel, classLoader, "comp/"); + contexts.add(localContext); + if (applicationJndi != null) { + if (applicationJndi.getApplicationContext() != null) { + contexts.add(applicationJndi.getApplicationContext()); + } + if (applicationJndi.getGlobalContext() != null) { + contexts.add(applicationJndi.getGlobalContext()); + } + } + this.context = EnterpriseNamingContext.createEnterpriseNamingContext(contexts); + } + + @Override + public Context getContext() { + return context; + } +} Propchange: geronimo/server/trunk/plugins/j2ee/geronimo-j2ee/src/main/java/org/apache/geronimo/j2ee/jndi/WebContextSource.java ------------------------------------------------------------------------------ svn:eol-style = native Propchange: geronimo/server/trunk/plugins/j2ee/geronimo-j2ee/src/main/java/org/apache/geronimo/j2ee/jndi/WebContextSource.java ------------------------------------------------------------------------------ svn:keywords = Date Revision Propchange: geronimo/server/trunk/plugins/j2ee/geronimo-j2ee/src/main/java/org/apache/geronimo/j2ee/jndi/WebContextSource.java ------------------------------------------------------------------------------ svn:mime-type = text/plain Modified: geronimo/server/trunk/plugins/j2ee/geronimo-web-2.5-builder/src/main/java/org/apache/geronimo/web25/deployment/AbstractWebModuleBuilder.java URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/j2ee/geronimo-web-2.5-builder/src/main/java/org/apache/geronimo/web25/deployment/AbstractWebModuleBuilder.java?rev=902527&r1=902526&r2=902527&view=diff ============================================================================== --- geronimo/server/trunk/plugins/j2ee/geronimo-web-2.5-builder/src/main/java/org/apache/geronimo/web25/deployment/AbstractWebModuleBuilder.java (original) +++ geronimo/server/trunk/plugins/j2ee/geronimo-web-2.5-builder/src/main/java/org/apache/geronimo/web25/deployment/AbstractWebModuleBuilder.java Sun Jan 24 03:58:24 2010 @@ -45,6 +45,7 @@ import org.apache.geronimo.j2ee.j2eeobjectnames.NameFactory; import org.apache.geronimo.j2ee.jndi.JndiKey; import org.apache.geronimo.j2ee.jndi.JndiScope; +import org.apache.geronimo.j2ee.jndi.WebContextSource; import org.apache.geronimo.kernel.GBeanAlreadyExistsException; import org.apache.geronimo.kernel.Kernel; import org.apache.geronimo.kernel.Naming; @@ -730,7 +731,18 @@ if (jndiContext.get(JndiScope.module) != null) { compContext.putAll(jndiContext.get(JndiScope.module)); } - + AbstractName contextSourceName = moduleContext.getNaming().createChildName(webModuleData.getAbstractName(), "ContextSource", "ContextSource"); + GBeanData contextSourceData = new GBeanData(contextSourceName, WebContextSource.class); + contextSourceData.setAttribute("componentContext", compContext); + contextSourceData.setReferencePattern("ApplicationJndi", (AbstractName)earContext.getGeneralData().get(EARContext.APPLICATION_JNDI_NAME_KEY)); + contextSourceData.setReferencePattern("TransactionManager", moduleContext.getTransactionManagerName()); + try { + moduleContext.addGBean(contextSourceData); + } catch (GBeanAlreadyExistsException e) { + throw new DeploymentException("ContextSource for this webapp already present:" + webModuleData.getAbstractName(), e); + } + webModuleData.setReferencePattern("ContextSource", contextSourceName); + Holder holder = NamingBuilder.INJECTION_KEY.get(buildingContext); webModule.getSharedContext().put(WebModule.WEB_APP_DATA, webModuleData); @@ -752,8 +764,6 @@ addGBeanDependencies(earContext, webModuleData); } - webModuleData.setAttribute("componentContext", compContext); - webModuleData.setReferencePattern("ApplicationJndi", (AbstractName)earContext.getGeneralData().get(EARContext.APPLICATION_JNDI_NAME_KEY)); webModuleData.setReferencePattern("TransactionManager", moduleContext.getTransactionManagerName()); webModuleData.setReferencePattern("TrackedConnectionAssociator", moduleContext.getConnectionTrackerName()); webModuleData.setAttribute("modulePath", webModule.isStandAlone() || webModule.getEarContext() != webModule.getRootEarContext()? null: webModule.getTargetPath()); Modified: geronimo/server/trunk/plugins/j2ee/j2ee-server/src/main/history/dependencies.xml URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/j2ee/j2ee-server/src/main/history/dependencies.xml?rev=902527&r1=902526&r2=902527&view=diff ============================================================================== --- geronimo/server/trunk/plugins/j2ee/j2ee-server/src/main/history/dependencies.xml (original) +++ geronimo/server/trunk/plugins/j2ee/j2ee-server/src/main/history/dependencies.xml Sun Jan 24 03:58:24 2010 @@ -7,6 +7,11 @@ car + org.apache.geronimo.components + geronimo-transaction + jar + + org.apache.geronimo.framework rmi-naming car @@ -16,4 +21,9 @@ geronimo-j2ee jar + + org.apache.geronimo.specs + geronimo-j2ee-connector_1.6_spec + jar + Modified: geronimo/server/trunk/plugins/jetty8/geronimo-jetty8-builder/src/main/java/org/apache/geronimo/jetty8/deployment/JettyModuleBuilder.java URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/jetty8/geronimo-jetty8-builder/src/main/java/org/apache/geronimo/jetty8/deployment/JettyModuleBuilder.java?rev=902527&r1=902526&r2=902527&view=diff ============================================================================== --- geronimo/server/trunk/plugins/jetty8/geronimo-jetty8-builder/src/main/java/org/apache/geronimo/jetty8/deployment/JettyModuleBuilder.java (original) +++ geronimo/server/trunk/plugins/jetty8/geronimo-jetty8-builder/src/main/java/org/apache/geronimo/jetty8/deployment/JettyModuleBuilder.java Sun Jan 24 03:58:24 2010 @@ -21,22 +21,14 @@ import java.io.FileNotFoundException; import java.io.IOException; import java.io.Serializable; +import java.lang.String; import java.net.URL; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.Collection; -import java.util.Collections; -import java.util.Comparator; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; -import java.util.TreeSet; +import java.util.*; import java.util.jar.JarFile; import javax.management.ObjectName; import javax.servlet.Servlet; + import org.apache.geronimo.common.DeploymentException; import org.apache.geronimo.deployment.Deployable; import org.apache.geronimo.deployment.DeployableBundle; @@ -47,31 +39,12 @@ import org.apache.geronimo.deployment.service.EnvironmentBuilder; import org.apache.geronimo.deployment.xbeans.EnvironmentType; import org.apache.geronimo.deployment.xmlbeans.XmlBeansUtil; -import org.apache.geronimo.gbean.AbstractName; -import org.apache.geronimo.gbean.AbstractNameQuery; -import org.apache.geronimo.gbean.GBeanData; -import org.apache.geronimo.gbean.GBeanInfoBuilder; -import org.apache.geronimo.gbean.GBeanLifecycle; -import org.apache.geronimo.gbean.annotation.GBean; -import org.apache.geronimo.gbean.annotation.ParamAttribute; -import org.apache.geronimo.gbean.annotation.ParamReference; -import org.apache.geronimo.gbean.annotation.ParamSpecial; -import org.apache.geronimo.gbean.annotation.SpecialAttributeType; -import org.apache.geronimo.j2ee.deployment.EARContext; -import org.apache.geronimo.j2ee.deployment.Module; -import org.apache.geronimo.j2ee.deployment.ModuleBuilderExtension; -import org.apache.geronimo.j2ee.deployment.NamingBuilder; -import org.apache.geronimo.j2ee.deployment.WebModule; -import org.apache.geronimo.j2ee.deployment.WebServiceBuilder; +import org.apache.geronimo.gbean.*; +import org.apache.geronimo.gbean.annotation.*; +import org.apache.geronimo.j2ee.deployment.*; import org.apache.geronimo.j2ee.deployment.annotation.AnnotatedWebApp; import org.apache.geronimo.j2ee.j2eeobjectnames.NameFactory; -import org.apache.geronimo.jetty8.DefaultServletHolderWrapper; -import org.apache.geronimo.jetty8.FilterHolderWrapper; -import org.apache.geronimo.jetty8.Host; -import org.apache.geronimo.jetty8.JettyFilterMapping; -import org.apache.geronimo.jetty8.JspServletHolderWrapper; -import org.apache.geronimo.jetty8.ServletHolderWrapper; -import org.apache.geronimo.jetty8.WebAppContextWrapper; +import org.apache.geronimo.jetty8.*; import org.apache.geronimo.jetty8.security.AuthConfigProviderHandlerFactory; import org.apache.geronimo.jetty8.security.BuiltInAuthMethod; import org.apache.geronimo.jetty8.security.JettySecurityHandlerFactory; @@ -79,10 +52,7 @@ import org.apache.geronimo.kernel.GBeanNotFoundException; import org.apache.geronimo.kernel.Kernel; import org.apache.geronimo.kernel.Naming; -import org.apache.geronimo.kernel.repository.Artifact; -import org.apache.geronimo.kernel.repository.Dependency; import org.apache.geronimo.kernel.repository.Environment; -import org.apache.geronimo.kernel.repository.ImportType; import org.apache.geronimo.kernel.util.JarUtils; import org.apache.geronimo.naming.deployment.ENCConfigBuilder; import org.apache.geronimo.naming.deployment.GBeanResourceEnvironmentBuilder; @@ -103,26 +73,7 @@ import org.apache.geronimo.xbeans.geronimo.web.jetty.JettyWebAppDocument; import org.apache.geronimo.xbeans.geronimo.web.jetty.JettyWebAppType; import org.apache.geronimo.xbeans.geronimo.web.jetty.config.GerJettyDocument; -import org.apache.geronimo.xbeans.javaee.DispatcherType; -import org.apache.geronimo.xbeans.javaee.ErrorPageType; -import org.apache.geronimo.xbeans.javaee.FilterMappingType; -import org.apache.geronimo.xbeans.javaee.FilterType; -import org.apache.geronimo.xbeans.javaee.FormLoginConfigType; -import org.apache.geronimo.xbeans.javaee.JspConfigType; -import org.apache.geronimo.xbeans.javaee.JspPropertyGroupType; -import org.apache.geronimo.xbeans.javaee.ListenerType; -import org.apache.geronimo.xbeans.javaee.LocaleEncodingMappingListType; -import org.apache.geronimo.xbeans.javaee.LocaleEncodingMappingType; -import org.apache.geronimo.xbeans.javaee.LoginConfigType; -import org.apache.geronimo.xbeans.javaee.MimeMappingType; -import org.apache.geronimo.xbeans.javaee.ParamValueType; -import org.apache.geronimo.xbeans.javaee.ServletMappingType; -import org.apache.geronimo.xbeans.javaee.ServletType; -import org.apache.geronimo.xbeans.javaee.TaglibType; -import org.apache.geronimo.xbeans.javaee.UrlPatternType; -import org.apache.geronimo.xbeans.javaee.WebAppDocument; -import org.apache.geronimo.xbeans.javaee.WebAppType; -import org.apache.geronimo.xbeans.javaee.WelcomeFileListType; +import org.apache.geronimo.xbeans.javaee.*; import org.apache.xmlbeans.XmlException; import org.apache.xmlbeans.XmlObject; import org.osgi.framework.Bundle; Modified: geronimo/server/trunk/plugins/jetty8/geronimo-jetty8/src/main/java/org/apache/geronimo/jetty8/WebAppContextWrapper.java URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/jetty8/geronimo-jetty8/src/main/java/org/apache/geronimo/jetty8/WebAppContextWrapper.java?rev=902527&r1=902526&r2=902527&view=diff ============================================================================== --- geronimo/server/trunk/plugins/jetty8/geronimo-jetty8/src/main/java/org/apache/geronimo/jetty8/WebAppContextWrapper.java (original) +++ geronimo/server/trunk/plugins/jetty8/geronimo-jetty8/src/main/java/org/apache/geronimo/jetty8/WebAppContextWrapper.java Sun Jan 24 03:58:24 2010 @@ -25,6 +25,7 @@ import javax.naming.Context; import javax.security.auth.Subject; import javax.transaction.TransactionManager; +import javax.transaction.UserTransaction; import org.apache.geronimo.connector.outbound.connectiontracking.TrackedConnectionAssociator; import org.apache.geronimo.gbean.GBeanLifecycle; @@ -37,7 +38,7 @@ import org.apache.geronimo.j2ee.annotation.Holder; import org.apache.geronimo.j2ee.annotation.LifecycleMethod; import org.apache.geronimo.j2ee.j2eeobjectnames.NameFactory; -import org.apache.geronimo.j2ee.jndi.ApplicationJndi; +import org.apache.geronimo.j2ee.jndi.ContextSource; import org.apache.geronimo.j2ee.management.impl.InvalidObjectNameException; import org.apache.geronimo.jetty8.handler.GeronimoWebAppContext; import org.apache.geronimo.jetty8.handler.IntegrationContext; @@ -48,7 +49,6 @@ import org.apache.geronimo.management.J2EEServer; import org.apache.geronimo.management.geronimo.WebContainer; import org.apache.geronimo.management.geronimo.WebModule; -import org.apache.geronimo.naming.enc.EnterpriseNamingContext; import org.apache.geronimo.security.jacc.RunAsSource; import org.apache.geronimo.transaction.GeronimoUserTransaction; import org.eclipse.jetty.http.MimeTypes; @@ -100,7 +100,6 @@ @ParamAttribute(name = "contextPath") String contextPath, @ParamAttribute(name = "deploymentDescriptor") String originalSpecDD, @ParamAttribute(name = "modulePath") String modulePath, - @ParamAttribute(name = "componentContext") Map componentContext, @ParamSpecial(type = SpecialAttributeType.classLoader) ClassLoader classLoader, @ParamSpecial(type = SpecialAttributeType.bundle) Bundle bundle, @ParamAttribute(name = "configurationBaseUrl") URL configurationBaseUrl, @@ -129,20 +128,19 @@ @ParamAttribute(name = "holder") Holder holder, @ParamReference(name = "Host") Host host, - @ParamReference(name = "TransactionManager") TransactionManager transactionManager, @ParamReference(name = "TrackedConnectionAssociator") TrackedConnectionAssociator trackedConnectionAssociator, @ParamReference(name = "JettyContainer") JettyContainer jettyContainer, @ParamReference(name = "ContextCustomizer") RuntimeCustomizer contextCustomizer, @ParamReference(name = "J2EEServer") J2EEServer server, @ParamReference(name = "J2EEApplication") J2EEApplication application, - @ParamReference(name = "ApplicationJndi") ApplicationJndi applicationJndi, + @ParamReference(name = "ContextSource") ContextSource contextSource, + @ParamReference(name = "TransactionManager") TransactionManager transactionManager, @ParamSpecial(type = SpecialAttributeType.kernel) Kernel kernel) throws Exception { - assert componentContext != null; + assert contextSource != null; assert classLoader != null; assert configurationBaseUrl != null; - assert transactionManager != null; assert trackedConnectionAssociator != null; assert jettyContainer != null; if (contextPath == null || !contextPath.startsWith("/")) { @@ -178,20 +176,8 @@ ServletHandler servletHandler = new ServletHandler(); - //wrap the web app context with the jndi handler - GeronimoUserTransaction userTransaction = new GeronimoUserTransaction(transactionManager); - Set contexts = new LinkedHashSet(3); - Context localContext = EnterpriseNamingContext.livenReferences(componentContext, userTransaction, kernel, classLoader, "comp/"); - contexts.add(localContext); - if (applicationJndi != null) { - if (applicationJndi.getApplicationContext() != null) { - contexts.add(applicationJndi.getApplicationContext()); - } - if (applicationJndi.getGlobalContext() != null) { - contexts.add(applicationJndi.getGlobalContext()); - } - } - this.componentContext = EnterpriseNamingContext.createEnterpriseNamingContext(contexts); + this.componentContext = contextSource.getContext(); + UserTransaction userTransaction = new GeronimoUserTransaction(transactionManager); integrationContext = new IntegrationContext(this.componentContext, unshareableResources, applicationManagedSecurityResources, trackedConnectionAssociator, userTransaction, bundle); webAppContext = new GeronimoWebAppContext(securityHandler, sessionHandler, servletHandler, null, integrationContext, classLoader, modulePath); webAppContext.setContextPath(contextPath); Modified: geronimo/server/trunk/plugins/jetty8/geronimo-jetty8/src/test/java/org/apache/geronimo/jetty8/AbstractWebModuleTest.java URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/jetty8/geronimo-jetty8/src/test/java/org/apache/geronimo/jetty8/AbstractWebModuleTest.java?rev=902527&r1=902526&r2=902527&view=diff ============================================================================== --- geronimo/server/trunk/plugins/jetty8/geronimo-jetty8/src/test/java/org/apache/geronimo/jetty8/AbstractWebModuleTest.java (original) +++ geronimo/server/trunk/plugins/jetty8/geronimo-jetty8/src/test/java/org/apache/geronimo/jetty8/AbstractWebModuleTest.java Sun Jan 24 03:58:24 2010 @@ -37,6 +37,8 @@ import org.apache.geronimo.connector.outbound.connectiontracking.ConnectionTrackingCoordinator; import org.apache.geronimo.connector.outbound.connectiontracking.GeronimoTransactionListener; +import org.apache.geronimo.j2ee.jndi.ContextSource; +import org.apache.geronimo.j2ee.jndi.WebContextSource; import org.apache.geronimo.jetty8.connector.HTTPSocketConnector; import org.apache.geronimo.jetty8.security.SecurityHandlerFactory; import org.apache.geronimo.jetty8.security.ServerAuthenticationGBean; @@ -139,11 +141,15 @@ }, loginService); } String contextPath = "/test"; + ContextSource contextSource = new WebContextSource(Collections.emptyMap(), + transactionManager, + null, + cl, + null); WebAppContextWrapper app = new WebAppContextWrapper(null, contextPath, null, null, - Collections.emptyMap(), cl, bundle, new URL(configurationBaseURL, uriString), @@ -167,13 +173,13 @@ runAsSource, null, null, - transactionManager, connectionTrackingCoordinator, container, null, null, null, - null, null); + contextSource, + transactionManager, null); app.doStart(); return app; } Modified: geronimo/server/trunk/plugins/myfaces/geronimo-myfaces-builder/src/main/java/org/apache/geronimo/myfaces/deployment/MyFacesModuleBuilderExtension.java URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/myfaces/geronimo-myfaces-builder/src/main/java/org/apache/geronimo/myfaces/deployment/MyFacesModuleBuilderExtension.java?rev=902527&r1=902526&r2=902527&view=diff ============================================================================== --- geronimo/server/trunk/plugins/myfaces/geronimo-myfaces-builder/src/main/java/org/apache/geronimo/myfaces/deployment/MyFacesModuleBuilderExtension.java (original) +++ geronimo/server/trunk/plugins/myfaces/geronimo-myfaces-builder/src/main/java/org/apache/geronimo/myfaces/deployment/MyFacesModuleBuilderExtension.java Sun Jan 24 03:58:24 2010 @@ -46,6 +46,7 @@ import org.apache.geronimo.j2ee.deployment.NamingBuilder; import org.apache.geronimo.j2ee.deployment.WebModule; import org.apache.geronimo.j2ee.j2eeobjectnames.NameFactory; +import org.apache.geronimo.j2ee.jndi.JndiKey; import org.apache.geronimo.kernel.GBeanAlreadyExistsException; import org.apache.geronimo.kernel.Naming; import org.apache.geronimo.kernel.config.Configuration; @@ -146,7 +147,7 @@ buildingContext.put(NamingBuilder.GBEAN_NAME_KEY, moduleName); //use the same jndi context as the web app - Map compContext = NamingBuilder.JNDI_KEY.get(module.getSharedContext()); + Map> compContext = NamingBuilder.JNDI_KEY.get(module.getSharedContext()); buildingContext.put(NamingBuilder.JNDI_KEY, compContext); //use the same holder object as the web app. @@ -155,7 +156,7 @@ XmlObject jettyWebApp = webModule.getVendorDD(); - Configuration earConfiguration = earContext.getConfiguration(); +// Configuration earConfiguration = earContext.getConfiguration(); ClassFinder classFinder = createMyFacesClassFinder(webApp, webModule); webModule.setClassFinder(classFinder); @@ -163,9 +164,9 @@ namingBuilders.buildNaming(webApp, jettyWebApp, webModule, buildingContext); AbstractName providerName = moduleContext.getNaming().createChildName(moduleName, "jsf-lifecycle", "jsf"); - GBeanData providerData = new GBeanData(providerName, LifecycleProviderGBean.GBEAN_INFO); + GBeanData providerData = new GBeanData(providerName, LifecycleProviderGBean.class); providerData.setAttribute("holder", holder); - providerData.setAttribute("componentContext", compContext); + providerData.setReferencePatterns("ContextSource", webAppData.getReferencePatterns("ContextSource")); providerData.setReferencePattern("LifecycleProviderFactory", providerFactoryNameQuery); try { moduleContext.addGBean(providerData); Modified: geronimo/server/trunk/plugins/myfaces/geronimo-myfaces/src/main/java/org/apache/geronimo/myfaces/LifecycleProviderGBean.java URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/myfaces/geronimo-myfaces/src/main/java/org/apache/geronimo/myfaces/LifecycleProviderGBean.java?rev=902527&r1=902526&r2=902527&view=diff ============================================================================== --- geronimo/server/trunk/plugins/myfaces/geronimo-myfaces/src/main/java/org/apache/geronimo/myfaces/LifecycleProviderGBean.java (original) +++ geronimo/server/trunk/plugins/myfaces/geronimo-myfaces/src/main/java/org/apache/geronimo/myfaces/LifecycleProviderGBean.java Sun Jan 24 03:58:24 2010 @@ -26,10 +26,11 @@ import javax.naming.NamingException; import javax.naming.Context; +import org.apache.geronimo.gbean.annotation.*; import org.apache.myfaces.config.annotation.LifecycleProvider; import org.apache.geronimo.j2ee.annotation.Holder; import org.apache.geronimo.j2ee.annotation.LifecycleMethod; -import org.apache.geronimo.j2ee.j2eeobjectnames.NameFactory; +import org.apache.geronimo.j2ee.jndi.ContextSource; import org.apache.geronimo.gbean.GBeanLifecycle; import org.apache.geronimo.gbean.GBeanInfo; import org.apache.geronimo.gbean.GBeanInfoBuilder; @@ -39,6 +40,7 @@ /** * @version $Rev$ $Date$ */ +@GBean public class LifecycleProviderGBean implements LifecycleProvider, GBeanLifecycle { private final Holder holder; @@ -47,10 +49,14 @@ private final ClassLoader classLoader; - public LifecycleProviderGBean(Holder holder, Map componentContext, LifecycleProviderFactorySource factory, Kernel kernel, ClassLoader classLoader) throws NamingException { + public LifecycleProviderGBean(@ParamAttribute(name="holder") Holder holder, + @ParamReference(name="ContextSource", namingType = "Context") ContextSource contextSource, + @ParamReference(name="LifecycleProviderFactory") LifecycleProviderFactorySource factory, + @ParamSpecial(type = SpecialAttributeType.kernel)Kernel kernel, + @ParamSpecial(type=SpecialAttributeType.classLoader)ClassLoader classLoader) throws NamingException { this.holder = holder; // GeronimoUserTransaction userTransaction = new GeronimoUserTransaction(transactionManager); - context = EnterpriseNamingContext.createEnterpriseNamingContext(componentContext, null, kernel, classLoader); + context = contextSource.getContext(); this.factory = factory.getLifecycleProviderFactory(); this.classLoader = classLoader; } @@ -84,24 +90,4 @@ doStop(); } - public static final GBeanInfo GBEAN_INFO; - - static { - GBeanInfoBuilder infoBuilder = GBeanInfoBuilder.createStatic(LifecycleProviderGBean.class, GBeanInfoBuilder.DEFAULT_J2EE_TYPE); - infoBuilder.addAttribute("holder", Holder.class, true); - infoBuilder.addAttribute("componentContext", Map.class, true); - - infoBuilder.addReference("LifecycleProviderFactory", LifecycleProviderFactorySource.class); -// infoBuilder.addReference("TransactionManager", TransactionManager.class); - infoBuilder.addAttribute("kernel", Kernel.class, false); - infoBuilder.addAttribute("classLoader", ClassLoader.class, false); - - infoBuilder.setConstructor(new String[] {"holder", "componentContext", "LifecycleProviderFactory", "kernel", "classLoader"}); - - GBEAN_INFO = infoBuilder.getBeanInfo(); - } - - public static GBeanInfo getGBeanInfo() { - return GBEAN_INFO; - } } Modified: geronimo/server/trunk/plugins/myfaces/geronimo-myfaces/src/test/java/org/apache/geronimo/myfaces/BasicTest.java URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/myfaces/geronimo-myfaces/src/test/java/org/apache/geronimo/myfaces/BasicTest.java?rev=902527&r1=902526&r2=902527&view=diff ============================================================================== --- geronimo/server/trunk/plugins/myfaces/geronimo-myfaces/src/test/java/org/apache/geronimo/myfaces/BasicTest.java (original) +++ geronimo/server/trunk/plugins/myfaces/geronimo-myfaces/src/test/java/org/apache/geronimo/myfaces/BasicTest.java Sun Jan 24 03:58:24 2010 @@ -21,6 +21,7 @@ package org.apache.geronimo.myfaces; import junit.framework.TestCase; +import org.apache.geronimo.gbean.GBeanData; import org.apache.geronimo.gbean.GBeanInfo; /** @@ -36,7 +37,7 @@ } public void testLifecycleProvider() throws Exception { - GBeanInfo gBeanInfo = LifecycleProviderGBean.getGBeanInfo(); + GBeanData gBeanInfo = new GBeanData(LifecycleProviderGBean.class); } } Modified: geronimo/server/trunk/plugins/myfaces/myfaces/src/main/history/dependencies.xml URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/myfaces/myfaces/src/main/history/dependencies.xml?rev=902527&r1=902526&r2=902527&view=diff ============================================================================== --- geronimo/server/trunk/plugins/myfaces/myfaces/src/main/history/dependencies.xml (original) +++ geronimo/server/trunk/plugins/myfaces/myfaces/src/main/history/dependencies.xml Sun Jan 24 03:58:24 2010 @@ -1,5 +1,5 @@ - + org.apache.geronimo.configs myfaces @@ -43,12 +43,12 @@ org.apache.geronimo.specs - geronimo-el_1.0_spec + geronimo-el_2.2_spec jar org.apache.geronimo.specs - geronimo-jsp_2.1-MR2_spec + geronimo-jsp_2.2_spec jar Modified: geronimo/server/trunk/plugins/pom.xml URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/pom.xml?rev=902527&r1=902526&r2=902527&view=diff ============================================================================== --- geronimo/server/trunk/plugins/pom.xml (original) +++ geronimo/server/trunk/plugins/pom.xml Sun Jan 24 03:58:24 2010 @@ -120,7 +120,7 @@ jasper javamail jaxws - + myfaces openejb openjpa2 Modified: geronimo/server/trunk/plugins/tomcat/geronimo-tomcat7/src/main/java/org/apache/geronimo/tomcat/TomcatWebAppContext.java URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/tomcat/geronimo-tomcat7/src/main/java/org/apache/geronimo/tomcat/TomcatWebAppContext.java?rev=902527&r1=902526&r2=902527&view=diff ============================================================================== --- geronimo/server/trunk/plugins/tomcat/geronimo-tomcat7/src/main/java/org/apache/geronimo/tomcat/TomcatWebAppContext.java (original) +++ geronimo/server/trunk/plugins/tomcat/geronimo-tomcat7/src/main/java/org/apache/geronimo/tomcat/TomcatWebAppContext.java Sun Jan 24 03:58:24 2010 @@ -56,6 +56,7 @@ import org.apache.geronimo.j2ee.RuntimeCustomizer; import org.apache.geronimo.j2ee.annotation.Holder; import org.apache.geronimo.j2ee.j2eeobjectnames.NameFactory; +import org.apache.geronimo.j2ee.jndi.ContextSource; import org.apache.geronimo.j2ee.management.impl.InvalidObjectNameException; import org.apache.geronimo.kernel.Kernel; import org.apache.geronimo.kernel.ObjectNameUtil; @@ -143,7 +144,6 @@ @ParamAttribute(name = "modulePath") String modulePath, @ParamAttribute(name = "securityHolder") SecurityHolder securityHolder, @ParamAttribute(name = "virtualServer") String virtualServer, - @ParamAttribute(name = "componentContext") Map componentContext, @ParamAttribute(name = "unshareableResources") Set unshareableResources, @ParamAttribute(name = "applicationManagedSecurityResources") Set applicationManagedSecurityResources, @ParamReference(name = "TransactionManager") TransactionManager transactionManager, @@ -166,7 +166,7 @@ @ParamReference(name = "ContextCustomizer") RuntimeCustomizer contextCustomizer, @ParamReference(name = "J2EEServer") J2EEServer server, @ParamReference(name = "J2EEApplication") J2EEApplication application, - @ParamReference(name = "ApplicationJndi") ApplicationJndi applicationJndi, + @ParamReference(name = "ContextSource") ContextSource contextSource, @ParamSpecial(type = SpecialAttributeType.kernel) Kernel kernel) throws Exception { assert classLoader != null; @@ -175,7 +175,7 @@ assert modulePath != null; assert transactionManager != null; assert trackedConnectionAssociator != null; - assert componentContext != null; + assert contextSource != null; assert container != null; if (null != clusteredValveRetriever) { @@ -202,19 +202,8 @@ this.virtualServer = virtualServer; this.securityHolder = securityHolder; - userTransaction = new GeronimoUserTransaction(transactionManager); - Set contexts = new LinkedHashSet(3); - javax.naming.Context localContext = EnterpriseNamingContext.livenReferences(componentContext, userTransaction, kernel, classLoader, "comp/"); - contexts.add(localContext); - if (applicationJndi != null) { - if (applicationJndi.getApplicationContext() != null) { - contexts.add(applicationJndi.getApplicationContext()); - } - if (applicationJndi.getGlobalContext() != null) { - contexts.add(applicationJndi.getGlobalContext()); - } - } - this.componentContext = EnterpriseNamingContext.createEnterpriseNamingContext(contexts); + this.componentContext = contextSource.getContext(); + this.userTransaction = new GeronimoUserTransaction(transactionManager); this.unshareableResources = unshareableResources; this.applicationManagedSecurityResources = applicationManagedSecurityResources; Modified: geronimo/server/trunk/plugins/tomcat/geronimo-tomcat7/src/test/java/org/apache/geronimo/tomcat/AbstractWebModuleTest.java URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/tomcat/geronimo-tomcat7/src/test/java/org/apache/geronimo/tomcat/AbstractWebModuleTest.java?rev=902527&r1=902526&r2=902527&view=diff ============================================================================== --- geronimo/server/trunk/plugins/tomcat/geronimo-tomcat7/src/test/java/org/apache/geronimo/tomcat/AbstractWebModuleTest.java (original) +++ geronimo/server/trunk/plugins/tomcat/geronimo-tomcat7/src/test/java/org/apache/geronimo/tomcat/AbstractWebModuleTest.java Sun Jan 24 03:58:24 2010 @@ -18,6 +18,8 @@ import org.apache.geronimo.connector.outbound.connectiontracking.ConnectionTrackingCoordinator; import org.apache.geronimo.connector.outbound.connectiontracking.GeronimoTransactionListener; +import org.apache.geronimo.j2ee.jndi.ContextSource; +import org.apache.geronimo.j2ee.jndi.WebContextSource; import org.apache.geronimo.kernel.config.ConfigurationData; import org.apache.geronimo.kernel.osgi.MockBundleContext; import org.apache.geronimo.kernel.repository.Artifact; @@ -77,6 +79,11 @@ URI locationURI = configurationBaseURL.toURI().resolve(relativeWebAppRoot); MockBundleContext bundleContext = new MockBundleContext(getClass().getClassLoader(), locationURI.toString(), new HashMap(), null); bundle = bundleContext.getBundle(); + ContextSource contextSource = new WebContextSource(Collections.emptyMap(), + transactionManager, + null, + cl, + null); TomcatWebAppContext app = new TomcatWebAppContext(cl, bundle, null, @@ -86,7 +93,6 @@ "", securityHolder, null, - Collections.EMPTY_MAP, null, null, transactionManager, @@ -109,7 +115,8 @@ null, null, null, - null, null); + contextSource, + null); app.doStart(); return app; }