geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From djen...@apache.org
Subject svn commit: r513564 [3/3] - in /geronimo/server/trunk/modules: geronimo-axis-builder/src/test/java/org/apache/geronimo/axis/builder/ geronimo-client-builder/src/main/java/org/apache/geronimo/client/builder/ geronimo-connector-builder/src/main/java/org/...
Date Fri, 02 Mar 2007 00:49:52 GMT
Modified: geronimo/server/trunk/modules/geronimo-jetty6-builder/src/main/java/org/apache/geronimo/jetty6/deployment/JettyModuleBuilder.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-jetty6-builder/src/main/java/org/apache/geronimo/jetty6/deployment/JettyModuleBuilder.java?view=diff&rev=513564&r1=513563&r2=513564
==============================================================================
--- geronimo/server/trunk/modules/geronimo-jetty6-builder/src/main/java/org/apache/geronimo/jetty6/deployment/JettyModuleBuilder.java
(original)
+++ geronimo/server/trunk/modules/geronimo-jetty6-builder/src/main/java/org/apache/geronimo/jetty6/deployment/JettyModuleBuilder.java
Thu Mar  1 16:49:50 2007
@@ -57,6 +57,7 @@
 import org.apache.geronimo.gbean.GBeanData;
 import org.apache.geronimo.gbean.GBeanInfo;
 import org.apache.geronimo.gbean.GBeanInfoBuilder;
+import org.apache.geronimo.j2ee.deployment.annotation.AnnotatedWebApp;
 import org.apache.geronimo.j2ee.deployment.EARContext;
 import org.apache.geronimo.j2ee.deployment.Module;
 import org.apache.geronimo.j2ee.deployment.ModuleBuilder;
@@ -116,6 +117,7 @@
 import org.mortbay.jetty.security.ClientCertAuthenticator;
 import org.mortbay.jetty.security.DigestAuthenticator;
 import org.mortbay.jetty.security.FormAuthenticator;
