geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From djen...@apache.org
Subject svn commit: r155297 - in geronimo/trunk/modules: axis-builder/src/java/org/apache/geronimo/axis/builder/ axis-builder/src/test/org/apache/geronimo/axis/builder/ axis/src/test/org/apache/geronimo/axis/testUtils/ client-builder/src/java/org/apache/geronimo/client/builder/ client-builder/src/schema/ connector-builder/src/test/org/apache/geronimo/connector/deployment/ j2ee-builder/src/java/org/apache/geronimo/j2ee/deployment/ j2ee-builder/src/test/org/apache/geronimo/j2ee/deployment/ j2ee-schema/src/java/org/apache/geronimo/schema/ jetty-builder/src/java/org/apache/geronimo/jetty/deployment/ jetty-builder/src/schema/ jetty-builder/src/test/org/apache/geronimo/jetty/deployment/ naming-builder/src/java/org/apache/geronimo/naming/deployment/ naming-builder/src/schema/ tomcat/src/java/org/apache/geronimo/tomcat/deployment/
Date Fri, 25 Feb 2005 03:43:02 GMT
Author: djencks
Date: Thu Feb 24 19:42:58 2005
New Revision: 155297

URL: http://svn.apache.org/viewcvs?view=rev&rev=155297
Log:
Allow setting location of ws in service-ref plans

Modified:
    geronimo/trunk/modules/axis-builder/src/java/org/apache/geronimo/axis/builder/AxisBuilder.java
    geronimo/trunk/modules/axis-builder/src/java/org/apache/geronimo/axis/builder/WSDescriptorParser.java
    geronimo/trunk/modules/axis-builder/src/test/org/apache/geronimo/axis/builder/ServiceReferenceTest.java
    geronimo/trunk/modules/axis/src/test/org/apache/geronimo/axis/testUtils/TestingUtils.java
    geronimo/trunk/modules/client-builder/src/java/org/apache/geronimo/client/builder/AppClientModuleBuilder.java
    geronimo/trunk/modules/client-builder/src/schema/geronimo-application-client.xsd
    geronimo/trunk/modules/connector-builder/src/test/org/apache/geronimo/connector/deployment/ConnectorModuleBuilderTest.java
    geronimo/trunk/modules/j2ee-builder/src/java/org/apache/geronimo/j2ee/deployment/RefContext.java
    geronimo/trunk/modules/j2ee-builder/src/java/org/apache/geronimo/j2ee/deployment/ServiceReferenceBuilder.java
    geronimo/trunk/modules/j2ee-builder/src/test/org/apache/geronimo/j2ee/deployment/EARConfigBuilderTest.java
    geronimo/trunk/modules/j2ee-builder/src/test/org/apache/geronimo/j2ee/deployment/EJBRefContextTest.java
    geronimo/trunk/modules/j2ee-schema/src/java/org/apache/geronimo/schema/SchemaConversionUtils.java
    geronimo/trunk/modules/jetty-builder/src/java/org/apache/geronimo/jetty/deployment/JettyModuleBuilder.java
    geronimo/trunk/modules/jetty-builder/src/schema/geronimo-jetty.xsd
    geronimo/trunk/modules/jetty-builder/src/test/org/apache/geronimo/jetty/deployment/JettyModuleBuilderTest.java
    geronimo/trunk/modules/naming-builder/src/java/org/apache/geronimo/naming/deployment/ENCConfigBuilder.java
    geronimo/trunk/modules/naming-builder/src/schema/geronimo-naming.xsd
    geronimo/trunk/modules/tomcat/src/java/org/apache/geronimo/tomcat/deployment/TomcatModuleBuilder.java

Modified: geronimo/trunk/modules/axis-builder/src/java/org/apache/geronimo/axis/builder/AxisBuilder.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/axis-builder/src/java/org/apache/geronimo/axis/builder/AxisBuilder.java?view=diff&r1=155296&r2=155297
==============================================================================
--- geronimo/trunk/modules/axis-builder/src/java/org/apache/geronimo/axis/builder/AxisBuilder.java
(original)
+++ geronimo/trunk/modules/axis-builder/src/java/org/apache/geronimo/axis/builder/AxisBuilder.java
Thu Feb 24 19:42:58 2005
@@ -133,7 +133,7 @@
 
 
     //ServicereferenceBuilder
