geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From djen...@apache.org
Subject svn commit: r464274 [1/2] - in /geronimo/server/trunk: configs/axis-deployer/src/plan/ modules/geronimo-axis-builder/src/main/java/org/apache/geronimo/axis/builder/ modules/geronimo-axis-builder/src/test/java/org/apache/geronimo/axis/builder/ modules/g...
Date Sun, 15 Oct 2006 20:40:09 GMT
Author: djencks
Date: Sun Oct 15 13:40:04 2006
New Revision: 464274

URL: http://svn.apache.org/viewvc?view=rev&rev=464274
Log:
GERONIMO-2492 first steps, make the WebServiceBuilder a little more flexible

Added:
    geronimo/server/trunk/modules/geronimo-tomcat-builder/src/test/java/org/apache/geronimo/tomcat/app/HelloWorld.java   (with props)
    geronimo/server/trunk/modules/geronimo-tomcat-builder/src/test/java/org/apache/geronimo/tomcat/app/HelloWorldWS.java   (with props)
    geronimo/server/trunk/modules/geronimo-tomcat-builder/src/test/java/org/apache/geronimo/tomcat/deployment/MockWebServiceBuilder.java   (with props)
    geronimo/server/trunk/modules/geronimo-webservices/src/main/java/org/apache/geronimo/webservices/SerializableWebServiceContainerFactoryGBean.java   (with props)
    geronimo/server/trunk/modules/geronimo-webservices/src/main/java/org/apache/geronimo/webservices/WebServiceContainerFactory.java   (with props)
Modified:
    geronimo/server/trunk/configs/axis-deployer/src/plan/plan.xml
    geronimo/server/trunk/modules/geronimo-axis-builder/src/main/java/org/apache/geronimo/axis/builder/AxisBuilder.java
    geronimo/server/trunk/modules/geronimo-axis-builder/src/main/java/org/apache/geronimo/axis/builder/SchemaInfoBuilder.java
    geronimo/server/trunk/modules/geronimo-axis-builder/src/test/java/org/apache/geronimo/axis/builder/ServiceReferenceTest.java
    geronimo/server/trunk/modules/geronimo-j2ee-builder/src/main/java/org/apache/geronimo/j2ee/deployment/EJBModule.java
    geronimo/server/trunk/modules/geronimo-j2ee-builder/src/main/java/org/apache/geronimo/j2ee/deployment/UnavailableWebServiceBuilder.java
    geronimo/server/trunk/modules/geronimo-j2ee-builder/src/main/java/org/apache/geronimo/j2ee/deployment/WebServiceBuilder.java
    geronimo/server/trunk/modules/geronimo-j2ee-builder/src/test/java/org/apache/geronimo/j2ee/deployment/EARConfigBuilder13NakedTest.java
    geronimo/server/trunk/modules/geronimo-j2ee-builder/src/test/java/org/apache/geronimo/j2ee/deployment/EARConfigBuilder13Test.java
    geronimo/server/trunk/modules/geronimo-j2ee-builder/src/test/java/org/apache/geronimo/j2ee/deployment/EARConfigBuilder14AltDDTest.java
    geronimo/server/trunk/modules/geronimo-j2ee-builder/src/test/java/org/apache/geronimo/j2ee/deployment/EARConfigBuilder14AltDDUnpackedTest.java
    geronimo/server/trunk/modules/geronimo-j2ee-builder/src/test/java/org/apache/geronimo/j2ee/deployment/EARConfigBuilder14NakedTest.java
    geronimo/server/trunk/modules/geronimo-j2ee-builder/src/test/java/org/apache/geronimo/j2ee/deployment/EARConfigBuilder14NakedUnpackedTest.java
    geronimo/server/trunk/modules/geronimo-j2ee-builder/src/test/java/org/apache/geronimo/j2ee/deployment/EARConfigBuilder14Test.java
    geronimo/server/trunk/modules/geronimo-j2ee-builder/src/test/java/org/apache/geronimo/j2ee/deployment/EARConfigBuilder14UnpackedTest.java
    geronimo/server/trunk/modules/geronimo-j2ee-builder/src/test/java/org/apache/geronimo/j2ee/deployment/MockEJBConfigBuilder.java
    geronimo/server/trunk/modules/geronimo-jetty-builder/src/main/java/org/apache/geronimo/jetty/deployment/JettyModuleBuilder.java
    geronimo/server/trunk/modules/geronimo-jetty/src/main/java/org/apache/geronimo/jetty/JettyPOJOWebServiceHolder.java
    geronimo/server/trunk/modules/geronimo-kernel/src/main/java/org/apache/geronimo/gbean/runtime/GBeanAttribute.java
    geronimo/server/trunk/modules/geronimo-tomcat-builder/src/main/java/org/apache/geronimo/tomcat/deployment/TomcatModuleBuilder.java
    geronimo/server/trunk/modules/geronimo-tomcat-builder/src/test/java/org/apache/geronimo/tomcat/deployment/TomcatModuleBuilderTest.java
    geronimo/server/trunk/modules/geronimo-tomcat-builder/src/test/resources/deployables/war5/WEB-INF/web.xml
    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/TomcatWebAppContext.java

Modified: geronimo/server/trunk/configs/axis-deployer/src/plan/plan.xml
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/configs/axis-deployer/src/plan/plan.xml?view=diff&rev=464274&r1=464273&r2=464274
==============================================================================
--- geronimo/server/trunk/configs/axis-deployer/src/plan/plan.xml (original)
+++ geronimo/server/trunk/configs/axis-deployer/src/plan/plan.xml Sun Oct 15 13:40:04 2006
@@ -17,7 +17,19 @@
 
 <module xmlns="http://geronimo.apache.org/xml/ns/deployment-${geronimoSchemaVersion}">
 
-    <gbean name="WebServiceBuilder" class="org.apache.geronimo.axis.builder.AxisBuilder"/>
+    <gbean name="WebServiceBuilder" class="org.apache.geronimo.axis.builder.AxisBuilder">
+        <xml-attribute name="defaultEnvironment">
+            <environment xmlns="http://geronimo.apache.org/xml/ns/deployment-1.2">
+                <dependencies>
+                    <dependency>
+                        <groupId>org.apache.geronimo.modules</groupId>
+                        <artifactId>geronimo-axis</artifactId>
+                        <type>jar</type>
+                    </dependency>
+                </dependencies>
+            </environment>
+        </xml-attribute>
+    </gbean>
 
     <gbean name="AxisServiceRefBuilder" class="org.apache.geronimo.axis.builder.AxisServiceRefBuilder">
         <attribute name="eeNamespaces">http://java.sun.com/xml/ns/j2ee</attribute>

Modified: geronimo/server/trunk/modules/geronimo-axis-builder/src/main/java/org/apache/geronimo/axis/builder/AxisBuilder.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-axis-builder/src/main/java/org/apache/geronimo/axis/builder/AxisBuilder.java?view=diff&rev=464274&r1=464273&r2=464274
==============================================================================
--- geronimo/server/trunk/modules/geronimo-axis-builder/src/main/java/org/apache/geronimo/axis/builder/AxisBuilder.java (original)
+++ geronimo/server/trunk/modules/geronimo-axis-builder/src/main/java/org/apache/geronimo/axis/builder/AxisBuilder.java Sun Oct 15 13:40:04 2006
@@ -60,6 +60,7 @@
 import org.apache.geronimo.gbean.GBeanData;
 import org.apache.geronimo.gbean.GBeanInfo;
 import org.apache.geronimo.gbean.GBeanInfoBuilder;
+import org.apache.geronimo.gbean.AbstractName;
 import org.apache.geronimo.j2ee.deployment.Module;
 import org.apache.geronimo.j2ee.deployment.WebServiceBuilder;
 import org.apache.geronimo.j2ee.deployment.HandlerInfoInfo;
@@ -73,6 +74,11 @@
 import org.apache.geronimo.xbeans.j2ee.ServiceEndpointInterfaceMappingType;
 import org.apache.geronimo.xbeans.j2ee.ServiceEndpointMethodMappingType;
 import org.apache.geronimo.deployment.util.DeploymentUtil;