+import org.apache.geronimo.j2ee.deployment.annotation.AnnotatedWebApp;
 
 
 /**
@@ -193,22 +195,22 @@
             // read in the entire specDD as a string, we need this for getDeploymentDescriptor
             // on the J2ee management object
             specDD = DeploymentUtil.readAll(specDDUrl);
-            
+
             // we found web.xml, if it won't parse that's an error.
             XmlObject parsed = XmlBeansUtil.parse(specDD);
             WebAppDocument webAppDoc = convertToServletSchema(parsed);
             webApp = webAppDoc.getWebApp();
             check(webApp);
         } catch (XmlException e) {
-        	// Output the target path in the error to make it clearer to the user which webapp
+            // Output the target path in the error to make it clearer to the user which webapp
             // has the problem.  The targetPath is used, as moduleFile may have an unhelpful
             // value such as C:\geronimo-1.1\var\temp\geronimo-deploymentUtil22826.tmpdir
             throw new DeploymentException("Error parsing web.xml for " + targetPath, e);
         } catch (Exception e) {
-        	if(!moduleFile.getName().endsWith(".war")) {
-        		//not for us
-        		return null;
-        	} 
+            if(!moduleFile.getName().endsWith(".war")) {
+                //not for us
+                return null;
+            }
             //else ignore as jee5 allows optional spec dd for .war's
         }
 
@@ -247,7 +249,10 @@
             moduleName = naming.createChildName(earName, targetPath, NameFactory.WEB_MODULE);
         }
 
-        return new WebModule(standAlone, moduleName, environment, moduleFile, targetPath,
webApp, jettyWebApp, specDD, contextRoot, new HashMap(), JETTY_NAMESPACE);
+        // Create the AnnotatedApp interface for the WebModule
+        AnnotatedWebApp annotatedWebApp = new AnnotatedWebApp(webApp);
+
+        return new WebModule(standAlone, moduleName, environment, moduleFile, targetPath,
webApp, jettyWebApp, specDD, contextRoot, new HashMap(), JETTY_NAMESPACE, annotatedWebApp);
     }
 
     JettyWebAppType getJettyWebApp(Object plan, JarFile moduleFile, boolean standAlone, String
targetPath, WebAppType webApp) throws DeploymentException {

Modified: geronimo/server/trunk/modules/geronimo-openejb-builder/src/main/java/org/apache/geronimo/openejb/deployment/EjbModule.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-openejb-builder/src/main/java/org/apache/geronimo/openejb/deployment/EjbModule.java?view=diff&rev=513564&r1=513563&r2=513564
==============================================================================
--- geronimo/server/trunk/modules/geronimo-openejb-builder/src/main/java/org/apache/geronimo/openejb/deployment/EjbModule.java
(original)
+++ geronimo/server/trunk/modules/geronimo-openejb-builder/src/main/java/org/apache/geronimo/openejb/deployment/EjbModule.java
Thu Mar  1 16:49:50 2007
@@ -20,6 +20,7 @@
 import java.util.jar.JarFile;
 
 import org.apache.geronimo.gbean.AbstractName;
+import org.apache.geronimo.j2ee.deployment.annotation.AnnotatedApp;
 import org.apache.geronimo.j2ee.deployment.EJBModule;
 import org.apache.geronimo.kernel.repository.Environment;
 import org.apache.geronimo.openejb.xbeans.ejbjar.OpenejbGeronimoEjbJarType;
@@ -40,8 +41,8 @@
     private OpenejbGeronimoEjbJarType vendorDD;
     private final org.apache.openejb.config.EjbModule ejbModule;
 
-    public EjbModule(org.apache.openejb.config.EjbModule ejbModule, boolean standAlone, AbstractName
moduleName, Environment environment, JarFile moduleFile, String targetPath, String ejbJarXml,
Map sharedContext) {
-        super(standAlone, moduleName, environment, moduleFile, targetPath, null, null, ejbJarXml,
sharedContext);
+    public EjbModule(org.apache.openejb.config.EjbModule ejbModule, boolean standAlone, AbstractName
moduleName, Environment environment, JarFile moduleFile, String targetPath, String ejbJarXml,
Map sharedContext, AnnotatedApp annoatedApp) {
+        super(standAlone, moduleName, environment, moduleFile, targetPath, null, null, ejbJarXml,
sharedContext, annoatedApp);
         this.ejbModule = ejbModule;
     }
 

Modified: geronimo/server/trunk/modules/geronimo-openejb-builder/src/main/java/org/apache/geronimo/openejb/deployment/EjbModuleBuilder.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-openejb-builder/src/main/java/org/apache/geronimo/openejb/deployment/EjbModuleBuilder.java?view=diff&rev=513564&r1=513563&r2=513564
==============================================================================
--- geronimo/server/trunk/modules/geronimo-openejb-builder/src/main/java/org/apache/geronimo/openejb/deployment/EjbModuleBuilder.java
(original)
+++ geronimo/server/trunk/modules/geronimo-openejb-builder/src/main/java/org/apache/geronimo/openejb/deployment/EjbModuleBuilder.java
Thu Mar  1 16:49:50 2007
@@ -16,13 +16,32 @@
  */
 package org.apache.geronimo.openejb.deployment;
 
+import java.io.File;
+import java.io.IOException;
+import java.net.URI;
+import java.net.URL;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.LinkedList;
+import java.util.Map;
+import java.util.jar.JarFile;
+
+import javax.ejb.EntityContext;
+import javax.ejb.SessionContext;
+import javax.xml.namespace.QName;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
 import org.apache.geronimo.common.DeploymentException;
 import org.apache.geronimo.deployment.ModuleIDBuilder;
 import org.apache.geronimo.deployment.NamespaceDrivenBuilder;
 import org.apache.geronimo.deployment.NamespaceDrivenBuilderCollection;
-import org.apache.geronimo.deployment.util.DeploymentUtil;
 import org.apache.geronimo.deployment.service.EnvironmentBuilder;
 import org.apache.geronimo.deployment.service.GBeanBuilder;