-    public Object createService(Class serviceInterface, URI wsdlURI, URI jaxrpcMappingURI,
QName serviceQName, Map portComponentRefMap, List handlerInfos, DeploymentContext deploymentContext,
Module module, ClassLoader classLoader) throws DeploymentException {
+    public Object createService(Class serviceInterface, URI wsdlURI, URI jaxrpcMappingURI,
QName serviceQName, Map portComponentRefMap, List handlerInfos, Map portLocationMap, DeploymentContext
deploymentContext, Module module, ClassLoader classLoader) throws DeploymentException {
         JarFile moduleFile = module.getModuleFile();
         Definition definition = null;
         JavaWsdlMappingType mapping = null;
@@ -143,7 +143,7 @@
             mapping = WSDescriptorParser.readJaxrpcMapping(moduleFile, jaxrpcMappingURI);
         }
 
-        Object service = createService(serviceInterface, definition, mapping, serviceQName,
SOAP_VERSION, handlerInfos, deploymentContext, module, classLoader);
+        Object service = createService(serviceInterface, definition, mapping, serviceQName,
SOAP_VERSION, handlerInfos, portLocationMap, deploymentContext, module, classLoader);
         ByteArrayOutputStream baos = new ByteArrayOutputStream();
         ObjectOutputStream oos = null;
         try {
@@ -158,12 +158,12 @@
         return reference;
     }
 
-    public Object createService(Class serviceInterface, Definition definition, JavaWsdlMappingType
mapping, QName serviceQName, SOAPConstants soapVersion, List handlerInfos, DeploymentContext
context, Module module, ClassLoader classloader) throws DeploymentException {
+    public Object createService(Class serviceInterface, Definition definition, JavaWsdlMappingType
mapping, QName serviceQName, SOAPConstants soapVersion, List handlerInfos, Map portLocationMap,
DeploymentContext context, Module module, ClassLoader classloader) throws DeploymentException
{
         Map seiPortNameToFactoryMap = new HashMap();
         Map seiClassNameToFactoryMap = new HashMap();
         Object serviceInstance = createService(serviceInterface, seiPortNameToFactoryMap,
seiClassNameToFactoryMap, context, module, classloader);
         if (definition != null) {
-            buildSEIFactoryMap(serviceInterface, definition, mapping, handlerInfos, serviceQName,
soapVersion, seiPortNameToFactoryMap, seiClassNameToFactoryMap, serviceInstance, context,
module, classloader);
+            buildSEIFactoryMap(serviceInterface, definition, portLocationMap, mapping, handlerInfos,
serviceQName, soapVersion, seiPortNameToFactoryMap, seiClassNameToFactoryMap, serviceInstance,
context, module, classloader);
         }
         return serviceInstance;
     }
@@ -200,7 +200,7 @@
         }
     }
 
-    public void buildSEIFactoryMap(Class serviceInterface, Definition definition, JavaWsdlMappingType
mapping, List handlerInfos, QName serviceQName, SOAPConstants soapVersion, Map seiPortNameToFactoryMap,
Map seiClassNameToFactoryMap, Object serviceImpl, DeploymentContext context, Module module,
ClassLoader classLoader) throws DeploymentException {
+    public void buildSEIFactoryMap(Class serviceInterface, Definition definition, Map portLocationMap,
JavaWsdlMappingType mapping, List handlerInfos, QName serviceQName, SOAPConstants soapVersion,
Map seiPortNameToFactoryMap, Map seiClassNameToFactoryMap, Object serviceImpl, DeploymentContext
context, Module module, ClassLoader classLoader) throws DeploymentException {
 
         //find the service we are working with
         javax.wsdl.Service service;
@@ -215,6 +215,9 @@
         }
         if (service == null) {
             throw new DeploymentException("No service wsdl for supplied service qname " +
serviceQName);
+        }
+        if (portLocationMap != null) {
+            WSDescriptorParser.updatePortLocations(service, portLocationMap);
         }
 
         Map wsdlPortMap = service.getPorts();

Modified: geronimo/trunk/modules/axis-builder/src/java/org/apache/geronimo/axis/builder/WSDescriptorParser.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/axis-builder/src/java/org/apache/geronimo/axis/builder/WSDescriptorParser.java?view=diff&r1=155296&r2=155297
==============================================================================
--- geronimo/trunk/modules/axis-builder/src/java/org/apache/geronimo/axis/builder/WSDescriptorParser.java
(original)
+++ geronimo/trunk/modules/axis-builder/src/java/org/apache/geronimo/axis/builder/WSDescriptorParser.java
Thu Feb 24 19:42:58 2005
@@ -34,7 +34,10 @@
 import javax.wsdl.Definition;
 import javax.wsdl.Types;
 import javax.wsdl.WSDLException;
+import javax.wsdl.Service;
+import javax.wsdl.Port;
 import javax.wsdl.extensions.ExtensibilityElement;
+import javax.wsdl.extensions.soap.SOAPAddress;
 import javax.wsdl.extensions.schema.Schema;
 import javax.wsdl.factory.WSDLFactory;
 import javax.wsdl.xml.WSDLLocator;
@@ -543,6 +546,20 @@
             }
         }
         throw new DeploymentException("No element of class " + clazz.getName() + " found");