+import org.apache.geronimo.deployment.DeploymentContext;
+import org.apache.geronimo.deployment.service.EnvironmentBuilder;
+import org.apache.geronimo.webservices.SerializableWebServiceContainerFactoryGBean;
+import org.apache.geronimo.kernel.GBeanAlreadyExistsException;
+import org.apache.geronimo.kernel.repository.Environment;
 
 /**
  * @version $Rev$ $Date$
@@ -81,13 +87,26 @@
 
     private static final SOAPConstants SOAP_VERSION = SOAPConstants.SOAP11_CONSTANTS;
 
+    private final Environment defaultEnvironment;
 
-    public Map findWebServices(JarFile moduleFile, boolean isEJB, Map servletLocations) throws DeploymentException {
+    public AxisBuilder() {
+        defaultEnvironment = null;
+    }
+
+    public AxisBuilder(Environment defaultEnvironment) {
+        this.defaultEnvironment = defaultEnvironment;
+    }
+
+
+    public Map findWebServices(JarFile moduleFile, boolean isEJB, Map servletLocations, Environment environment) throws DeploymentException {
         final String path = isEJB ? "META-INF/webservices.xml" : "WEB-INF/webservices.xml";
         try {
             URL wsDDUrl = DeploymentUtil.createJarURL(moduleFile, path);
             Map result = WSDescriptorParser.parseWebServiceDescriptor(wsDDUrl, moduleFile, isEJB, servletLocations);
             if (result != null) {
+                if (defaultEnvironment != null) {
+                    EnvironmentBuilder.mergeEnvironments(environment, defaultEnvironment);
+                }
                 return result;
             }
         } catch (MalformedURLException e) {
@@ -96,17 +115,12 @@
         return Collections.EMPTY_MAP;
     }
 
-    public void configurePOJO(GBeanData targetGBean, JarFile moduleFile, Object portInfoObject, String seiClassName, ClassLoader classLoader) throws DeploymentException {
+    public void configurePOJO(GBeanData targetGBean, Module module, Object portInfoObject, String seiClassName, DeploymentContext context) throws DeploymentException {
+        ClassLoader cl = context.getClassLoader();
         PortInfo portInfo = (PortInfo) portInfoObject;
-        ServiceInfo serviceInfo = AxisServiceBuilder.createServiceInfo(portInfo, classLoader);
+        ServiceInfo serviceInfo = AxisServiceBuilder.createServiceInfo(portInfo, cl);
         JavaServiceDesc serviceDesc = serviceInfo.getServiceDesc();
 
-        try {
-            classLoader.loadClass(seiClassName);
-        } catch (ClassNotFoundException e) {
-            throw new DeploymentException("Unable to load servlet class for pojo webservice: " + seiClassName, e);
-        }
-
         targetGBean.setAttribute("pojoClassName", seiClassName);
         RPCProvider provider = new POJOProvider();
 
@@ -131,8 +145,16 @@
 
         }
 
-        AxisWebServiceContainer axisWebServiceContainer = new AxisWebServiceContainer(location, wsdlURI, service, serviceInfo.getWsdlMap(), classLoader);
-        targetGBean.setAttribute("webServiceContainer", axisWebServiceContainer);
+        AxisWebServiceContainer axisWebServiceContainer = new AxisWebServiceContainer(location, wsdlURI, service, serviceInfo.getWsdlMap(), cl);
+        AbstractName webServiceContainerFactoryName = context.getNaming().createChildName(targetGBean.getAbstractName(), "webServiceContainer", NameFactory.GERONIMO_SERVICE);
+        GBeanData webServiceContainerFactoryGBean = new GBeanData(webServiceContainerFactoryName, SerializableWebServiceContainerFactoryGBean.GBEAN_INFO);
+        webServiceContainerFactoryGBean.setAttribute("webServiceContainer", axisWebServiceContainer);
+        try {
+            context.addGBean(webServiceContainerFactoryGBean);
+        } catch (GBeanAlreadyExistsException e) {
+            throw new DeploymentException("Could not add webServiceContainerFactoryGBean", e);
+        }
+        targetGBean.setReferencePattern("WebServiceContainerFactory", webServiceContainerFactoryName);
     }
 
     public void configureEJB(GBeanData targetGBean, JarFile moduleFile, Object portInfoObject, ClassLoader classLoader) throws DeploymentException {
@@ -176,41 +198,6 @@
         return new AxisServiceReference(serviceInterface.getName(), seiPortNameToFactoryMap, seiClassNameToFactoryMap);
     }
 
-/*
-    public Object createServiceInterfaceProxy(Class serviceInterface, Map seiPortNameToFactoryMap, Map seiClassNameToFactoryMap, DeploymentContext deploymentContext, Module module, ClassLoader classLoader) throws DeploymentException {
-
-        Callback callback = new ServiceMethodInterceptor(seiPortNameToFactoryMap);
-        Callback[] methodInterceptors = new Callback[]{SerializableNoOp.INSTANCE, callback};
-
-        Enhancer enhancer = new Enhancer();
-        enhancer.setClassLoader(classLoader);
-        enhancer.setSuperclass(ServiceImpl.class);
-        enhancer.setInterfaces(new Class[]{serviceInterface});
-        enhancer.setCallbackFilter(new NoOverrideCallbackFilter(Service.class));
-        enhancer.setCallbackTypes(new Class[]{NoOp.class, MethodInterceptor.class});
-        enhancer.setUseFactory(false);
-        ByteArrayRetrievingGeneratorStrategy strategy = new ByteArrayRetrievingGeneratorStrategy();
-        enhancer.setStrategy(strategy);
-        enhancer.setUseCache(false);
-        Class serviceClass = enhancer.createClass();
-
-        try {
-            module.addClass(serviceClass.getName(), strategy.getClassBytes(), deploymentContext);
-        } catch (IOException e) {
-            throw new DeploymentException("Could not write out class bytes", e);
-        } catch (URISyntaxException e) {
-            throw new DeploymentException("Could not constuct URI for location of enhanced class", e);
-        }
-        Enhancer.registerCallbacks(serviceClass, methodInterceptors);
-        FastConstructor constructor = FastClass.create(serviceClass).getConstructor(SERVICE_CONSTRUCTOR_TYPES);
-        try {
-            return constructor.newInstance(new Object[]{seiPortNameToFactoryMap, seiClassNameToFactoryMap});
-        } catch (InvocationTargetException e) {
-            throw new DeploymentException("Could not construct service instance", e.getTargetException());
-        }
-    }
-*/
-
     public void buildSEIFactoryMap(SchemaInfoBuilder schemaInfoBuilder, GerServiceRefType serviceRefType, JavaWsdlMappingType mapping, List handlerInfos, QName serviceQName, SOAPConstants soapVersion, Map seiPortNameToFactoryMap, Map seiClassNameToFactoryMap, ClassLoader classLoader) throws DeploymentException {
         Map exceptionMap = WSDescriptorParser.getExceptionMap(mapping);
 
@@ -477,58 +464,20 @@
         return handlerInfos;
     }
 
-/*
-    public Class enhanceServiceEndpointInterface(Class serviceEndpointInterface, DeploymentContext deploymentContext, Module module, ClassLoader classLoader) throws DeploymentException {
-        Enhancer enhancer = new Enhancer();
-        enhancer.setClassLoader(classLoader);
-        enhancer.setSuperclass(GenericServiceEndpointWrapper.class);
-        enhancer.setInterfaces(new Class[]{serviceEndpointInterface});
-        enhancer.setCallbackFilter(new NoOverrideCallbackFilter(GenericServiceEndpointWrapper.class));
-        enhancer.setCallbackTypes(new Class[]{NoOp.class, MethodInterceptor.class});
-        enhancer.setUseFactory(false);
-        ByteArrayRetrievingGeneratorStrategy strategy = new ByteArrayRetrievingGeneratorStrategy();
-        enhancer.setStrategy(strategy);
-        enhancer.setUseCache(false);
-        Class serviceEndpointClass = enhancer.createClass();
-
-        try {
-            module.addClass(serviceEndpointClass.getName(), strategy.getClassBytes(), deploymentContext);
-        } catch (IOException e) {
-            throw new DeploymentException("Could not write out class bytes", e);
-        } catch (URISyntaxException e) {
-            throw new DeploymentException("Could not constuct URI for location of enhanced class", e);
-        }
-        return serviceEndpointClass;
-    }
-*/
-
     public OperationInfo buildOperationInfoLightweight(Method method, BindingOperation bindingOperation, Style defaultStyle, SOAPConstants soapVersion) throws DeploymentException {
         LightweightOperationDescBuilder operationDescBuilder = new LightweightOperationDescBuilder(bindingOperation, method);
         return operationDescBuilder.buildOperationInfo(soapVersion);
     }
 
-/*
-    private static class ByteArrayRetrievingGeneratorStrategy extends DefaultGeneratorStrategy {
-
-        private byte[] classBytes;
-
-        public byte[] transform(byte[] b) {
-            classBytes = b;
-            return b;
-        }
-
-        public byte[] getClassBytes() {
-            return classBytes;
-        }
-    }
-*/
-
 
     public static final GBeanInfo GBEAN_INFO;
 
     static {
         GBeanInfoBuilder infoBuilder = GBeanInfoBuilder.createStatic(AxisBuilder.class, NameFactory.MODULE_BUILDER);
         infoBuilder.addInterface(WebServiceBuilder.class);
+        infoBuilder.addAttribute("defaultEnvironment", Environment.class, true, true);
+
+        infoBuilder.setConstructor(new String[] {"defaultEnvironment"});
 
         GBEAN_INFO = infoBuilder.getBeanInfo();
     }

Modified: geronimo/server/trunk/modules/geronimo-axis-builder/src/main/java/org/apache/geronimo/axis/builder/SchemaInfoBuilder.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-axis-builder/src/main/java/org/apache/geronimo/axis/builder/SchemaInfoBuilder.java?view=diff&rev=464274&r1=464273&r2=464274
==============================================================================
--- geronimo/server/trunk/modules/geronimo-axis-builder/src/main/java/org/apache/geronimo/axis/builder/SchemaInfoBuilder.java (original)
+++ geronimo/server/trunk/modules/geronimo-axis-builder/src/main/java/org/apache/geronimo/axis/builder/SchemaInfoBuilder.java Sun Oct 15 13:40:04 2006
@@ -179,7 +179,7 @@
      * Find all the complex types in the previously constructed schema analysis.
      * Put them in a map from complex type QName to schema fragment.
      *