+import org.apache.geronimo.deployment.util.DeploymentUtil;
 import org.apache.geronimo.deployment.xmlbeans.XmlBeansUtil;
 import org.apache.geronimo.gbean.AbstractName;
 import org.apache.geronimo.gbean.AbstractNameQuery;
@@ -33,13 +52,14 @@
 import org.apache.geronimo.j2ee.deployment.EARContext;
 import org.apache.geronimo.j2ee.deployment.Module;
 import org.apache.geronimo.j2ee.deployment.ModuleBuilder;
+import org.apache.geronimo.j2ee.deployment.ModuleBuilderExtension;
 import org.apache.geronimo.j2ee.deployment.NamingBuilder;
 import org.apache.geronimo.j2ee.deployment.WebServiceBuilder;
-import org.apache.geronimo.j2ee.deployment.ModuleBuilderExtension;
+import org.apache.geronimo.j2ee.deployment.annotation.AnnotatedEjbJar;
 import org.apache.geronimo.j2ee.j2eeobjectnames.NameFactory;
 import org.apache.geronimo.kernel.Naming;
-import org.apache.geronimo.kernel.config.ConfigurationStore;
 import org.apache.geronimo.kernel.config.ConfigurationModuleType;
+import org.apache.geronimo.kernel.config.ConfigurationStore;
 import org.apache.geronimo.kernel.repository.Environment;
 import org.apache.geronimo.naming.deployment.ResourceEnvironmentSetter;
 import org.apache.geronimo.openejb.EjbDeployment;
@@ -56,8 +76,8 @@
 import org.apache.openejb.config.AppModule;
 import org.apache.openejb.config.DeploymentLoader;
 import org.apache.openejb.config.ReadDescriptors;
-import org.apache.openejb.config.UnsupportedModuleTypeException;
 import org.apache.openejb.config.UnknownModuleTypeException;
+import org.apache.openejb.config.UnsupportedModuleTypeException;
 import org.apache.openejb.jee.EjbJar;
 import org.apache.openejb.jee.EnterpriseBean;
 import org.apache.openejb.jee.MessageDestinationRef;
@@ -72,25 +92,6 @@
 import org.apache.openejb.jee.oejb2.GeronimoEjbJarType;
 import org.apache.xmlbeans.XmlCursor;
 import org.apache.xmlbeans.XmlObject;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-