+    }
+
+    public static void updatePortLocations(Service service, Map portLocations) throws DeploymentException
{
+        for (Iterator iterator = portLocations.entrySet().iterator(); iterator.hasNext();)
{
+            Map.Entry entry = (Map.Entry) iterator.next();
+            String portName = (String) entry.getKey();
+            String location = (String) entry.getValue();
+            Port port = service.getPort(portName);
+            if (port == null) {
+                throw new DeploymentException("No port named " + portName + " found in service
" + service.getQName());
+            }
+            SOAPAddress soapAddress = (SOAPAddress) WSDescriptorParser.getExtensibilityElement(SOAPAddress.class,
port.getExtensibilityElements());
+            soapAddress.setLocationURI(location);
+        }
     }
 
     static class JarWSDLLocator implements WSDLLocator {

Modified: geronimo/trunk/modules/axis-builder/src/test/org/apache/geronimo/axis/builder/ServiceReferenceTest.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/axis-builder/src/test/org/apache/geronimo/axis/builder/ServiceReferenceTest.java?view=diff&r1=155296&r2=155297
==============================================================================
--- geronimo/trunk/modules/axis-builder/src/test/org/apache/geronimo/axis/builder/ServiceReferenceTest.java
(original)
+++ geronimo/trunk/modules/axis-builder/src/test/org/apache/geronimo/axis/builder/ServiceReferenceTest.java
Thu Feb 24 19:42:58 2005
@@ -88,6 +88,7 @@
     private final File wsdlDir = new File(basedir, "src/test-resources/interop");
     private final File wsdlFile = new File(wsdlDir, "interop.wsdl");
     private List handlerInfos = new ArrayList();
+    private Map portLocationMap = null;
 
     private Module module;
 
@@ -157,7 +158,7 @@
         JavaWsdlMappingType mapping = buildLightweightMappingType();
         QName serviceQName = new QName(NAMESPACE, "MockService");
         AxisBuilder builder = new AxisBuilder();
-        Object proxy = builder.createService(MockService.class, definition, mapping, serviceQName,
SOAPConstants.SOAP11_CONSTANTS, handlerInfos, context, module, isolatedCl);
+        Object proxy = builder.createService(MockService.class, definition, mapping, serviceQName,
SOAPConstants.SOAP11_CONSTANTS, handlerInfos, portLocationMap, context, module, isolatedCl);
         assertNotNull(proxy);
         assertTrue(proxy instanceof MockService);
         MockPort mockPort = ((MockService) proxy).getMockPort();
@@ -174,7 +175,7 @@
         JavaWsdlMappingType mapping = mappingDocument.getJavaWsdlMapping();
         QName serviceQName = new QName("http://www.Monson-Haefel.com/jwsbook/BookQuote",
"BookQuoteService");
         AxisBuilder builder = new AxisBuilder();
-        Object proxy = builder.createService(BookQuoteService.class, definition, mapping,
serviceQName, SOAPConstants.SOAP11_CONSTANTS, handlerInfos, context, module, isolatedCl);
+        Object proxy = builder.createService(BookQuoteService.class, definition, mapping,
serviceQName, SOAPConstants.SOAP11_CONSTANTS, handlerInfos, portLocationMap, context, module,
isolatedCl);
         assertNotNull(proxy);
         assertTrue(proxy instanceof BookQuoteService);
         BookQuote bookQuote = ((BookQuoteService) proxy).getBookQuotePort();
@@ -191,7 +192,7 @@
         JavaWsdlMappingType mapping = mappingDocument.getJavaWsdlMapping();
         QName serviceQName = new QName("http://tempuri.org/4s4c/1/3/wsdl/def/interopLab",
"interopLab");
         AxisBuilder builder = new AxisBuilder();
-        Object proxy = builder.createService(InteropLab.class, definition, mapping, serviceQName,
SOAPConstants.SOAP11_CONSTANTS, handlerInfos, context, module, isolatedCl);
+        Object proxy = builder.createService(InteropLab.class, definition, mapping, serviceQName,
SOAPConstants.SOAP11_CONSTANTS, handlerInfos, portLocationMap, context, module, isolatedCl);
         assertNotNull(proxy);
         assertTrue(proxy instanceof InteropLab);
         InteropTestPortType interopTestPort = ((InteropLab) proxy).getinteropTestPort();
@@ -221,7 +222,7 @@
         AxisBuilder builder = new AxisBuilder();
         Map portComponentRefMap = null;
         List handlers = null;
-        DeserializingReference reference = (DeserializingReference) builder.createService(InteropLab.class,
wsdlURI, jaxrpcmappingURI, serviceQName, portComponentRefMap, handlers, context, module, cl);
+        DeserializingReference reference = (DeserializingReference) builder.createService(InteropLab.class,
wsdlURI, jaxrpcmappingURI, serviceQName, portComponentRefMap, handlers, portLocationMap, context,
module, cl);
         ClassLoader contextCl = context.getClassLoader(null);
         reference.setClassLoader(contextCl);
         Object proxy = reference.getContent();

Modified: geronimo/trunk/modules/axis/src/test/org/apache/geronimo/axis/testUtils/TestingUtils.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/axis/src/test/org/apache/geronimo/axis/testUtils/TestingUtils.java?view=diff&r1=155296&r2=155297
==============================================================================
--- geronimo/trunk/modules/axis/src/test/org/apache/geronimo/axis/testUtils/TestingUtils.java
(original)
+++ geronimo/trunk/modules/axis/src/test/org/apache/geronimo/axis/testUtils/TestingUtils.java
Thu Feb 24 19:42:58 2005
@@ -93,7 +93,7 @@
     private static ServiceReferenceBuilder serviceReferenceBuilder = new ServiceReferenceBuilder()
{
 
         //it could return a Service or a Reference, we don't care
-        public Object createService(Class serviceInterface, URI wsdlURI, URI jaxrpcMappingURI,
QName serviceQName, Map portComponentRefMap, List handlerInfos, DeploymentContext deploymentContext,
Module module, ClassLoader classLoader) throws DeploymentException {
+        public Object createService(Class serviceInterface, URI wsdlURI, URI jaxrpcMappingURI,
QName serviceQName, Map portComponentRefMap, List handlerInfos, Map portLocationMap, DeploymentContext
deploymentContext, Module module, ClassLoader classLoader) throws DeploymentException {
             return null;
         }
     };

Modified: geronimo/trunk/modules/client-builder/src/java/org/apache/geronimo/client/builder/AppClientModuleBuilder.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/client-builder/src/java/org/apache/geronimo/client/builder/AppClientModuleBuilder.java?view=diff&r1=155296&r2=155297
==============================================================================
--- geronimo/trunk/modules/client-builder/src/java/org/apache/geronimo/client/builder/AppClientModuleBuilder.java
(original)
+++ geronimo/trunk/modules/client-builder/src/java/org/apache/geronimo/client/builder/AppClientModuleBuilder.java
Thu Feb 24 19:42:58 2005
@@ -569,7 +569,7 @@
                 appClient.getResourceRefArray(), geronimoAppClient.getResourceRefArray(),
                 appClient.getResourceEnvRefArray(), geronimoAppClient.getResourceEnvRefArray(),
                 appClient.getMessageDestinationRefArray(),
-                appClient.getServiceRefArray(),
+                appClient.getServiceRefArray(), geronimoAppClient.getServiceRefArray(),
                 cl);
 
     }

Modified: geronimo/trunk/modules/client-builder/src/schema/geronimo-application-client.xsd
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/client-builder/src/schema/geronimo-application-client.xsd?view=diff&r1=155296&r2=155297
==============================================================================
--- geronimo/trunk/modules/client-builder/src/schema/geronimo-application-client.xsd (original)
+++ geronimo/trunk/modules/client-builder/src/schema/geronimo-application-client.xsd Thu Feb
24 19:42:58 2005
@@ -47,8 +47,7 @@
 
             <xs:element ref="naming:ejb-ref" minOccurs="0" maxOccurs="unbounded"/>
             <!--<xs:element ref="naming:ejb-local-ref" minOccurs="0" maxOccurs="unbounded"/>-->
-            <!-- leave web services out until I know what they do -->
-            <!--xs:group ref="service-refGroup"/-->
+            <xs:element ref="naming:service-ref" minOccurs="0" maxOccurs="unbounded"/>
             <xs:element ref="naming:resource-ref" minOccurs="0" maxOccurs="unbounded"/>
             <xs:element ref="naming:resource-env-ref" minOccurs="0" maxOccurs="unbounded"/>
 

Modified: geronimo/trunk/modules/connector-builder/src/test/org/apache/geronimo/connector/deployment/ConnectorModuleBuilderTest.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/connector-builder/src/test/org/apache/geronimo/connector/deployment/ConnectorModuleBuilderTest.java?view=diff&r1=155296&r2=155297
==============================================================================
--- geronimo/trunk/modules/connector-builder/src/test/org/apache/geronimo/connector/deployment/ConnectorModuleBuilderTest.java
(original)
+++ geronimo/trunk/modules/connector-builder/src/test/org/apache/geronimo/connector/deployment/ConnectorModuleBuilderTest.java
Thu Feb 24 19:42:58 2005
@@ -142,7 +142,7 @@
     };
     private ServiceReferenceBuilder serviceReferenceBuilder = new ServiceReferenceBuilder()
{
                                         //it could return a Service or a Reference, we don't
care
-                                        public Object createService(Class serviceInterface,
URI wsdlURI, URI jaxrpcMappingURI, QName serviceQName, Map portComponentRefMap, List handlerInfos,
DeploymentContext deploymentContext, Module module, ClassLoader classLoader) {
+                                        public Object createService(Class serviceInterface,
URI wsdlURI, URI jaxrpcMappingURI, QName serviceQName, Map portComponentRefMap, List handlerInfos,
Map portLocationMap, DeploymentContext deploymentContext, Module module, ClassLoader classLoader)
{
                                             return null;
                                         }
                                     };

Modified: geronimo/trunk/modules/j2ee-builder/src/java/org/apache/geronimo/j2ee/deployment/RefContext.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/j2ee-builder/src/java/org/apache/geronimo/j2ee/deployment/RefContext.java?view=diff&r1=155296&r2=155297
==============================================================================
--- geronimo/trunk/modules/j2ee-builder/src/java/org/apache/geronimo/j2ee/deployment/RefContext.java
(original)
+++ geronimo/trunk/modules/j2ee-builder/src/java/org/apache/geronimo/j2ee/deployment/RefContext.java
Thu Feb 24 19:42:58 2005
@@ -302,8 +302,8 @@
         }
     }
 