-     * @return
+     * @return map of complexType QName to schema fragment
      */
     public Map getComplexTypesInWsdl() {
         return complexTypeMap;
@@ -223,7 +223,7 @@
      * <p/>
      * WSDL 1.1 spec: 2.6 "The name attribute provides a unique name among all ports defined within in the enclosing WSDL document."
      *
-     * @return
+     * @return Map of port QName to javax.wsdl.Port for that QName.
      */
 
     public Map getPortMap() {
@@ -385,7 +385,7 @@
      * builds a map of SchemaTypeKey containing jaxrpc-style fake QName and context info to xmlbeans SchemaType object.
      *
      * @param schemaTypeSystem
-     * @return
+     * @return Map of SchemaTypeKey to xmlbeans SchemaType object.
      */
     private Map buildSchemaTypeKeyToSchemaTypeMap(SchemaTypeSystem schemaTypeSystem) {
         Map qnameMap = new HashMap();
@@ -412,7 +412,7 @@
             elementNamespace = key.getqName().getNamespaceURI();
         }
         String elementQNameLocalName;
-        SchemaTypeKey elementKey = null;
+        SchemaTypeKey elementKey;
         if (key == null) {
             //top level. rule 2.a,
             elementQNameLocalName = elementName.getLocalPart();
@@ -515,7 +515,7 @@
 
     public Definition readWsdl(JarFile moduleFile, URI wsdlURI) throws DeploymentException {
         Definition definition;
-        WSDLFactory wsdlFactory = null;
+        WSDLFactory wsdlFactory;
         try {
             wsdlFactory = WSDLFactory.newInstance();
         } catch (WSDLException e) {
@@ -617,7 +617,7 @@
                 systemId = systemId.substring(PROJECT_URL_PREFIX.length());
             }
             URI location = ((URI) uris.peek()).resolve(systemId);
-            InputStream wsdlInputStream = null;
+            InputStream wsdlInputStream;
             try {
                 ZipEntry entry = moduleFile.getEntry(location.toString());
                 wsdlInputStream = moduleFile.getInputStream(entry);
@@ -634,6 +634,7 @@
 
     class JarWSDLLocator implements WSDLLocator {
 
+        private final List streams = new ArrayList();
         private final URI wsdlURI;
         private URI latestImportURI;
 
@@ -642,7 +643,7 @@
         }
 
         public InputSource getBaseInputSource() {
-            InputStream wsdlInputStream = null;
+            InputStream wsdlInputStream;
             try {
                 ZipEntry entry = moduleFile.getEntry(wsdlURI.toString());
                 wsdlInputStream = moduleFile.getInputStream(entry);
@@ -650,6 +651,7 @@
                 wsdlMap.put(wsdlURI, definition);
                 wsdlInputStream.close();
                 wsdlInputStream = moduleFile.getInputStream(entry);
+                streams.add(wsdlInputStream);
             } catch (Exception e) {
                 throw new RuntimeException("Could not open stream to wsdl file", e);
             }
@@ -663,7 +665,7 @@
         public InputSource getImportInputSource(String parentLocation, String relativeLocation) {
             URI parentURI = URI.create(parentLocation);
             latestImportURI = parentURI.resolve(relativeLocation);
-            InputStream importInputStream = null;
+            InputStream importInputStream;
             try {
                 ZipEntry entry = moduleFile.getEntry(latestImportURI.toString());
                 importInputStream = moduleFile.getInputStream(entry);
@@ -676,6 +678,7 @@
                     //probably was a schema rather than wsdl.  If there are real problems they will show up later.
                 }
                 importInputStream = moduleFile.getInputStream(entry);
+                streams.add(importInputStream);
             } catch (Exception e) {
                 throw new RuntimeException("Could not open stream to import file", e);
             }
@@ -686,6 +689,18 @@
 
         public String getLatestImportURI() {
             return latestImportURI.toString();
+        }
+
+        public void close() {
+            for (Iterator iterator = streams.iterator(); iterator.hasNext();) {
+                InputStream inputStream = (InputStream) iterator.next();
+                try {
+                    inputStream.close();
+                } catch (IOException e) {
+                    //ignore
+                }
+            }
+            streams.clear();
         }
     }
 }

Modified: geronimo/server/trunk/modules/geronimo-axis-builder/src/test/java/org/apache/geronimo/axis/builder/ServiceReferenceTest.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-axis-builder/src/test/java/org/apache/geronimo/axis/builder/ServiceReferenceTest.java?view=diff&rev=464274&r1=464273&r2=464274
==============================================================================
--- geronimo/server/trunk/modules/geronimo-axis-builder/src/test/java/org/apache/geronimo/axis/builder/ServiceReferenceTest.java (original)
+++ geronimo/server/trunk/modules/geronimo-axis-builder/src/test/java/org/apache/geronimo/axis/builder/ServiceReferenceTest.java Sun Oct 15 13:40:04 2006
@@ -118,7 +118,7 @@
 
         File moduleLocation = new File(tmpbasedir, "ejb");
         moduleLocation.mkdirs();
-        module = new EJBModule(true, moduleName, environment, new UnpackedJarFile(moduleLocation), "ejb", null, null, null);
+        module = new EJBModule(true, moduleName, environment, new UnpackedJarFile(moduleLocation), "ejb", null, null, null, null);
 
         runExternalWSTest = System.getProperty("geronimo.run.external.webservicetest", "false").equals("true");
     }
@@ -165,7 +165,7 @@
 */
 
     public void testBuildOperationInfo() throws Exception {
-        AxisBuilder builder = new AxisBuilder();
+        AxisBuilder builder = new AxisBuilder(null);
         OperationInfo operationInfo = buildOperationInfoForMockOperation(builder);
         assertNotNull(operationInfo);
     }
@@ -175,7 +175,7 @@
         SchemaInfoBuilder schemaInfoBuilder = new SchemaInfoBuilder(null, definition);
         JavaWsdlMappingType mapping = buildLightweightMappingType();
         QName serviceQName = new QName(NAMESPACE, "MockService");
-        AxisBuilder builder = new AxisBuilder();
+        AxisBuilder builder = new AxisBuilder(null);
         Object reference = builder.createService(MockService.class, schemaInfoBuilder, mapping, serviceQName, SOAPConstants.SOAP11_CONSTANTS, handlerInfos, gerServiceRefType, module, isolatedCl);
         assertNotNull(reference);
         assertTrue(reference instanceof AxisServiceReference);
@@ -197,7 +197,7 @@
         JavaWsdlMappingDocument mappingDocument = JavaWsdlMappingDocument.Factory.parse(jaxrpcMapping);
         JavaWsdlMappingType mapping = mappingDocument.getJavaWsdlMapping();
         QName serviceQName = new QName("http://www.Monson-Haefel.com/jwsbook/BookQuote", "BookQuoteService");
-        AxisBuilder builder = new AxisBuilder();
+        AxisBuilder builder = new AxisBuilder(null);
         Object reference = builder.createService(BookQuoteService.class, schemaInfoBuilder, mapping, serviceQName, SOAPConstants.SOAP11_CONSTANTS, handlerInfos, gerServiceRefType, module, isolatedCl);
         assertNotNull(reference);
         assertTrue(reference instanceof AxisServiceReference);
@@ -219,7 +219,7 @@
         JavaWsdlMappingDocument mappingDocument = JavaWsdlMappingDocument.Factory.parse(jaxrpcMapping);
         JavaWsdlMappingType mapping = mappingDocument.getJavaWsdlMapping();
         QName serviceQName = new QName("http://tempuri.org/4s4c/1/3/wsdl/def/interopLab", "interopLab");
-        AxisBuilder builder = new AxisBuilder();
+        AxisBuilder builder = new AxisBuilder(null);
         Object proxy = builder.createService(InteropLab.class, schemaInfoBuilder, mapping, serviceQName, SOAPConstants.SOAP11_CONSTANTS, handlerInfos, gerServiceRefType, module, isolatedCl);
         assertNotNull(proxy);
         assertTrue(proxy instanceof InteropLab);

Modified: geronimo/server/trunk/modules/geronimo-j2ee-builder/src/main/java/org/apache/geronimo/j2ee/deployment/EJBModule.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-j2ee-builder/src/main/java/org/apache/geronimo/j2ee/deployment/EJBModule.java?view=diff&rev=464274&r1=464273&r2=464274
==============================================================================
--- geronimo/server/trunk/modules/geronimo-j2ee-builder/src/main/java/org/apache/geronimo/j2ee/deployment/EJBModule.java (original)
+++ geronimo/server/trunk/modules/geronimo-j2ee-builder/src/main/java/org/apache/geronimo/j2ee/deployment/EJBModule.java Sun Oct 15 13:40:04 2006
@@ -20,6 +20,7 @@
 import java.net.URI;
 import java.net.URISyntaxException;
 import java.util.jar.JarFile;
+import java.util.Map;
 
 import org.apache.geronimo.deployment.DeploymentContext;
 import org.apache.geronimo.gbean.AbstractName;
@@ -32,9 +33,11 @@
  */
 public class EJBModule extends Module {
     private AbstractName moduleCmpEngineName;
+    private final Map portMap;
 
-    public EJBModule(boolean standAlone, AbstractName moduleName, Environment environment, JarFile moduleFile, String targetPath, XmlObject specDD, XmlObject vendorDD, String originalSpecDD) {
+    public EJBModule(boolean standAlone, AbstractName moduleName, Environment environment, JarFile moduleFile, String targetPath, XmlObject specDD, XmlObject vendorDD, String originalSpecDD, Map portMap) {
         super(standAlone, moduleName, environment, moduleFile, targetPath, specDD, vendorDD, originalSpecDD, null);
+        this.portMap = portMap;
     }
 
     public ConfigurationModuleType getType() {
@@ -51,6 +54,10 @@
 
     public void setModuleCmpEngineName(AbstractName moduleCmpEngineName) {
         this.moduleCmpEngineName = moduleCmpEngineName;
+    }
+
+    public Map getPortMap() {
+        return portMap;
     }
 }
 

Modified: geronimo/server/trunk/modules/geronimo-j2ee-builder/src/main/java/org/apache/geronimo/j2ee/deployment/UnavailableWebServiceBuilder.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-j2ee-builder/src/main/java/org/apache/geronimo/j2ee/deployment/UnavailableWebServiceBuilder.java?view=diff&rev=464274&r1=464273&r2=464274
==============================================================================
--- geronimo/server/trunk/modules/geronimo-j2ee-builder/src/main/java/org/apache/geronimo/j2ee/deployment/UnavailableWebServiceBuilder.java (original)
+++ geronimo/server/trunk/modules/geronimo-j2ee-builder/src/main/java/org/apache/geronimo/j2ee/deployment/UnavailableWebServiceBuilder.java Sun Oct 15 13:40:04 2006
@@ -25,17 +25,19 @@
 import org.apache.geronimo.gbean.GBeanInfo;
 import org.apache.geronimo.gbean.GBeanInfoBuilder;
 import org.apache.geronimo.j2ee.j2eeobjectnames.NameFactory;
+import org.apache.geronimo.deployment.DeploymentContext;
+import org.apache.geronimo.kernel.repository.Environment;
 
 /**
  * @version $Rev$ $Date$
  */
 public class UnavailableWebServiceBuilder implements WebServiceBuilder {
 
-    public Map findWebServices(JarFile moduleFile, boolean isEJB, Map correctedPortLocations) throws DeploymentException {
+    public Map findWebServices(JarFile moduleFile, boolean isEJB, Map correctedPortLocations, Environment environment) throws DeploymentException {
         return  Collections.EMPTY_MAP;
     }
 
-    public void configurePOJO(GBeanData targetGBean, JarFile moduleFile, Object portInfo, String seiClassName, ClassLoader classLoader) throws DeploymentException {
+    public void configurePOJO(GBeanData targetGBean, Module module, Object portInfo, String seiClassName, DeploymentContext context) throws DeploymentException {
         throw new DeploymentException("Web services are not available in this configuration");
     }
 

Modified: geronimo/server/trunk/modules/geronimo-j2ee-builder/src/main/java/org/apache/geronimo/j2ee/deployment/WebServiceBuilder.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-j2ee-builder/src/main/java/org/apache/geronimo/j2ee/deployment/WebServiceBuilder.java?view=diff&rev=464274&r1=464273&r2=464274
==============================================================================
--- geronimo/server/trunk/modules/geronimo-j2ee-builder/src/main/java/org/apache/geronimo/j2ee/deployment/WebServiceBuilder.java (original)
+++ geronimo/server/trunk/modules/geronimo-j2ee-builder/src/main/java/org/apache/geronimo/j2ee/deployment/WebServiceBuilder.java Sun Oct 15 13:40:04 2006
@@ -18,9 +18,12 @@
 
 import org.apache.geronimo.common.DeploymentException;
 import org.apache.geronimo.gbean.GBeanData;
+import org.apache.geronimo.deployment.DeploymentContext;
+import org.apache.geronimo.kernel.repository.Environment;
+import org.apache.xmlbeans.XmlObject;
+
 import java.util.jar.JarFile;
 import java.util.Map;
-import java.net.URL;
 
 /**
  * @version $Rev$ $Date$
@@ -33,25 +36,27 @@
     * @param moduleFile J2EE module
     * @param isEJB is this an EJB archive?
     * @param correctedPortLocations mapping between port locations and paths.
+    * @param environment
     * @return Mapping of servlet names to port information, or an
     * empty map if no web services found.  Port information is opaque
     * to all except the WebServiceBuilder itself.
     * @throws DeploymentException if error encountered while introspecting the module.
     */
-   Map findWebServices(JarFile moduleFile, boolean isEJB, Map correctedPortLocations) throws DeploymentException;
-    
+   Map findWebServices(JarFile moduleFile, boolean isEJB, Map correctedPortLocations, Environment environment) throws DeploymentException;
+
     //obviously these need the deployment descriptors, but I'm not sure in what form yet.
     /**
      * configure the supplied GBeanData to implement the POJO web service described in the deployment descriptor.
      * The GBeanData will be for a ServletHolder like gbean that is adapted to holding a ws stack that talks to a
      * POJO web service.  The web deployer is responsible for filling in the standard servlet info such as init params.
      * @param targetGBean
-     * @param moduleFile
+     * @param module
      * @param portInfo
      * @param seiClassName
+     * @param context
      * @throws DeploymentException
      */
-    void configurePOJO(GBeanData targetGBean, JarFile moduleFile, Object portInfo, String seiClassName, ClassLoader classLoader) throws DeploymentException;
+    void configurePOJO(GBeanData targetGBean, Module module, Object portInfo, String seiClassName, DeploymentContext context) throws DeploymentException;
 
     /**
      * configure the supplied EJBContainer gbeandata to implement the ejb web service described in the deployment descriptor

Modified: geronimo/server/trunk/modules/geronimo-j2ee-builder/src/test/java/org/apache/geronimo/j2ee/deployment/EARConfigBuilder13NakedTest.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-j2ee-builder/src/test/java/org/apache/geronimo/j2ee/deployment/EARConfigBuilder13NakedTest.java?view=diff&rev=464274&r1=464273&r2=464274
==============================================================================
--- geronimo/server/trunk/modules/geronimo-j2ee-builder/src/test/java/org/apache/geronimo/j2ee/deployment/EARConfigBuilder13NakedTest.java (original)
+++ geronimo/server/trunk/modules/geronimo-j2ee-builder/src/test/java/org/apache/geronimo/j2ee/deployment/EARConfigBuilder13NakedTest.java Sun Oct 15 13:40:04 2006
@@ -33,7 +33,7 @@
         super.setUp();
         
         earFile = DeploymentUtil.createJarFile(resolveFile("target/test-ear-j2ee_1.3-naked.ear"));
-        ejbConfigBuilder.ejbModule = new EJBModule(false, ejbModuleName, null, null, "test-ejb-jar.jar", null, null, null);
+        ejbConfigBuilder.ejbModule = new EJBModule(false, ejbModuleName, null, null, "test-ejb-jar.jar", null, null, null, portMap);
         webConfigBuilder.contextRoot = contextRoot;
         webConfigBuilder.webModule = new WebModule(false, webModuleName, null, null, "test-war.war", null, null, null, contextRoot, portMap, WEB_NAMESPACE);
         connectorConfigBuilder.connectorModule = new ConnectorModule(false, raModuleName, null, null, "test-rar.rar", null, null, null);

Modified: geronimo/server/trunk/modules/geronimo-j2ee-builder/src/test/java/org/apache/geronimo/j2ee/deployment/EARConfigBuilder13Test.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-j2ee-builder/src/test/java/org/apache/geronimo/j2ee/deployment/EARConfigBuilder13Test.java?view=diff&rev=464274&r1=464273&r2=464274
==============================================================================
--- geronimo/server/trunk/modules/geronimo-j2ee-builder/src/test/java/org/apache/geronimo/j2ee/deployment/EARConfigBuilder13Test.java (original)
+++ geronimo/server/trunk/modules/geronimo-j2ee-builder/src/test/java/org/apache/geronimo/j2ee/deployment/EARConfigBuilder13Test.java Sun Oct 15 13:40:04 2006
@@ -33,7 +33,7 @@
         super.setUp();
         
         earFile = DeploymentUtil.createJarFile(resolveFile("target/test-ear-j2ee_1.3.ear"));
-        ejbConfigBuilder.ejbModule = new EJBModule(false, ejbModuleName, null, null, "test-ejb-jar.jar", null, null, null);
+        ejbConfigBuilder.ejbModule = new EJBModule(false, ejbModuleName, null, null, "test-ejb-jar.jar", null, null, null, portMap);
         webConfigBuilder.contextRoot = contextRoot;
         webConfigBuilder.webModule = new WebModule(false, webModuleName, null, null, "test-war.war", null, null, null, contextRoot, portMap, WEB_NAMESPACE);
         connectorConfigBuilder.connectorModule = new ConnectorModule(false, raModuleName, null, null, "test-rar.rar", null, null, null);

Modified: geronimo/server/trunk/modules/geronimo-j2ee-builder/src/test/java/org/apache/geronimo/j2ee/deployment/EARConfigBuilder14AltDDTest.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-j2ee-builder/src/test/java/org/apache/geronimo/j2ee/deployment/EARConfigBuilder14AltDDTest.java?view=diff&rev=464274&r1=464273&r2=464274
==============================================================================
--- geronimo/server/trunk/modules/geronimo-j2ee-builder/src/test/java/org/apache/geronimo/j2ee/deployment/EARConfigBuilder14AltDDTest.java (original)
+++ geronimo/server/trunk/modules/geronimo-j2ee-builder/src/test/java/org/apache/geronimo/j2ee/deployment/EARConfigBuilder14AltDDTest.java Sun Oct 15 13:40:04 2006
@@ -31,7 +31,7 @@
 {
     protected void setUp() throws Exception {
         earFile = DeploymentUtil.createJarFile(resolveFile("target/test-ear-j2ee_1.4.ear"));
-        ejbConfigBuilder.ejbModule = new EJBModule(false, ejbModuleName, null, null, "ejb.jar/", null, null, null);
+        ejbConfigBuilder.ejbModule = new EJBModule(false, ejbModuleName, null, null, "ejb.jar/", null, null, null, portMap);
         webConfigBuilder.contextRoot = contextRoot;
         webConfigBuilder.webModule = new WebModule(false, webModuleName, null, null, "war.war/", null, null, null, contextRoot, portMap, WEB_NAMESPACE);
         connectorConfigBuilder.connectorModule = new ConnectorModule(false, raModuleName, null, null, "rar.rar", null, null, null);

Modified: geronimo/server/trunk/modules/geronimo-j2ee-builder/src/test/java/org/apache/geronimo/j2ee/deployment/EARConfigBuilder14AltDDUnpackedTest.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-j2ee-builder/src/test/java/org/apache/geronimo/j2ee/deployment/EARConfigBuilder14AltDDUnpackedTest.java?view=diff&rev=464274&r1=464273&r2=464274
==============================================================================
--- geronimo/server/trunk/modules/geronimo-j2ee-builder/src/test/java/org/apache/geronimo/j2ee/deployment/EARConfigBuilder14AltDDUnpackedTest.java (original)
+++ geronimo/server/trunk/modules/geronimo-j2ee-builder/src/test/java/org/apache/geronimo/j2ee/deployment/EARConfigBuilder14AltDDUnpackedTest.java Sun Oct 15 13:40:04 2006
@@ -31,7 +31,7 @@
 {
     protected void setUp() throws Exception {
         earFile = DeploymentUtil.createJarFile(resolveFile("target/test-ear-j2ee_1.4-unpacked.ear"));
-        ejbConfigBuilder.ejbModule = new EJBModule(false, ejbModuleName, null, null, "ejb.jar/", null, null, null);
+        ejbConfigBuilder.ejbModule = new EJBModule(false, ejbModuleName, null, null, "ejb.jar/", null, null, null, portMap);
         webConfigBuilder.contextRoot = contextRoot;
         webConfigBuilder.webModule = new WebModule(false, webModuleName, null, null, "war.war/", null, null, null, contextRoot, portMap, WEB_NAMESPACE);
         connectorConfigBuilder.connectorModule = new ConnectorModule(false, raModuleName, null, null, "rar.rar/", null, null, null);

Modified: geronimo/server/trunk/modules/geronimo-j2ee-builder/src/test/java/org/apache/geronimo/j2ee/deployment/EARConfigBuilder14NakedTest.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-j2ee-builder/src/test/java/org/apache/geronimo/j2ee/deployment/EARConfigBuilder14NakedTest.java?view=diff&rev=464274&r1=464273&r2=464274
==============================================================================
--- geronimo/server/trunk/modules/geronimo-j2ee-builder/src/test/java/org/apache/geronimo/j2ee/deployment/EARConfigBuilder14NakedTest.java (original)
+++ geronimo/server/trunk/modules/geronimo-j2ee-builder/src/test/java/org/apache/geronimo/j2ee/deployment/EARConfigBuilder14NakedTest.java Sun Oct 15 13:40:04 2006
@@ -33,7 +33,7 @@
         super.setUp();
         
         earFile = DeploymentUtil.createJarFile(resolveFile("target/test-ear-j2ee_1.4-naked.ear"));
-        ejbConfigBuilder.ejbModule = new EJBModule(false, ejbModuleName, null, null, "test-ejb-jar.jar", null, null, null);
+        ejbConfigBuilder.ejbModule = new EJBModule(false, ejbModuleName, null, null, "test-ejb-jar.jar", null, null, null, portMap);
         webConfigBuilder.contextRoot = contextRoot;
         webConfigBuilder.webModule = new WebModule(false, webModuleName, null, null, "test-war.war", null, null, null, contextRoot, portMap, WEB_NAMESPACE);
         connectorConfigBuilder.connectorModule = new ConnectorModule(false, raModuleName, null, null, "test-rar.rar", null, null, null);

Modified: geronimo/server/trunk/modules/geronimo-j2ee-builder/src/test/java/org/apache/geronimo/j2ee/deployment/EARConfigBuilder14NakedUnpackedTest.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-j2ee-builder/src/test/java/org/apache/geronimo/j2ee/deployment/EARConfigBuilder14NakedUnpackedTest.java?view=diff&rev=464274&r1=464273&r2=464274
==============================================================================
--- geronimo/server/trunk/modules/geronimo-j2ee-builder/src/test/java/org/apache/geronimo/j2ee/deployment/EARConfigBuilder14NakedUnpackedTest.java (original)
+++ geronimo/server/trunk/modules/geronimo-j2ee-builder/src/test/java/org/apache/geronimo/j2ee/deployment/EARConfigBuilder14NakedUnpackedTest.java Sun Oct 15 13:40:04 2006
@@ -33,7 +33,7 @@
         super.setUp();
         
         earFile = DeploymentUtil.createJarFile(resolveFile("target/test-ear-j2ee_1.4-naked-unpacked.ear"));
-        ejbConfigBuilder.ejbModule = new EJBModule(false, ejbModuleName, null, null, "ejb.jar/", null, null, null);
+        ejbConfigBuilder.ejbModule = new EJBModule(false, ejbModuleName, null, null, "ejb.jar/", null, null, null, portMap);
         webConfigBuilder.contextRoot = contextRoot;
         webConfigBuilder.webModule = new WebModule(false, webModuleName, null, null, "war.war/", null, null, null, contextRoot, portMap, WEB_NAMESPACE);
         connectorConfigBuilder.connectorModule = new ConnectorModule(false, raModuleName, null, null, "rar.rar/", null, null, null);

Modified: geronimo/server/trunk/modules/geronimo-j2ee-builder/src/test/java/org/apache/geronimo/j2ee/deployment/EARConfigBuilder14Test.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-j2ee-builder/src/test/java/org/apache/geronimo/j2ee/deployment/EARConfigBuilder14Test.java?view=diff&rev=464274&r1=464273&r2=464274
==============================================================================
--- geronimo/server/trunk/modules/geronimo-j2ee-builder/src/test/java/org/apache/geronimo/j2ee/deployment/EARConfigBuilder14Test.java (original)
+++ geronimo/server/trunk/modules/geronimo-j2ee-builder/src/test/java/org/apache/geronimo/j2ee/deployment/EARConfigBuilder14Test.java Sun Oct 15 13:40:04 2006
@@ -33,7 +33,7 @@
         super.setUp();
         
         earFile = DeploymentUtil.createJarFile(resolveFile("target/test-ear-j2ee_1.4.ear"));
-        ejbConfigBuilder.ejbModule = new EJBModule(false, ejbModuleName, null, null, "ejb.jar", null, null, null);
+        ejbConfigBuilder.ejbModule = new EJBModule(false, ejbModuleName, null, null, "ejb.jar", null, null, null, portMap);
         webConfigBuilder.contextRoot = contextRoot;
         webConfigBuilder.webModule = new WebModule(false, webModuleName, null, null, "war.war", null, null, null, contextRoot, portMap, WEB_NAMESPACE);
         connectorConfigBuilder.connectorModule = new ConnectorModule(false, raModuleName, null, null, "rar.rar", null, null, null);

Modified: geronimo/server/trunk/modules/geronimo-j2ee-builder/src/test/java/org/apache/geronimo/j2ee/deployment/EARConfigBuilder14UnpackedTest.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-j2ee-builder/src/test/java/org/apache/geronimo/j2ee/deployment/EARConfigBuilder14UnpackedTest.java?view=diff&rev=464274&r1=464273&r2=464274
==============================================================================
--- geronimo/server/trunk/modules/geronimo-j2ee-builder/src/test/java/org/apache/geronimo/j2ee/deployment/EARConfigBuilder14UnpackedTest.java (original)
+++ geronimo/server/trunk/modules/geronimo-j2ee-builder/src/test/java/org/apache/geronimo/j2ee/deployment/EARConfigBuilder14UnpackedTest.java Sun Oct 15 13:40:04 2006
@@ -33,7 +33,7 @@
         super.setUp();
         
         earFile = DeploymentUtil.createJarFile(resolveFile("target/test-ear-j2ee_1.4-unpacked.ear"));
-        ejbConfigBuilder.ejbModule = new EJBModule(false, ejbModuleName, null, null, "ejb.jar/", null, null, null);
+        ejbConfigBuilder.ejbModule = new EJBModule(false, ejbModuleName, null, null, "ejb.jar/", null, null, null, portMap);
         webConfigBuilder.contextRoot = contextRoot;
         webConfigBuilder.webModule = new WebModule(false, webModuleName, null, null, "war.war/", null, null, null, contextRoot, portMap, WEB_NAMESPACE);
         connectorConfigBuilder.connectorModule = new ConnectorModule(false, raModuleName, null, null, "rar.rar/", null, null, null);

Modified: geronimo/server/trunk/modules/geronimo-j2ee-builder/src/test/java/org/apache/geronimo/j2ee/deployment/MockEJBConfigBuilder.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-j2ee-builder/src/test/java/org/apache/geronimo/j2ee/deployment/MockEJBConfigBuilder.java?view=diff&rev=464274&r1=464273&r2=464274
==============================================================================
--- geronimo/server/trunk/modules/geronimo-j2ee-builder/src/test/java/org/apache/geronimo/j2ee/deployment/MockEJBConfigBuilder.java (original)
+++ geronimo/server/trunk/modules/geronimo-j2ee-builder/src/test/java/org/apache/geronimo/j2ee/deployment/MockEJBConfigBuilder.java Sun Oct 15 13:40:04 2006
@@ -22,18 +22,14 @@
 import junit.framework.Assert;
 import org.apache.geronimo.common.DeploymentException;
 import org.apache.geronimo.gbean.AbstractName;
-import org.apache.geronimo.gbean.AbstractNameQuery;
 import org.apache.geronimo.j2ee.j2eeobjectnames.NameFactory;
-import org.apache.geronimo.kernel.config.Configuration;
 import org.apache.geronimo.kernel.config.ConfigurationStore;
 import org.apache.geronimo.kernel.repository.Artifact;
 import org.apache.geronimo.kernel.repository.Environment;
 import org.apache.geronimo.kernel.Naming;
 import org.apache.geronimo.deployment.ModuleIDBuilder;
 
-import javax.naming.Reference;
 import java.io.File;
-import java.net.URI;
 import java.net.URL;
 import java.util.jar.JarFile;
 import java.util.Collection;
@@ -50,12 +46,12 @@
     public Module createModule(File plan, JarFile moduleFile, Naming naming, ModuleIDBuilder idBuilder) throws DeploymentException {
         AbstractName earName = naming.createRootName(new Artifact("test", "test-ejb-jar", "", "jar"), NameFactory.NULL, NameFactory.J2EE_APPLICATION) ;
         AbstractName moduleName = naming.createChildName(earName, "ejb-jar", NameFactory.EJB_MODULE);
-        return new EJBModule(true, moduleName, null, moduleFile, "ejb.jar", null, null, null);
+        return new EJBModule(true, moduleName, null, moduleFile, "ejb.jar", null, null, null, null);
     }
 
     public Module createModule(Object plan, JarFile moduleFile, String targetPath, URL specDDUrl, Environment environment, Object moduleContextInfo, AbstractName earName, Naming naming, ModuleIDBuilder idBuilder) throws DeploymentException {
         AbstractName moduleName = naming.createChildName(earName, "ejb-jar", NameFactory.EJB_MODULE);
-        return new EJBModule(false, moduleName, null, moduleFile, targetPath, null, null, null);
+        return new EJBModule(false, moduleName, null, moduleFile, targetPath, null, null, null, null);
     }
 
     public void installModule(JarFile earFile, EARContext earContext, Module ejbModule, Collection configurationStores, ConfigurationStore targetConfigurationStore, Collection repository) {

Modified: geronimo/server/trunk/modules/geronimo-jetty-builder/src/main/java/org/apache/geronimo/jetty/deployment/JettyModuleBuilder.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-jetty-builder/src/main/java/org/apache/geronimo/jetty/deployment/JettyModuleBuilder.java?view=diff&rev=464274&r1=464273&r2=464274
==============================================================================
--- geronimo/server/trunk/modules/geronimo-jetty-builder/src/main/java/org/apache/geronimo/jetty/deployment/JettyModuleBuilder.java (original)
+++ geronimo/server/trunk/modules/geronimo-jetty-builder/src/main/java/org/apache/geronimo/jetty/deployment/JettyModuleBuilder.java Sun Oct 15 13:40:04 2006
@@ -244,7 +244,8 @@
 
         Map servletNameToPathMap = buildServletNameToPathMap(webApp, contextRoot);
 
-        Map portMap = getWebServiceBuilder().findWebServices(moduleFile, false, servletNameToPathMap);        AbstractName moduleName;
+        Map portMap = getWebServiceBuilder().findWebServices(moduleFile, false, servletNameToPathMap, environment);
+        AbstractName moduleName;
         if (earName == null) {
             earName = naming.createRootName(environment.getConfigId(), NameFactory.NULL, NameFactory.J2EE_APPLICATION);
             moduleName = naming.createChildName(earName, environment.getConfigId().toString(), NameFactory.WEB_MODULE);
@@ -323,7 +324,6 @@
 
     public void addGBeans(EARContext earContext, Module module, ClassLoader cl, Collection repository) throws DeploymentException {
         EARContext moduleContext = module.getEarContext();
-        ClassLoader moduleClassLoader = moduleContext.getClassLoader();
         AbstractName moduleName = moduleContext.getModuleName();
         WebModule webModule = (WebModule) module;
 
@@ -479,7 +479,7 @@
             Map portMap = webModule.getPortMap();
 
             ServletType[] servletTypes = webApp.getServletArray();
-            addServlets(moduleName, webModule.getModuleFile(), servletTypes, servletMappings, securityRoles, rolePermissions, portMap, moduleClassLoader, moduleContext);
+            addServlets(moduleName, webModule, servletTypes, servletMappings, securityRoles, rolePermissions, portMap, moduleContext);
 
             if (jettyWebApp.isSetSecurityRealmName()) {
                 configureSecurityRealm(earContext, webApp, jettyWebApp, webModuleData, securityRoles, rolePermissions);
@@ -843,24 +843,23 @@
      * Adds the provided servlets, taking into account the load-on-startup ordering.
      *
      * @param webModuleName   an <code>ObjectName</code> value
-     * @param moduleFile      a <code>JarFile</code> value
+     * @param module          a <code>WebModule</code> value
      * @param servletTypes    a <code>ServletType[]</code> value, contains the <code>servlet</code> entries from <code>web.xml</code>.
      * @param servletMappings a <code>Map</code> value
      * @param securityRoles   a <code>Set</code> value
      * @param rolePermissions a <code>Map</code> value
      * @param portMap         a <code>Map</code> value
-     * @param webClassLoader  a <code>ClassLoader</code> value
-     * @param earContext      an <code>EARContext</code> value
+     * @param moduleContext
      * @throws DeploymentException if an error occurs
      */
     private void addServlets(AbstractName webModuleName,
-            JarFile moduleFile,
+            WebModule module,
             ServletType[] servletTypes,
             Map servletMappings,
             Set securityRoles,
-            Map rolePermissions, Map portMap,
-            ClassLoader webClassLoader,
-            EARContext earContext) throws DeploymentException {
+            Map rolePermissions,
+            Map portMap,
+            EARContext moduleContext) throws DeploymentException {
 
         // this TreeSet will order the ServletTypes based on whether
         // they have a load-on-startup element and what its value is
@@ -883,7 +882,7 @@
         AbstractName previousServlet = null;
         for (Iterator servlets = loadOrder.iterator(); servlets.hasNext();) {
             ServletType servletType = (ServletType) servlets.next();
-            previousServlet = addServlet(webModuleName, moduleFile, previousServlet, servletType, servletMappings, securityRoles, rolePermissions, portMap, webClassLoader, earContext);
+            previousServlet = addServlet(webModuleName, module, previousServlet, servletType, servletMappings, securityRoles, rolePermissions, portMap, moduleContext);
         }
 
         // JACC v1.0 secion B.19
@@ -892,31 +891,37 @@
 
     /**
      * @param webModuleName
-     * @param moduleFile
+     * @param module
      * @param previousServlet
      * @param servletType
      * @param servletMappings
      * @param securityRoles
      * @param rolePermissions
      * @param portMap
-     * @param webClassLoader
-     * @param earContext
+     * @param moduleContext
      * @return AbstractName of servlet gbean added
      * @throws DeploymentException
      */
     private AbstractName addServlet(AbstractName webModuleName,
-            JarFile moduleFile,
+            WebModule module,
             AbstractName previousServlet,
             ServletType servletType,
             Map servletMappings,
             Set securityRoles,
-            Map rolePermissions, Map portMap,
-            ClassLoader webClassLoader,
-            EARContext earContext) throws DeploymentException {
+            Map rolePermissions,
+            Map portMap,
+            EARContext moduleContext) throws DeploymentException {
+        ClassLoader webClassLoader = moduleContext.getClassLoader();
         String servletName = servletType.getServletName().getStringValue().trim();
-        AbstractName servletAbstractName = earContext.getNaming().createChildName(webModuleName, servletName, NameFactory.SERVLET);
+        AbstractName servletAbstractName = moduleContext.getNaming().createChildName(webModuleName, servletName, NameFactory.SERVLET);
         GBeanData servletData;
         Map initParams = new HashMap();
+        Class baseServletClass;
+        try {
+            baseServletClass = webClassLoader.loadClass(Servlet.class.getName());
+        } catch (ClassNotFoundException e) {
+            throw new DeploymentException("Could not load javax.servlet.Servlet in web classloader", e); // TODO identify web app in message
+        }
         if (servletType.isSetServletClass()) {
             String servletClassName = servletType.getServletClass().getStringValue().trim();
             Class servletClass;
@@ -925,12 +930,6 @@
             } catch (ClassNotFoundException e) {
                 throw new DeploymentException("Could not load servlet class " + servletClassName, e); // TODO identify web app in message
             }
-            Class baseServletClass;
-            try {
-                baseServletClass = webClassLoader.loadClass(Servlet.class.getName());
-            } catch (ClassNotFoundException e) {
-                throw new DeploymentException("Could not load javax.servlet.Servlet in web classloader", e); // TODO identify web app in message
-            }
             if (baseServletClass.isAssignableFrom(servletClass)) {
                 servletData = new GBeanData(servletAbstractName, JettyServletHolder.GBEAN_INFO);
                 servletData.setAttribute("servletClass", servletClassName);
@@ -939,10 +938,10 @@
                 servletData.setAbstractName(servletAbstractName);
                 //let the web service builder deal with configuring the gbean with the web service stack
                 Object portInfo = portMap.get(servletName);
-                if (portInfo == null) {
-                    throw new DeploymentException("No web service deployment info for servlet name " + servletName); // TODO identify web app in message
-                }
-                getWebServiceBuilder().configurePOJO(servletData, moduleFile, portInfo, servletClassName, webClassLoader);
+//                if (portInfo == null) {
+//                    throw new DeploymentException("No web service deployment info for servlet name " + servletName); // TODO identify web app in message
+//                }
+                getWebServiceBuilder().configurePOJO(servletData, module, portInfo, servletClassName, moduleContext);
             }
         } else if (servletType.isSetJspFile()) {
             servletData = new GBeanData(servletAbstractName, JettyServletHolder.GBEAN_INFO);
@@ -986,7 +985,7 @@
         processRoleRefPermissions(servletType, securityRoles, rolePermissions);
 
         try {
-            earContext.addGBean(servletData);
+            moduleContext.addGBean(servletData);
         } catch (GBeanAlreadyExistsException e) {
             throw new DeploymentException("Could not add servlet gbean to context", e); // TODO identify web app in message
         }

Modified: geronimo/server/trunk/modules/geronimo-jetty/src/main/java/org/apache/geronimo/jetty/JettyPOJOWebServiceHolder.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-jetty/src/main/java/org/apache/geronimo/jetty/JettyPOJOWebServiceHolder.java?view=diff&rev=464274&r1=464273&r2=464274
==============================================================================
--- geronimo/server/trunk/modules/geronimo-jetty/src/main/java/org/apache/geronimo/jetty/JettyPOJOWebServiceHolder.java (original)
+++ geronimo/server/trunk/modules/geronimo-jetty/src/main/java/org/apache/geronimo/jetty/JettyPOJOWebServiceHolder.java Sun Oct 15 13:40:04 2006
@@ -34,6 +34,7 @@
 import org.apache.geronimo.webservices.POJOWebServiceServlet;
 import org.apache.geronimo.webservices.WebServiceContainer;
 import org.apache.geronimo.webservices.WebServiceContainerInvoker;
+import org.apache.geronimo.webservices.WebServiceContainerFactory;
 import org.mortbay.jetty.servlet.ServletHolder;
 import org.mortbay.jetty.servlet.ServletHttpRequest;
 
@@ -60,7 +61,7 @@
                                      Map initParams,
                                      Integer loadOnStartup,
                                      Set servletMappings,
-                                     WebServiceContainer webServiceContainer,
+                                     WebServiceContainerFactory webServiceContainerFactory,
                                      ServletHolder previous,    //dependency for startup ordering
                                      JettyServletRegistration context) throws Exception {
         super(context == null ? null : context.getServletHandler(), servletName, POJOWebServiceServlet.class.getName(), null);
@@ -68,7 +69,7 @@
 
         this.pojoClassName = pojoClassName;
         this.context = context;
-        this.webServiceContainer = webServiceContainer;
+        this.webServiceContainer = webServiceContainerFactory == null? null: webServiceContainerFactory.getWebServiceContainer();
         if (context != null) {
             putAll(initParams);
             if (loadOnStartup != null) {
@@ -147,7 +148,7 @@
         infoBuilder.addAttribute("initParams", Map.class, true);
         infoBuilder.addAttribute("loadOnStartup", Integer.class, true);
         infoBuilder.addAttribute("servletMappings", Set.class, true);
-        infoBuilder.addAttribute("webServiceContainer", WebServiceContainer.class, true);
+        infoBuilder.addReference("WebServiceContainerFactory", WebServiceContainerFactory.class);
         infoBuilder.addReference("Previous", ServletHolder.class, NameFactory.SERVLET);
         infoBuilder.addReference("JettyServletRegistration", JettyServletRegistration.class);
 
@@ -156,7 +157,7 @@
                                                 "initParams",
                                                 "loadOnStartup",
                                                 "servletMappings",
-                                                "webServiceContainer",
+                                                "WebServiceContainerFactory",
                                                 "Previous",
                                                 "JettyServletRegistration"});
 

Modified: geronimo/server/trunk/modules/geronimo-kernel/src/main/java/org/apache/geronimo/gbean/runtime/GBeanAttribute.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-kernel/src/main/java/org/apache/geronimo/gbean/runtime/GBeanAttribute.java?view=diff&rev=464274&r1=464273&r2=464274
==============================================================================
--- geronimo/server/trunk/modules/geronimo-kernel/src/main/java/org/apache/geronimo/gbean/runtime/GBeanAttribute.java (original)
+++ geronimo/server/trunk/modules/geronimo-kernel/src/main/java/org/apache/geronimo/gbean/runtime/GBeanAttribute.java Sun Oct 15 13:40:04 2006
@@ -195,7 +195,8 @@
         if (gbeanInstance == null || attributeInfo == null) {
             throw new IllegalArgumentException("null param(s) supplied");
         }
-        if (!attributeInfo.isReadable() && !attributeInfo.isWritable() && !attributeInfo.isPersistent() && !isConstructorArg) {
+        if (!attributeInfo.isReadable() && !attributeInfo.isWritable() && !attributeInfo.isPersistent() && !isConstructorArg)
+        {
             throw new InvalidConfigurationException("An attribute must be readable, writable, persistent or a constructor arg: " +
                     " name=" + attributeInfo.getName() + " targetClass=" + gbeanInstance.getType().getName());
         }
@@ -236,7 +237,11 @@
                     Method getterMethod = gbeanInstance.getType().getMethod(getterName, null);
 
                     if (!getterMethod.getReturnType().equals(type)) {
-                        throw new InvalidConfigurationException("Getter method of wrong type: " + getterMethod.getReturnType() + " expected " +getDescription());
+                        if (getterMethod.getReturnType().getName().equals(type.getName())) {
+                            throw new InvalidConfigurationException("Getter return type in wrong classloader: type: " + type + " wanted in classloader: " + type.getClassLoader() + " actual: " + getterMethod.getReturnType().getClassLoader());
+                        } else {
+                            throw new InvalidConfigurationException("Getter method of wrong type: " + getterMethod.getReturnType() + " expected " + getDescription());
+                        }
                     }
                     if (AbstractGBeanReference.NO_PROXY) {
                         getInvoker = new ReflectionMethodInvoker(getterMethod);
@@ -244,7 +249,7 @@
                         getInvoker = new FastMethodInvoker(getterMethod);
                     }
                 } catch (NoSuchMethodException e) {
-                    throw new InvalidConfigurationException("Getter method not found " +getDescription());
+                    throw new InvalidConfigurationException("Getter method not found " + getDescription());
                 }
             } else {
                 getInvoker = null;
@@ -255,7 +260,7 @@
             if (attributeInfo.getSetterName() != null) {
                 try {
                     String setterName = attributeInfo.getSetterName();
-                    Method setterMethod = gbeanInstance.getType().getMethod(setterName, new Class[] {type});
+                    Method setterMethod = gbeanInstance.getType().getMethod(setterName, new Class[]{type});
                     if (AbstractGBeanReference.NO_PROXY) {
                         setInvoker = new ReflectionMethodInvoker(setterMethod);
                     } else {

Modified: geronimo/server/trunk/modules/geronimo-tomcat-builder/src/main/java/org/apache/geronimo/tomcat/deployment/TomcatModuleBuilder.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-tomcat-builder/src/main/java/org/apache/geronimo/tomcat/deployment/TomcatModuleBuilder.java?view=diff&rev=464274&r1=464273&r2=464274
==============================================================================
--- geronimo/server/trunk/modules/geronimo-tomcat-builder/src/main/java/org/apache/geronimo/tomcat/deployment/TomcatModuleBuilder.java (original)
+++ geronimo/server/trunk/modules/geronimo-tomcat-builder/src/main/java/org/apache/geronimo/tomcat/deployment/TomcatModuleBuilder.java Sun Oct 15 13:40:04 2006
@@ -32,6 +32,8 @@
 import java.util.Set;
 import java.util.jar.JarFile;
 
+import javax.servlet.Servlet;
+
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.apache.geronimo.common.DeploymentException;
@@ -47,6 +49,7 @@
 import org.apache.geronimo.gbean.GBeanInfo;
 import org.apache.geronimo.gbean.GBeanInfoBuilder;
 import org.apache.geronimo.gbean.SingleElementCollection;
+import org.apache.geronimo.gbean.ReferencePatterns;
 import org.apache.geronimo.j2ee.deployment.EARContext;
 import org.apache.geronimo.j2ee.deployment.Module;
 import org.apache.geronimo.j2ee.deployment.ModuleBuilder;
@@ -73,7 +76,6 @@
 import org.apache.geronimo.tomcat.util.SecurityHolder;
 import org.apache.geronimo.web.deployment.AbstractWebModuleBuilder;
 import org.apache.geronimo.web.deployment.GenericToSpecificPlanConverter;
-import org.apache.geronimo.webservices.WebServiceContainer;
 import org.apache.geronimo.xbeans.geronimo.web.tomcat.TomcatWebAppDocument;
 import org.apache.geronimo.xbeans.geronimo.web.tomcat.TomcatWebAppType;
 import org.apache.geronimo.xbeans.geronimo.web.tomcat.config.GerTomcatDocument;
@@ -178,7 +180,7 @@
 
         Map servletNameToPathMap = buildServletNameToPathMap(webApp, contextRoot);
 
-        Map portMap = getWebServiceBuilder().findWebServices(moduleFile, false, servletNameToPathMap);
+        Map portMap = getWebServiceBuilder().findWebServices(moduleFile, false, servletNameToPathMap, environment);
         AbstractName moduleName;
         if (earName == null) {
             earName = naming.createRootName(environment.getConfigId(), NameFactory.NULL, NameFactory.J2EE_APPLICATION);
@@ -260,7 +262,7 @@
 
     public void addGBeans(EARContext earContext, Module module, ClassLoader cl, Collection repository) throws DeploymentException {
         EARContext moduleContext = module.getEarContext();
-        ClassLoader moduleClassLoader = moduleContext.getClassLoader();
+        ClassLoader webClassLoader = moduleContext.getClassLoader();
         AbstractName moduleName = moduleContext.getModuleName();
         WebModule webModule = (WebModule) module;
 
@@ -346,27 +348,41 @@
             //Handle the role permissions and webservices on the servlets.
             ServletType[] servletTypes = webApp.getServletArray();
             Map webServices = new HashMap();
+            Class baseServletClass;
+            try {
+                baseServletClass = webClassLoader.loadClass(Servlet.class.getName());
+            } catch (ClassNotFoundException e) {
+                throw new DeploymentException("Could not load javax.servlet.Servlet in web classloader", e); // TODO identify web app in message
+            }
             for (int i = 0; i < servletTypes.length; i++) {
                 ServletType servletType = servletTypes[i];
 
                 //Handle the Role Ref Permissions
                 processRoleRefPermissions(servletType, securityRoles, rolePermissions);
 
-                //Do we have webservices configured?
-                if (portMap != null) {
-                    //Check if the Servlet is a Webservice
+                if (servletType.isSetServletClass()) {
                     String servletName = servletType.getServletName().getStringValue().trim();
-                    if (portMap.containsKey(servletName)) {
-                        //Yes, this servlet is a web service so let the web service builder
-                        // deal with configuring the web service stack
-                        String servletClassName = servletType.getServletClass().getStringValue().trim();
+                    String servletClassName = servletType.getServletClass().getStringValue().trim();
+                    Class servletClass;
+                    try {
+                        servletClass = webClassLoader.loadClass(servletClassName);
+                    } catch (ClassNotFoundException e) {
+                        throw new DeploymentException("Could not load servlet class " + servletClassName, e); // TODO identify web app in message
+                    }
+                    if (!baseServletClass.isAssignableFrom(servletClass)) {
+                        //fake servletData
+                        AbstractName servletAbstractName = moduleContext.getNaming().createChildName(moduleName, servletName, NameFactory.SERVLET);
+                        GBeanData servletData = new GBeanData();
+                        servletData.setAbstractName(servletAbstractName);
+                        //let the web service builder deal with configuring the gbean with the web service stack
+                        //Here we just extract the factory reference
                         Object portInfo = portMap.get(servletName);
-                        if (portInfo == null) {
-                            throw new DeploymentException("No web service deployment info for servlet name " + servletName + " in web app " + module.getName());
-                        }
-
-                        WebServiceContainer wsContainer = configurePOJO(webModule.getModuleFile(), portInfo, servletClassName, moduleClassLoader);
-                        webServices.put(servletName, wsContainer);
+                        getWebServiceBuilder().configurePOJO(servletData, module, portInfo, servletClassName, moduleContext);
+                        ReferencePatterns patterns = servletData.getReferencePatterns("WebServiceContainerFactory");
+                        AbstractName wsContainerFactoryName = patterns.getAbstractName();
+                        webServices.put(servletName, wsContainerFactoryName);
+                        //force all the factories to start before the web app that needs them.
+                        webModuleData.addDependency(wsContainerFactoryName);
                     }
                 }
             }
@@ -426,16 +442,6 @@
 
     public String getSchemaNamespace() {
         return TOMCAT_NAMESPACE;
-    }
-
-    public WebServiceContainer configurePOJO(JarFile moduleFile, Object portInfoObject, String seiClassName, ClassLoader classLoader) throws DeploymentException, IOException {
-        //the reason to configure a gbeandata rather than just fetch the WebServiceContainer is that fetching the WSContainer ties us to that
-        //ws implementation.  By configuring a servlet gbean, you can provide a different servlet for each combination of
-        //web container and ws implementation while assuming almost nothing about their relationship.
-
-        GBeanData fakeData = new GBeanData();
-        getWebServiceBuilder().configurePOJO(fakeData, moduleFile, portInfoObject, seiClassName, classLoader);
-        return (WebServiceContainer) fakeData.getAttribute("webServiceContainer");
     }
 
 

Added: geronimo/server/trunk/modules/geronimo-tomcat-builder/src/test/java/org/apache/geronimo/tomcat/app/HelloWorld.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-tomcat-builder/src/test/java/org/apache/geronimo/tomcat/app/HelloWorld.java?view=auto&rev=464274
==============================================================================
--- geronimo/server/trunk/modules/geronimo-tomcat-builder/src/test/java/org/apache/geronimo/tomcat/app/HelloWorld.java (added)
+++ geronimo/server/trunk/modules/geronimo-tomcat-builder/src/test/java/org/apache/geronimo/tomcat/app/HelloWorld.java Sun Oct 15 13:40:04 2006
@@ -0,0 +1,28 @@
+/*
+ * 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.tomcat.app;
+
+/**
+ * @version $Rev:$ $Date:$
+ */
+public interface HelloWorld {
+    String hi(String name);
+}

Propchange: geronimo/server/trunk/modules/geronimo-tomcat-builder/src/test/java/org/apache/geronimo/tomcat/app/HelloWorld.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/server/trunk/modules/geronimo-tomcat-builder/src/test/java/org/apache/geronimo/tomcat/app/HelloWorld.java
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: geronimo/server/trunk/modules/geronimo-tomcat-builder/src/test/java/org/apache/geronimo/tomcat/app/HelloWorld.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: geronimo/server/trunk/modules/geronimo-tomcat-builder/src/test/java/org/apache/geronimo/tomcat/app/HelloWorldWS.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-tomcat-builder/src/test/java/org/apache/geronimo/tomcat/app/HelloWorldWS.java?view=auto&rev=464274
==============================================================================
--- geronimo/server/trunk/modules/geronimo-tomcat-builder/src/test/java/org/apache/geronimo/tomcat/app/HelloWorldWS.java (added)
+++ geronimo/server/trunk/modules/geronimo-tomcat-builder/src/test/java/org/apache/geronimo/tomcat/app/HelloWorldWS.java Sun Oct 15 13:40:04 2006
@@ -0,0 +1,31 @@
+/*
+ * 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.tomcat.app;
+
+/**
+ * @version $Rev:$ $Date:$
+ */
+public class HelloWorldWS implements HelloWorld {
+
+    public String hi(String name) {
+        return "hi " + name;
+    }
+}

Propchange: geronimo/server/trunk/modules/geronimo-tomcat-builder/src/test/java/org/apache/geronimo/tomcat/app/HelloWorldWS.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/server/trunk/modules/geronimo-tomcat-builder/src/test/java/org/apache/geronimo/tomcat/app/HelloWorldWS.java
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: geronimo/server/trunk/modules/geronimo-tomcat-builder/src/test/java/org/apache/geronimo/tomcat/app/HelloWorldWS.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: geronimo/server/trunk/modules/geronimo-tomcat-builder/src/test/java/org/apache/geronimo/tomcat/deployment/MockWebServiceBuilder.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-tomcat-builder/src/test/java/org/apache/geronimo/tomcat/deployment/MockWebServiceBuilder.java?view=auto&rev=464274
==============================================================================
--- geronimo/server/trunk/modules/geronimo-tomcat-builder/src/test/java/org/apache/geronimo/tomcat/deployment/MockWebServiceBuilder.java (added)
+++ geronimo/server/trunk/modules/geronimo-tomcat-builder/src/test/java/org/apache/geronimo/tomcat/deployment/MockWebServiceBuilder.java Sun Oct 15 13:40:04 2006
@@ -0,0 +1,59 @@
+/*
+ * 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.tomcat.deployment;
+
+import java.util.Map;
+import java.util.Collections;
+import java.util.jar.JarFile;
+
+import org.apache.geronimo.j2ee.deployment.WebServiceBuilder;
+import org.apache.geronimo.j2ee.deployment.Module;
+import org.apache.geronimo.j2ee.j2eeobjectnames.NameFactory;
+import org.apache.geronimo.kernel.repository.Environment;
+import org.apache.geronimo.kernel.GBeanAlreadyExistsException;
+import org.apache.geronimo.common.DeploymentException;
+import org.apache.geronimo.gbean.GBeanData;
+import org.apache.geronimo.gbean.AbstractName;
+import org.apache.geronimo.deployment.DeploymentContext;
+import org.apache.geronimo.webservices.SerializableWebServiceContainerFactoryGBean;
+
+/**
+ * @version $Rev:$ $Date:$
+ */
+public class MockWebServiceBuilder implements WebServiceBuilder {
+    public Map findWebServices(JarFile moduleFile, boolean isEJB, Map correctedPortLocations, Environment environment) throws DeploymentException {
+        return Collections.EMPTY_MAP;
+    }
+
+    public void configurePOJO(GBeanData targetGBean, Module module, Object portInfo, String seiClassName, DeploymentContext context) throws DeploymentException {
+        AbstractName webServiceContainerFactoryName = context.getNaming().createChildName(targetGBean.getAbstractName(), "webServiceContainer", NameFactory.GERONIMO_SERVICE);
+        GBeanData webServiceContainerFactoryGBean = new GBeanData(webServiceContainerFactoryName, SerializableWebServiceContainerFactoryGBean.GBEAN_INFO);
+        try {
+            context.addGBean(webServiceContainerFactoryGBean);
+        } catch (GBeanAlreadyExistsException e) {
+            throw new DeploymentException("Could not add webServiceContainerFactoryGBean", e);
+        }
+        targetGBean.setReferencePattern("WebServiceContainerFactory", webServiceContainerFactoryName);
+    }
+
+    public void configureEJB(GBeanData targetGBean, JarFile moduleFile, Object portInfo, ClassLoader classLoader) throws DeploymentException {
+    }
+}

Propchange: geronimo/server/trunk/modules/geronimo-tomcat-builder/src/test/java/org/apache/geronimo/tomcat/deployment/MockWebServiceBuilder.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/server/trunk/modules/geronimo-tomcat-builder/src/test/java/org/apache/geronimo/tomcat/deployment/MockWebServiceBuilder.java
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: geronimo/server/trunk/modules/geronimo-tomcat-builder/src/test/java/org/apache/geronimo/tomcat/deployment/MockWebServiceBuilder.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Modified: geronimo/server/trunk/modules/geronimo-tomcat-builder/src/test/java/org/apache/geronimo/tomcat/deployment/TomcatModuleBuilderTest.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-tomcat-builder/src/test/java/org/apache/geronimo/tomcat/deployment/TomcatModuleBuilderTest.java?view=diff&rev=464274&r1=464273&r2=464274
==============================================================================
--- geronimo/server/trunk/modules/geronimo-tomcat-builder/src/test/java/org/apache/geronimo/tomcat/deployment/TomcatModuleBuilderTest.java (original)
+++ geronimo/server/trunk/modules/geronimo-tomcat-builder/src/test/java/org/apache/geronimo/tomcat/deployment/TomcatModuleBuilderTest.java Sun Oct 15 13:40:04 2006
@@ -287,7 +287,7 @@
         engine.setReferencePattern("RealmGBean", realm.getAbstractName());
         engine.setReferencePattern("Hosts", host.getAbstractName());
 
-        WebServiceBuilder webServiceBuilder = new UnavailableWebServiceBuilder();
+        WebServiceBuilder webServiceBuilder = new MockWebServiceBuilder();
 
         GBeanData containerData = bootstrap.addGBean("TomcatContainer", TomcatContainer.GBEAN_INFO);
         containerData.setAttribute("catalinaHome", new File(BASEDIR, "target/var/catalina").toString());

Modified: geronimo/server/trunk/modules/geronimo-tomcat-builder/src/test/resources/deployables/war5/WEB-INF/web.xml
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-tomcat-builder/src/test/resources/deployables/war5/WEB-INF/web.xml?view=diff&rev=464274&r1=464273&r2=464274
==============================================================================
--- geronimo/server/trunk/modules/geronimo-tomcat-builder/src/test/resources/deployables/war5/WEB-INF/web.xml (original)
+++ geronimo/server/trunk/modules/geronimo-tomcat-builder/src/test/resources/deployables/war5/WEB-INF/web.xml Sun Oct 15 13:40:04 2006
@@ -8,7 +8,7 @@
 
     <servlet>
         <servlet-name>HelloWorldServlet</servlet-name>
-        <servlet-class>org.apache.geronimo.ws.HelloWorldWS</servlet-class>
+        <servlet-class>org.apache.geronimo.tomcat.app.HelloWorldWS</servlet-class>
     </servlet>
 
     <servlet-mapping>

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=464274&r1=464273&r2=464274
==============================================================================
--- 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 Sun Oct 15 13:40:04 2006
@@ -21,6 +21,7 @@
 import java.util.Iterator;
 import java.util.List;
 import java.util.Map;
+
 import javax.naming.NamingException;
 import javax.security.auth.Subject;
 import javax.security.jacc.PolicyContext;
@@ -70,10 +71,10 @@
     private Map webServiceMap = null;
 
     private boolean pipelineInitialized;
-    
+
     private BeforeAfter beforeAfter = null;
     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) {
@@ -91,11 +92,11 @@
         } catch (NamingException ne) {
             log.error(ne);
         }
-        
+
         int index = 0;
-        BeforeAfter interceptor = new InstanceContextBeforeAfter(null, index++, 
-                ctx.getUnshareableResources(), 
-                ctx.getApplicationManagedSecurityResources(), 
+        BeforeAfter interceptor = new InstanceContextBeforeAfter(null, index++,
+                ctx.getUnshareableResources(),
+                ctx.getApplicationManagedSecurityResources(),
                 ctx.getTrackedConnectionAssociator());
 
         // Set ComponentContext BeforeAfter
@@ -124,13 +125,13 @@
                 interceptor = new PolicyContextBeforeAfter(interceptor, index++, index++, securityHolder.getPolicyContextID());
             }
         }
-        
+
         //Set the BeforeAfters as a valve
         GeronimoBeforeAfterValve geronimoBAValve = new GeronimoBeforeAfterValve(interceptor, index);
         addValve(geronimoBAValve);
         beforeAfter = interceptor;
         contextCount = index;
-        
+
         //Not clear if user defined valves should be involved in init processing.  Probably not since
         //request and response are null.
 
@@ -149,7 +150,7 @@
         CatalinaCluster cluster = ctx.getCluster();
         if (cluster != null)
             this.setCluster(cluster);
-        
+
         Manager manager = ctx.getManager();
         if (manager != null)
             this.setManager(manager);
@@ -160,7 +161,7 @@
         this.setCrossContext(ctx.isCrossContext());
 
         this.setCookies(!ctx.isDisableCookies());
-        
+
         //Set the Dispatch listener
         this.addInstanceListener("org.apache.geronimo.tomcat.listener.DispatchListener");
     }
@@ -172,7 +173,7 @@
                 valve.invoke(null, null);
                 //Install the DefaultSubjectValve after the authentication valve so the default subject is supplied
                 //only if no real subject is authenticated.
-                
+
                 Valve defaultSubjectValve = new DefaultSubjectValve(defaultSubject);
                 addValve(defaultSubjectValve);
             } catch (IOException e) {
@@ -244,7 +245,7 @@
 
     public synchronized void setLoader(final Loader delegate) {
         Loader loader = new Loader() {
-            
+
             public void backgroundProcess() {
                 delegate.backgroundProcess();
             }
@@ -305,7 +306,7 @@
                 delegate.removePropertyChangeListener(listener);
             }
         };
-        
+
         super.setLoader(loader);
     }
 

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=464274&r1=464273&r2=464274
==============================================================================
--- 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 Sun Oct 15 13:40:04 2006
@@ -17,6 +17,23 @@
 
 package org.apache.geronimo.tomcat;
 
+import java.net.MalformedURLException;
+import java.net.URI;
+import java.net.URL;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.Hashtable;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
+import javax.management.MalformedObjectNameException;
+import javax.management.ObjectName;
+import javax.naming.directory.DirContext;
+import javax.transaction.TransactionManager;
+import javax.transaction.UserTransaction;
+
 import org.apache.catalina.Context;
 import org.apache.catalina.Manager;
 import org.apache.catalina.Realm;
@@ -25,6 +42,8 @@
 import org.apache.catalina.core.StandardContext;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
+import org.apache.geronimo.connector.outbound.connectiontracking.TrackedConnectionAssociator;
+import org.apache.geronimo.gbean.AbstractName;
 import org.apache.geronimo.gbean.GBeanInfo;
 import org.apache.geronimo.gbean.GBeanInfoBuilder;
 import org.apache.geronimo.gbean.GBeanLifecycle;
@@ -34,32 +53,16 @@
 import org.apache.geronimo.kernel.ObjectNameUtil;
 import org.apache.geronimo.management.J2EEApplication;
 import org.apache.geronimo.management.J2EEServer;
-import org.apache.geronimo.management.geronimo.WebModule;
-import org.apache.geronimo.management.geronimo.WebContainer;
 import org.apache.geronimo.management.geronimo.WebConnector;
-import org.apache.geronimo.security.jacc.RoleDesignateSource;
+import org.apache.geronimo.management.geronimo.WebContainer;
+import org.apache.geronimo.management.geronimo.WebModule;
 import org.apache.geronimo.tomcat.cluster.CatalinaClusterGBean;
 import org.apache.geronimo.tomcat.util.SecurityHolder;
-import org.apache.geronimo.connector.outbound.connectiontracking.TrackedConnectionAssociator;
 import org.apache.geronimo.transaction.GeronimoUserTransaction;
+import org.apache.geronimo.webservices.WebServiceContainer;
+import org.apache.geronimo.webservices.WebServiceContainerFactory;
 import org.apache.naming.resources.DirContextURLStreamHandler;
 
-import javax.management.ObjectName;
-import javax.management.MalformedObjectNameException;
-import javax.naming.directory.DirContext;
-import javax.transaction.TransactionManager;
-import javax.transaction.UserTransaction;
-
-import java.net.URI;
-import java.net.URL;
-import java.net.MalformedURLException;
-import java.util.ArrayList;
-import java.util.Hashtable;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-import java.util.HashMap;
-
 /**
  * Wrapper for a WebApplicationContext that sets up its J2EE environment.
  *
@@ -218,7 +221,7 @@
 
         this.disableCookies = disableCookies;
 
-        this.webServices = webServices;
+        this.webServices = createWebServices(webServices, kernel);
 
         this.classLoader = classLoader;
 
@@ -230,6 +233,21 @@
 
     }
 
+    private Map createWebServices(Map webServiceFactoryMap, Kernel kernel) throws Exception {
+        Map webServices = new HashMap();
+        if (webServiceFactoryMap != null) {
+            for (Iterator iterator = webServiceFactoryMap.entrySet().iterator(); iterator.hasNext();) {
+                Map.Entry entry = (Map.Entry) iterator.next();
+                String servletName = (String) entry.getKey();
+                AbstractName factoryName = (AbstractName) entry.getValue();
+                WebServiceContainerFactory webServiceContainerFactory = (WebServiceContainerFactory) kernel.getGBean(factoryName);
+                WebServiceContainer webServiceContainer = webServiceContainerFactory.getWebServiceContainer();
+                webServices.put(servletName, webServiceContainer);
+            }
+        }
+        return webServices;
+    }
+
     public String getObjectName() {
         return objectName;
     }
@@ -449,7 +467,7 @@
     public void doStop() throws Exception {
         container.removeContext(this);
         DirContextURLStreamHandler.unbind(classLoader);
- 
+
         // No more logging will occur for this ClassLoader. Inform the LogFactory to avoid a memory leak.
 //        LogFactory.release(classLoader);
 



Mime
View raw message