-import javax.ejb.EntityContext;
-import javax.ejb.SessionContext;
-import javax.xml.namespace.QName;
-
-import java.io.File;
-import java.io.IOException;
-import java.net.URI;
-import java.net.URL;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.Map;
-import java.util.LinkedList;
-import java.util.jar.JarFile;
 
 /**
  * Master builder for processing EJB JAR deployments and creating the
@@ -248,7 +249,12 @@
             moduleName = naming.createChildName(earName, targetPath, NameFactory.EJB_MODULE);
         }
 
-        EjbModule module = new EjbModule(ejbModule, standAlone, moduleName, environment,
moduleFile, targetPath, "", sharedContext);
+        // Create XMLBeans version of EjbJarType for the AnnotatedApp interface
+        EjbJar ejbJar = ejbModule.getEjbJar();
+        EjbJarType ejbJarType = XmlUtil.convertToXmlbeans(ejbJar);
+        AnnotatedEjbJar annotatedEjbJar = new AnnotatedEjbJar(ejbJarType);
+
+        EjbModule module = new EjbModule(ejbModule, standAlone, moduleName, environment,
moduleFile, targetPath, "", sharedContext, annotatedEjbJar);
 
         for (ModuleBuilderExtension builder : moduleBuilderExtensions) {
             try {
@@ -256,6 +262,7 @@
             } catch (Throwable t) {
                 String builderName = builder.getClass().getSimpleName();
                 log.error(builderName + ".createModule() failed: " + t.getMessage(), t);
+
             }
         }
         return module;

Modified: geronimo/server/trunk/modules/geronimo-openejb-builder/src/main/java/org/apache/geronimo/openejb/deployment/EjbRefBuilder.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-openejb-builder/src/main/java/org/apache/geronimo/openejb/deployment/EjbRefBuilder.java?view=diff&rev=513564&r1=513563&r2=513564
==============================================================================
--- geronimo/server/trunk/modules/geronimo-openejb-builder/src/main/java/org/apache/geronimo/openejb/deployment/EjbRefBuilder.java
(original)
+++ geronimo/server/trunk/modules/geronimo-openejb-builder/src/main/java/org/apache/geronimo/openejb/deployment/EjbRefBuilder.java
Thu Mar  1 16:49:50 2007
@@ -26,6 +26,7 @@
 import java.util.Collections;
 import java.util.List;
 import java.util.Map;
+
 import javax.ejb.EJB;
 import javax.ejb.EJBHome;
 import javax.ejb.EJBLocalHome;
@@ -39,6 +40,8 @@
 import org.apache.geronimo.gbean.GBeanInfoBuilder;
 import org.apache.geronimo.j2ee.deployment.Module;
 import org.apache.geronimo.j2ee.deployment.WebModule;
+import org.apache.geronimo.j2ee.deployment.annotation.AnnotatedApp;
+import org.apache.geronimo.j2ee.deployment.annotation.EJBAnnotationHelper;
 import org.apache.geronimo.j2ee.j2eeobjectnames.NameFactory;
 import org.apache.geronimo.kernel.config.Configuration;
 import org.apache.geronimo.kernel.config.MultiParentClassLoader;
@@ -48,12 +51,13 @@
 import org.apache.geronimo.xbeans.javaee.EjbLocalRefType;
 import org.apache.geronimo.xbeans.javaee.EjbRefType;
 import org.apache.geronimo.xbeans.javaee.InjectionTargetType;
+import org.apache.geronimo.xbeans.javaee.WebAppType;
 import org.apache.openejb.OpenEJBException;
-import org.apache.openejb.config.AnnotationDeployer;
-import org.apache.openejb.config.JndiEncInfoBuilder;
 import org.apache.openejb.assembler.classic.EjbJarInfo;
 import org.apache.openejb.assembler.classic.JndiEncBuilder;
 import org.apache.openejb.assembler.classic.JndiEncInfo;
+import org.apache.openejb.config.AnnotationDeployer;
+import org.apache.openejb.config.JndiEncInfoBuilder;
 import org.apache.openejb.core.ivm.naming.IntraVmJndiReference;
 import org.apache.openejb.jee.EjbLocalRef;
 import org.apache.openejb.jee.EjbRef;
@@ -102,6 +106,26 @@
 
     public void buildNaming(XmlObject specDD, XmlObject plan, Configuration localConfiguration,
Configuration remoteConfiguration, Module module, Map componentContext) throws DeploymentException
{
         JndiConsumer consumer = createJndiConsumer(specDD, componentContext);
+
+        if ( module instanceof WebModule ) {
+            WebAppType webApp = (WebAppType) module.getSpecDD();
+            if (!webApp.getMetadataComplete()) {
+
+                // Discover and process any EJB annotations
+                processAnnotations(module);
+
+                // Set metadata complete
+                webApp.setMetadataComplete(true);
+
+                // Update both versions of specDD in module
+                module.setSpecDD(webApp);
+                module.setOriginalSpecDD(webApp.toString());
+
+                // Augment the JndiConsumer with any discovered annotations
+                augmentJndiConsumer(module, consumer, componentContext);
+            }
+        }
+
 //      processWebEjbAnnotations(module, consumer);
 
         Map<String, Object> map = null;
@@ -239,6 +263,182 @@
             addInjections(refName, xmlbeansRef.getInjectionTargetArray(), componentContext);
         }
         return jndiConsumer;
+    }
+
+    private void processAnnotations(Module module) throws DeploymentException {
+
+        //----------------------------------------------------
+        // Find all the annotated classes via ClassFinder
+        //----------------------------------------------------
+        try {
+            ClassLoader classLoader = module.getEarContext().getClassLoader();
+            UrlSet urlSet = new UrlSet(classLoader);
+            if (classLoader instanceof MultiParentClassLoader) {
+                MultiParentClassLoader multiParentClassLoader = (MultiParentClassLoader)
classLoader;
+                for (ClassLoader parent : multiParentClassLoader.getParents()) {
+                    if (parent != null) {
+                        urlSet = urlSet.exclude(parent);
+                    }
+                }
+            } else {
+                ClassLoader parent = classLoader.getParent();
+                if (parent != null) {
+                    urlSet = urlSet.exclude(parent);
+                }
+            }
+            ClassFinder finder = new ClassFinder(classLoader, urlSet.getUrls());
+
+            //----------------------------------------------------------------------
+            // Finally process all the annotations for this naming builder type
+            //----------------------------------------------------------------------
+            if (EJBAnnotationHelper.annotationsPresent(finder)) {
+                try {
+                    EJBAnnotationHelper.processAnnotations(module.getAnnotatedApp(), finder);
+                }
+                catch (Exception e) {
+                    log.warn("Unable to process @EJB annotations for web module" + module.getName(),
e);
+                }
+            }
+
+        } catch (IOException e) {
+            // ignored... we tried
+            log.warn("Unable to process @EJB annotations for web module" + module.getName(),
e);
+        }
+    }
+
+    private void augmentJndiConsumer(Module module, JndiConsumer consumer, Map componentContext)
throws DeploymentException {
+
+        //------------------------------------------
+        // Convert from XmlBeans to JAXB format
+        //------------------------------------------
+
+        EjbRefType[] ejbRefs = module.getAnnotatedApp().getEjbRefArray();
+        for ( EjbRefType xmlbeansRef : ejbRefs ) {
+
+            // create the ejb-ref
+            EjbRef ref = new EjbRef();
+            consumer.getEjbRef().add(ref);
+
+            // ejb-ref-name
+            String refName = getStringValue(xmlbeansRef.getEjbRefName());
+            ref.setEjbRefName(refName);
+
+            // ejb-ref-type
+            String refType = getStringValue(xmlbeansRef.getEjbRefType());
+            if ("SESSION".equalsIgnoreCase(refType)) {
+                ref.setEjbRefType(org.apache.openejb.jee.EjbRefType.SESSION);
+            } else if ("ENTITY".equalsIgnoreCase(refType)) {
+                ref.setEjbRefType(org.apache.openejb.jee.EjbRefType.ENTITY);
+            }
+
+            // home
+            ref.setHome(getStringValue(xmlbeansRef.getHome()));
+
+            // remote
+            ref.setRemote(getStringValue(xmlbeansRef.getRemote()));
+
+            // ejb-link
+            ref.setEjbLink(getStringValue(xmlbeansRef.getEjbLink()));
+
+            // mapped-name
+            ref.setMappedName(getStringValue(xmlbeansRef.getMappedName()));
+
+            // openejb handling of injection-targets
+            if (xmlbeansRef.getInjectionTargetArray() != null) {
+                for (InjectionTargetType injectionTargetType : xmlbeansRef.getInjectionTargetArray())
{
+                    InjectionTarget injectionTarget = new InjectionTarget();
+                    injectionTarget.setInjectionTargetClass(getStringValue(injectionTargetType.getInjectionTargetClass()));
+                    injectionTarget.setInjectionTargetName(getStringValue(injectionTargetType.getInjectionTargetName()));
+                    ref.getInjectionTarget().add(injectionTarget);
+                }
+            }
+            //geronimo's handling of injection-target
+            addInjections(refName, xmlbeansRef.getInjectionTargetArray(), componentContext);
+        }
+
+        EjbLocalRefType[] ejbLocalRefs = module.getAnnotatedApp().getEjbLocalRefArray();
+        for ( EjbLocalRefType xmlbeansRef : ejbLocalRefs ) {
+
+            // create the ejb-ref
+            EjbLocalRef ref = new EjbLocalRef();
+            consumer.getEjbLocalRef().add(ref);
+
+            // ejb-ref-name
+            String refName = getStringValue(xmlbeansRef.getEjbRefName());
+            ref.setEjbRefName(refName);
+
+            // ejb-ref-type
+            String refType = getStringValue(xmlbeansRef.getEjbRefType());
+            if ("SESSION".equalsIgnoreCase(refType)) {
+                ref.setEjbRefType(org.apache.openejb.jee.EjbRefType.SESSION);
+            } else if ("ENTITY".equalsIgnoreCase(refType)) {
+                ref.setEjbRefType(org.apache.openejb.jee.EjbRefType.ENTITY);
+            }
+
+            // home
+            ref.setLocalHome(getStringValue(xmlbeansRef.getLocalHome()));
+
+            // remote
+            ref.setLocal(getStringValue(xmlbeansRef.getLocal()));
+
+            // ejb-link
+            ref.setEjbLink(getStringValue(xmlbeansRef.getEjbLink()));
+
+            // mapped-name
+            ref.setMappedName(getStringValue(xmlbeansRef.getMappedName()));
+
+            // openejb handling of injection-targets
+            if (xmlbeansRef.getInjectionTargetArray() != null) {
+                for (InjectionTargetType injectionTargetType : xmlbeansRef.getInjectionTargetArray())
{
+                    InjectionTarget injectionTarget = new InjectionTarget();
+                    injectionTarget.setInjectionTargetClass(getStringValue(injectionTargetType.getInjectionTargetClass()));
+                    injectionTarget.setInjectionTargetName(getStringValue(injectionTargetType.getInjectionTargetName()));
+                    ref.getInjectionTarget().add(injectionTarget);
+                }
+            }
+            //geronimo's handling of injection-target
+            addInjections(refName, xmlbeansRef.getInjectionTargetArray(), componentContext);
+        }
+
+        List<EjbRefType> ambiguous = module.getAnnotatedApp().getAmbiguousEjbRefs();
+        for ( EjbRefType xmlbeansRef : ambiguous ) {
+
+            // create the ejb-ref
+            EjbRef ref = new EjbRef();
+            consumer.getEjbRef().add(ref);
+
+            // ejb-ref-name
+            String refName = getStringValue(xmlbeansRef.getEjbRefName());
+            ref.setEjbRefName(refName);
+
+            // ejb-ref-type
+            ref.setRefType(EjbRef.Type.UNKNOWN);
+
+            // home
+            ref.setHome(getStringValue(xmlbeansRef.getHome()));
+
+            // remote
+            ref.setRemote(getStringValue(xmlbeansRef.getRemote()));
+
+            // ejb-link
+            ref.setEjbLink(getStringValue(xmlbeansRef.getEjbLink()));
+
+            // mapped-name
+            ref.setMappedName(getStringValue(xmlbeansRef.getMappedName()));
+
+            // openejb handling of injection-targets
+            if (xmlbeansRef.getInjectionTargetArray() != null) {
+                for (InjectionTargetType injectionTargetType : xmlbeansRef.getInjectionTargetArray())
{
+                    InjectionTarget injectionTarget = new InjectionTarget();
+                    injectionTarget.setInjectionTargetClass(getStringValue(injectionTargetType.getInjectionTargetClass()));
+                    injectionTarget.setInjectionTargetName(getStringValue(injectionTargetType.getInjectionTargetName()));
+                    ref.getInjectionTarget().add(injectionTarget);
+                }
+            }
+            //geronimo's handling of injection-target
+            addInjections(refName, xmlbeansRef.getInjectionTargetArray(), componentContext);
+        }
+
     }
 
     private void processWebEjbAnnotations(Module module, JndiConsumer consumer) throws DeploymentException
{

Modified: geronimo/server/trunk/modules/geronimo-tomcat6-builder/src/main/java/org/apache/geronimo/tomcat/deployment/TomcatModuleBuilder.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-tomcat6-builder/src/main/java/org/apache/geronimo/tomcat/deployment/TomcatModuleBuilder.java?view=diff&rev=513564&r1=513563&r2=513564
==============================================================================
--- geronimo/server/trunk/modules/geronimo-tomcat6-builder/src/main/java/org/apache/geronimo/tomcat/deployment/TomcatModuleBuilder.java
(original)
+++ geronimo/server/trunk/modules/geronimo-tomcat6-builder/src/main/java/org/apache/geronimo/tomcat/deployment/TomcatModuleBuilder.java
Thu Mar  1 16:49:50 2007
@@ -49,6 +49,7 @@
 import org.apache.geronimo.gbean.GBeanInfo;
 import org.apache.geronimo.gbean.GBeanInfoBuilder;
 import org.apache.geronimo.gbean.ReferencePatterns;
+import org.apache.geronimo.j2ee.deployment.annotation.AnnotatedWebApp;
 import org.apache.geronimo.j2ee.deployment.EARContext;
 import org.apache.geronimo.j2ee.deployment.Module;
 import org.apache.geronimo.j2ee.deployment.ModuleBuilder;
@@ -188,7 +189,10 @@
             moduleName = naming.createChildName(earName, targetPath, NameFactory.WEB_MODULE);
         }
 
-        return new WebModule(standAlone, moduleName, environment, moduleFile, targetPath,
webApp, tomcatWebApp, specDD, contextRoot, new HashMap(), TOMCAT_NAMESPACE);
+        // Create the AnnotatedApp interface for the WebModule
+        AnnotatedWebApp annotatedWebApp = new AnnotatedWebApp(webApp);
+
+        return new WebModule(standAlone, moduleName, environment, moduleFile, targetPath,
webApp, tomcatWebApp, specDD, contextRoot, new HashMap(), TOMCAT_NAMESPACE, annotatedWebApp);
     }
 
 

Modified: geronimo/server/trunk/modules/geronimo-web-2.5-builder/src/main/java/org/apache/geronimo/web25/deployment/AbstractWebModuleBuilder.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-web-2.5-builder/src/main/java/org/apache/geronimo/web25/deployment/AbstractWebModuleBuilder.java?view=diff&rev=513564&r1=513563&r2=513564
==============================================================================
--- geronimo/server/trunk/modules/geronimo-web-2.5-builder/src/main/java/org/apache/geronimo/web25/deployment/AbstractWebModuleBuilder.java
(original)
+++ geronimo/server/trunk/modules/geronimo-web-2.5-builder/src/main/java/org/apache/geronimo/web25/deployment/AbstractWebModuleBuilder.java
Thu Mar  1 16:49:50 2007
@@ -667,7 +667,7 @@
 
     protected void buildSubstitutionGroups(XmlObject gerWebApp, boolean hasSecurityRealmName,
Module module, EARContext earContext) throws DeploymentException {
         WebAppType webApp = (WebAppType) module.getSpecDD();
-        makeMetadataComplete(webApp, module);
+//      makeMetadataComplete(webApp, module);
         if ((webApp.getSecurityConstraintArray().length > 0 || webApp.getSecurityRoleArray().length
> 0) &&
                 !hasSecurityRealmName) {
             throw new DeploymentException("web.xml for web app " + module.getName() + " includes
security elements but Geronimo deployment plan is not provided or does not contain <security-realm-name>
element necessary to configure security accordingly.");
@@ -770,7 +770,7 @@
             if (EJBAnnotationHelper.annotationsPresent(classFinder)) {
                 try {
                     ClassFinder ejbFinder = new ClassFinder(classLoader);
-                    webApp = EJBAnnotationHelper.processAnnotations(webApp, classFinder,
ejbFinder);
+//                  webApp = EJBAnnotationHelper.processAnnotations(webApp, classFinder,
ejbFinder);
                 }
                 catch (Exception e) {
                     throw new DeploymentException("TomcatModuleBuilder: Error processing
@EJB(s) annotations", e);
@@ -785,7 +785,7 @@
             // <service-ref>
             if (ResourceAnnotationHelper.annotationsPresent(classFinder)) {
                 try {
-                    ResourceAnnotationHelper.processAnnotations(webApp, classFinder);
+//                  ResourceAnnotationHelper.processAnnotations(webApp, classFinder);
                 }
                 catch (Exception e) {
                     throw new DeploymentException("TomcatModuleBuilder: Error processing
@Resource(s) annotations", e);



Mime
View raw message