-    public Object getServiceReference(Class serviceInterface, URI wsdlURI, URI jaxrpcMappingURI,
QName serviceQName, Map portComponentRefMap, List handlerInfos, DeploymentContext deploymentContext,
Module module, ClassLoader classLoader) throws DeploymentException {
-        return serviceReferenceBuilder.createService(serviceInterface, wsdlURI, jaxrpcMappingURI,
serviceQName, portComponentRefMap, handlerInfos, deploymentContext, module, classLoader);
+    public Object getServiceReference(Class serviceInterface, URI wsdlURI, URI jaxrpcMappingURI,
QName serviceQName, Map portComponentRefMap, List handlerInfos, Map portLocationMap, DeploymentContext
deploymentContext, Module module, ClassLoader classLoader) throws DeploymentException {
+        return serviceReferenceBuilder.createService(serviceInterface, wsdlURI, jaxrpcMappingURI,
serviceQName, portComponentRefMap, handlerInfos, portLocationMap, deploymentContext, module,
classLoader);
     }
 
     private String getContainerId(URI module, String ejbLink, Map references) throws AmbiguousEJBRefException,
UnknownEJBRefException {

Modified: geronimo/trunk/modules/j2ee-builder/src/java/org/apache/geronimo/j2ee/deployment/ServiceReferenceBuilder.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/j2ee-builder/src/java/org/apache/geronimo/j2ee/deployment/ServiceReferenceBuilder.java?view=diff&r1=155296&r2=155297
==============================================================================
--- geronimo/trunk/modules/j2ee-builder/src/java/org/apache/geronimo/j2ee/deployment/ServiceReferenceBuilder.java
(original)
+++ geronimo/trunk/modules/j2ee-builder/src/java/org/apache/geronimo/j2ee/deployment/ServiceReferenceBuilder.java
Thu Feb 24 19:42:58 2005
@@ -33,7 +33,7 @@
 public interface ServiceReferenceBuilder {
 
     //it could return a Service or a Reference, we don't care
-    Object createService(Class serviceInterface, URI wsdlURI, URI jaxrpcMappingURI, QName
serviceQName, Map portComponentRefMap, List handlerInfos, DeploymentContext deploymentContext,
Module module, ClassLoader classLoader) throws DeploymentException;
+    Object createService(Class serviceInterface, URI wsdlURI, URI jaxrpcMappingURI, QName
serviceQName, Map portComponentRefMap, List handlerInfos, Map portLocationMap, DeploymentContext
deploymentContext, Module module, ClassLoader classLoader) throws DeploymentException;
 
     //TODO a locate port method for links.
 

Modified: geronimo/trunk/modules/j2ee-builder/src/test/org/apache/geronimo/j2ee/deployment/EARConfigBuilderTest.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/j2ee-builder/src/test/org/apache/geronimo/j2ee/deployment/EARConfigBuilderTest.java?view=diff&r1=155296&r2=155297
==============================================================================
--- geronimo/trunk/modules/j2ee-builder/src/test/org/apache/geronimo/j2ee/deployment/EARConfigBuilderTest.java
(original)
+++ geronimo/trunk/modules/j2ee-builder/src/test/org/apache/geronimo/j2ee/deployment/EARConfigBuilderTest.java
Thu Feb 24 19:42:58 2005
@@ -64,7 +64,7 @@
     private static ServiceReferenceBuilder serviceReferenceBuilder = new ServiceReferenceBuilder()
{
 
         //it could return a Service or a Reference, we don't care
-        public Object createService(Class serviceInterface, URI wsdlURI, URI jaxrpcMappingURI,
QName serviceQName, Map portComponentRefMap, List handlerInfos, DeploymentContext deploymentContext,
Module module, ClassLoader classLoader) throws DeploymentException {
+        public Object createService(Class serviceInterface, URI wsdlURI, URI jaxrpcMappingURI,
QName serviceQName, Map portComponentRefMap, List handlerInfos, Map portLocationMap, DeploymentContext
deploymentContext, Module module, ClassLoader classLoader) throws DeploymentException {
             return null;
         }
     };

Modified: geronimo/trunk/modules/j2ee-builder/src/test/org/apache/geronimo/j2ee/deployment/EJBRefContextTest.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/j2ee-builder/src/test/org/apache/geronimo/j2ee/deployment/EJBRefContextTest.java?view=diff&r1=155296&r2=155297
==============================================================================
--- geronimo/trunk/modules/j2ee-builder/src/test/org/apache/geronimo/j2ee/deployment/EJBRefContextTest.java
(original)
+++ geronimo/trunk/modules/j2ee-builder/src/test/org/apache/geronimo/j2ee/deployment/EJBRefContextTest.java
Thu Feb 24 19:42:58 2005
@@ -203,7 +203,7 @@
             }
         }, new ServiceReferenceBuilder() {
             //it could return a Service or a Reference, we don't care
-            public Object createService(Class serviceInterface, URI wsdlURI, URI jaxrpcMappingURI,
QName serviceQName, Map portComponentRefMap, List handlerInfos, DeploymentContext deploymentContext,
Module module, ClassLoader classLoader) throws DeploymentException {
+            public Object createService(Class serviceInterface, URI wsdlURI, URI jaxrpcMappingURI,
QName serviceQName, Map portComponentRefMap, List handlerInfos, Map portLocationMap, DeploymentContext
deploymentContext, Module module, ClassLoader classLoader) throws DeploymentException {
                 return null;
             }
         }, kernel);

Modified: geronimo/trunk/modules/j2ee-schema/src/java/org/apache/geronimo/schema/SchemaConversionUtils.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/j2ee-schema/src/java/org/apache/geronimo/schema/SchemaConversionUtils.java?view=diff&r1=155296&r2=155297
==============================================================================
--- geronimo/trunk/modules/j2ee-schema/src/java/org/apache/geronimo/schema/SchemaConversionUtils.java
(original)
+++ geronimo/trunk/modules/j2ee-schema/src/java/org/apache/geronimo/schema/SchemaConversionUtils.java
Thu Feb 24 19:42:58 2005
@@ -348,6 +348,7 @@
                     String localName = cursor.getName().getLocalPart();
                     if (localName.equals("ejb-ref")
                             || localName.equals("ejb-local-ref")
+                            || localName.equals("service-ref")
                             || localName.equals("resource-ref")
                             || localName.equals("resource-env-ref")
                             || localName.equals("cmp-connection-factory")

Modified: geronimo/trunk/modules/jetty-builder/src/java/org/apache/geronimo/jetty/deployment/JettyModuleBuilder.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/jetty-builder/src/java/org/apache/geronimo/jetty/deployment/JettyModuleBuilder.java?view=diff&r1=155296&r2=155297
==============================================================================
--- geronimo/trunk/modules/jetty-builder/src/java/org/apache/geronimo/jetty/deployment/JettyModuleBuilder.java
(original)
+++ geronimo/trunk/modules/jetty-builder/src/java/org/apache/geronimo/jetty/deployment/JettyModuleBuilder.java
Thu Feb 24 19:42:58 2005
@@ -1048,7 +1048,7 @@
                 webApp.getResourceRefArray(), jettyWebApp.getResourceRefArray(),
                 webApp.getResourceEnvRefArray(), jettyWebApp.getResourceEnvRefArray(),
                 webApp.getMessageDestinationRefArray(),
-                webApp.getServiceRefArray(),
+                webApp.getServiceRefArray(), jettyWebApp.getServiceRefArray(),
                 cl);
     }
 

Modified: geronimo/trunk/modules/jetty-builder/src/schema/geronimo-jetty.xsd
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/jetty-builder/src/schema/geronimo-jetty.xsd?view=diff&r1=155296&r2=155297
==============================================================================
--- geronimo/trunk/modules/jetty-builder/src/schema/geronimo-jetty.xsd (original)
+++ geronimo/trunk/modules/jetty-builder/src/schema/geronimo-jetty.xsd Thu Feb 24 19:42:58
2005
@@ -50,8 +50,7 @@
 
             <xs:element ref="naming:ejb-ref" minOccurs="0" maxOccurs="unbounded"/>
             <xs:element ref="naming:ejb-local-ref" minOccurs="0" maxOccurs="unbounded"/>
-            <!-- leave web services out until I know what they do -->
-            <!--xs:group ref="service-refGroup"/-->
+            <xs:element ref="naming:service-ref" minOccurs="0" maxOccurs="unbounded"/>
             <xs:element ref="naming:resource-ref" minOccurs="0" maxOccurs="unbounded"/>
             <xs:element ref="naming:resource-env-ref" minOccurs="0" maxOccurs="unbounded"/>
 

Modified: geronimo/trunk/modules/jetty-builder/src/test/org/apache/geronimo/jetty/deployment/JettyModuleBuilderTest.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/jetty-builder/src/test/org/apache/geronimo/jetty/deployment/JettyModuleBuilderTest.java?view=diff&r1=155296&r2=155297
==============================================================================
--- geronimo/trunk/modules/jetty-builder/src/test/org/apache/geronimo/jetty/deployment/JettyModuleBuilderTest.java
(original)
+++ geronimo/trunk/modules/jetty-builder/src/test/org/apache/geronimo/jetty/deployment/JettyModuleBuilderTest.java
Thu Feb 24 19:42:58 2005
@@ -186,7 +186,7 @@
                         },
                         new ServiceReferenceBuilder() {
                             //it could return a Service or a Reference, we don't care
-                            public Object createService(Class serviceInterface, URI wsdlURI,
URI jaxrpcMappingURI, QName serviceQName, Map portComponentRefMap, List handlerInfos, DeploymentContext
deploymentContext, Module module, ClassLoader classLoader) throws DeploymentException {
+                            public Object createService(Class serviceInterface, URI wsdlURI,
URI jaxrpcMappingURI, QName serviceQName, Map portComponentRefMap, List handlerInfos, Map
portLocationMap, DeploymentContext deploymentContext, Module module, ClassLoader classLoader)
throws DeploymentException {
                                 return null;
                             }
                         }, kernel));

Modified: geronimo/trunk/modules/naming-builder/src/java/org/apache/geronimo/naming/deployment/ENCConfigBuilder.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/naming-builder/src/java/org/apache/geronimo/naming/deployment/ENCConfigBuilder.java?view=diff&r1=155296&r2=155297
==============================================================================
--- geronimo/trunk/modules/naming-builder/src/java/org/apache/geronimo/naming/deployment/ENCConfigBuilder.java
(original)
+++ geronimo/trunk/modules/naming-builder/src/java/org/apache/geronimo/naming/deployment/ENCConfigBuilder.java
Thu Feb 24 19:42:58 2005
@@ -52,6 +52,8 @@
 import org.apache.geronimo.xbeans.geronimo.naming.GerGbeanLocatorType;
 import org.apache.geronimo.xbeans.geronimo.naming.GerResourceEnvRefType;
 import org.apache.geronimo.xbeans.geronimo.naming.GerResourceRefType;
+import org.apache.geronimo.xbeans.geronimo.naming.GerServiceRefType;
+import org.apache.geronimo.xbeans.geronimo.naming.GerPortType;
 import org.apache.geronimo.xbeans.j2ee.EjbLocalRefType;
 import org.apache.geronimo.xbeans.j2ee.EjbRefType;
 import org.apache.geronimo.xbeans.j2ee.EnvEntryType;
@@ -443,12 +445,14 @@
     }
 
     //TODO current implementation does not deal with portComponentRefs.
-    public static void addServiceRefs(EARContext earContext, Module module, ServiceRefType[]
serviceRefs, ClassLoader cl, ComponentContextBuilder builder) throws DeploymentException {
+    public static void addServiceRefs(EARContext earContext, Module module, ServiceRefType[]
serviceRefs, Map serviceRefMap, ClassLoader cl, ComponentContextBuilder builder) throws DeploymentException
{
+
         RefContext refContext = earContext.getRefContext();
 
         for (int i = 0; i < serviceRefs.length; i++) {
             ServiceRefType serviceRef = serviceRefs[i];
             String name = getStringValue(serviceRef.getServiceRefName());
+            Map portLocationMap = (Map) serviceRefMap.get(name);
             String serviceInterfaceName = getStringValue(serviceRef.getServiceInterface());
             assureInterface(serviceInterfaceName, "javax.xml.rpc.Service", "[Web]Service",
cl);
             Class serviceInterface = null;
@@ -498,7 +502,7 @@
             List handlerInfos = buildHandlerInfoList(handlers, cl);
 
             //we could get a Reference or the actual serializable Service back.
-            Object ref = refContext.getServiceReference(serviceInterface, wsdlURI, jaxrpcMappingURI,
serviceQName, portComponentRefMap, handlerInfos, earContext, module, cl);
+            Object ref = refContext.getServiceReference(serviceInterface, wsdlURI, jaxrpcMappingURI,
serviceQName, portComponentRefMap, handlerInfos, portLocationMap, earContext, module, cl);
             try {
                 builder.bind(name, ref);
             } catch (NamingException e) {
@@ -633,7 +637,22 @@
         builder.setApplicationManagedSecurityResources(applicationManagedSecurityResources);
     }
 
-    public static Map buildComponentContext(EARContext earContext, Module module, UserTransaction
userTransaction, EnvEntryType[] envEntries, EjbRefType[] ejbRefs, GerEjbRefType[] gerEjbRefs,
EjbLocalRefType[] ejbLocalRefs, GerEjbLocalRefType[] gerEjbLocalRef, ResourceRefType[] resourceRefs,
GerResourceRefType[] gerResourceRef, ResourceEnvRefType[] resourceEnvRefs, GerResourceEnvRefType[]
gerResourceEnvRef, MessageDestinationRefType[] messageDestinationRefs, ServiceRefType[] serviceRefs,
ClassLoader cl) throws DeploymentException {
+    public static Map buildComponentContext(EARContext earContext,
+                                            Module module,
+                                            UserTransaction userTransaction,
+                                            EnvEntryType[] envEntries,
+                                            EjbRefType[] ejbRefs,
+                                            GerEjbRefType[] gerEjbRefs,
+                                            EjbLocalRefType[] ejbLocalRefs,
+                                            GerEjbLocalRefType[] gerEjbLocalRef,
+                                            ResourceRefType[] resourceRefs,
+                                            GerResourceRefType[] gerResourceRef,
+                                            ResourceEnvRefType[] resourceEnvRefs,
+                                            GerResourceEnvRefType[] gerResourceEnvRef,
+                                            MessageDestinationRefType[] messageDestinationRefs,
+                                            ServiceRefType[] serviceRefs,
+                                            GerServiceRefType[] gerServiceRefs,
+                                            ClassLoader cl) throws DeploymentException {
         ComponentContextBuilder builder = new ComponentContextBuilder();
 
         if (userTransaction != null) {
@@ -662,7 +681,7 @@
 
         addMessageDestinationRefs(earContext, uri, messageDestinationRefs, cl, builder);
 
-        addServiceRefs(earContext, module, serviceRefs, cl, builder);
+        addServiceRefs(earContext, module, serviceRefs, mapServiceRefs(gerServiceRefs), cl,
builder);
 
         return builder.getContext();
     }
@@ -672,7 +691,7 @@
         if (refs != null) {
             for (int i = 0; i < refs.length; i++) {
                 GerEjbRefType ref = refs[i];
-                refMap.put(ref.getRefName(), ref);
+                refMap.put(ref.getRefName().trim(), ref);
             }
         }
         return refMap;
@@ -683,7 +702,7 @@
         if (refs != null) {
             for (int i = 0; i < refs.length; i++) {
                 GerEjbLocalRefType ref = refs[i];
-                refMap.put(ref.getRefName(), ref);
+                refMap.put(ref.getRefName().trim(), ref);
             }
         }
         return refMap;
@@ -694,7 +713,7 @@
         if (refs != null) {
             for (int i = 0; i < refs.length; i++) {
                 GerResourceRefType ref = refs[i];
-                refMap.put(ref.getRefName(), ref);
+                refMap.put(ref.getRefName().trim(), ref);
             }
         }
         return refMap;
@@ -705,7 +724,31 @@
         if (refs != null) {
             for (int i = 0; i < refs.length; i++) {
                 GerResourceEnvRefType ref = refs[i];
-                refMap.put(ref.getRefName(), ref);
+                refMap.put(ref.getRefName().trim(), ref);
+            }
+        }
+        return refMap;
+    }
+
+    private static Map mapServiceRefs(GerServiceRefType[] refs) {
+        Map refMap = new HashMap();
+        if (refs != null) {
+            for (int i = 0; i < refs.length; i++) {
+                GerServiceRefType ref = refs[i];
+                String serviceRefName = ref.getServiceRefName().trim();
+                Map portMap = new HashMap();
+                GerPortType[] ports = ref.getPortArray();
+                for (int j = 0; j < ports.length; j++) {
+                    GerPortType port = ports[j];
+                    String portName = port.getPortName().trim();
+                    String protocol = port.getProtocol().trim();
+                    String host = port.getHost().trim();
+                    int portNum = port.getPort();
+                    String uri = port.getUri().trim();
+                    String location = protocol + "://" + host + ":" + portNum + uri;
+                    portMap.put(portName, location);
+                }
+                refMap.put(serviceRefName, portMap);
             }
         }
         return refMap;

Modified: geronimo/trunk/modules/naming-builder/src/schema/geronimo-naming.xsd
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/naming-builder/src/schema/geronimo-naming.xsd?view=diff&r1=155296&r2=155297
==============================================================================
--- geronimo/trunk/modules/naming-builder/src/schema/geronimo-naming.xsd (original)
+++ geronimo/trunk/modules/naming-builder/src/schema/geronimo-naming.xsd Thu Feb 24 19:42:58
2005
@@ -15,7 +15,7 @@
     See the License for the specific language governing permissions and
     limitations under the License.
 -->
-  
+
 <xsd:schema
     targetNamespace="http://geronimo.apache.org/xml/ns/naming"
     xmlns:gernaming="http://geronimo.apache.org/xml/ns/naming"
@@ -38,11 +38,10 @@
 
     <xsd:element name="ejb-ref" type="gernaming:ejb-refType"/>
     <xsd:element name="ejb-local-ref" type="gernaming:ejb-local-refType"/>
-    <!-- leave web services out until I know what they do -->
-    <!--xsd:group ref="service-refGroup"/-->
+    <xsd:element name="service-ref" type="gernaming:service-refType"/>
     <xsd:element name="resource-ref" type="gernaming:resource-refType"/>
     <xsd:element name="resource-env-ref" type="gernaming:resource-env-refType"/>
-    
+
     <xsd:group name="jndiEnvironmentRefsGroup">
         <xsd:annotation>
             <xsd:documentation>
@@ -56,8 +55,7 @@
             <xsd:element name="gbean-ref" type="gernaming:gbean-refType" minOccurs="0"
maxOccurs="unbounded"/>
             <xsd:element name="ejb-ref" type="gernaming:ejb-refType" minOccurs="0" maxOccurs="unbounded"/>
             <xsd:element name="ejb-local-ref" type="gernaming:ejb-local-refType" minOccurs="0"
maxOccurs="unbounded"/>
-            <!-- leave web services out until I know what they do -->
-            <!--xsd:group ref="service-refGroup"/-->
+            <xsd:element name="service-ref" type="gernaming:service-refType" minOccurs="0"
maxOccurs="unbounded"/>
             <xsd:element name="resource-ref" type="gernaming:resource-refType" minOccurs="0"
maxOccurs="unbounded"/>
             <xsd:element name="resource-env-ref" type="gernaming:resource-env-refType"
minOccurs="0" maxOccurs="unbounded"/>
         </xsd:sequence>
@@ -161,17 +159,43 @@
     </xsd:complexType>
 
     <xsd:group name="objectNameGroup">
-         <xsd:annotation>
-             <xsd:documentation>This group contains the components of a jsr-77 object
name</xsd:documentation>
-         </xsd:annotation>
-         <xsd:sequence>
-             <xsd:element name="domain" type="xsd:string" minOccurs="0"/>
-             <xsd:element name="server" type="xsd:string" minOccurs="0"/>
-             <xsd:element name="application" type="xsd:string" minOccurs="0"/>
-             <xsd:element name="module" type="xsd:string" minOccurs="0"/>
-             <xsd:element name="type" type="xsd:string" minOccurs="0"/>
-             <xsd:element name="name" type="xsd:string"/>
-         </xsd:sequence>
-     </xsd:group>
+        <xsd:annotation>
+            <xsd:documentation>This group contains the components of a jsr-77 object
name</xsd:documentation>
+        </xsd:annotation>
+        <xsd:sequence>
+            <xsd:element name="domain" type="xsd:string" minOccurs="0"/>
+            <xsd:element name="server" type="xsd:string" minOccurs="0"/>
+            <xsd:element name="application" type="xsd:string" minOccurs="0"/>
+            <xsd:element name="module" type="xsd:string" minOccurs="0"/>
+            <xsd:element name="type" type="xsd:string" minOccurs="0"/>
+            <xsd:element name="name" type="xsd:string"/>
+        </xsd:sequence>
+    </xsd:group>
+
+    <xsd:group name="serverGroup">
+        <xsd:annotation>
+            <xsd:documentation>This group contains the protocol, address, and port
for a server</xsd:documentation>
+        </xsd:annotation>
+        <xsd:sequence>
+            <xsd:element name="protocol" type="xsd:string"/>
+            <xsd:element name="host" type="xsd:string"/>
+            <xsd:element name="port" type="xsd:int"/>
+        </xsd:sequence>
+    </xsd:group>
+
+    <xsd:complexType name="portType">
+        <xsd:sequence>
+            <xsd:element name="port-name" type="xsd:string"/>
+            <xsd:group ref="gernaming:serverGroup" minOccurs="0"/>
+            <xsd:element name="uri" type="xsd:string"/>
+        </xsd:sequence>
+    </xsd:complexType>
+
+    <xsd:complexType name="service-refType">
+        <xsd:sequence>
+            <xsd:element name="service-ref-name" type="xsd:string"/>
+            <xsd:element name="port" type="gernaming:portType" maxOccurs="unbounded"/>
+        </xsd:sequence>
+    </xsd:complexType>
 
 </xsd:schema>

Modified: geronimo/trunk/modules/tomcat/src/java/org/apache/geronimo/tomcat/deployment/TomcatModuleBuilder.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/tomcat/src/java/org/apache/geronimo/tomcat/deployment/TomcatModuleBuilder.java?view=diff&r1=155296&r2=155297
==============================================================================
--- geronimo/trunk/modules/tomcat/src/java/org/apache/geronimo/tomcat/deployment/TomcatModuleBuilder.java
(original)
+++ geronimo/trunk/modules/tomcat/src/java/org/apache/geronimo/tomcat/deployment/TomcatModuleBuilder.java
Thu Feb 24 19:42:58 2005
@@ -199,7 +199,7 @@
                 webApp.getResourceRefArray(), jettyWebApp.getResourceRefArray(),
                 webApp.getResourceEnvRefArray(), jettyWebApp.getResourceEnvRefArray(),
                 webApp.getMessageDestinationRefArray(),
-                webApp.getServiceRefArray(),
+                webApp.getServiceRefArray(), jettyWebApp.getServiceRefArray(), 
                 cl);
     }
 



Mime
View raw message