geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From djen...@apache.org
Subject svn commit: r171145 - in /geronimo/trunk/modules: axis-builder/src/java/org/apache/geronimo/axis/builder/ axis-builder/src/test/org/apache/geronimo/axis/builder/ 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/ jetty-builder/src/test/org/apache/geronimo/jetty/deployment/ naming-builder/src/java/org/apache/geronimo/naming/deployment/ naming-builder/src/schema/
Date Fri, 20 May 2005 19:53:18 GMT
Author: djencks
Date: Fri May 20 12:53:16 2005
New Revision: 171145

URL: http://svn.apache.org/viewcvs?rev=171145&view=rev
Log:
GERONIMO-649 deploy partial wsdl webservices

Modified:
    geronimo/trunk/modules/axis-builder/src/java/org/apache/geronimo/axis/builder/AxisBuilder.java
    geronimo/trunk/modules/axis-builder/src/test/org/apache/geronimo/axis/builder/ServiceReferenceTest.java
    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/java/org/apache/geronimo/j2ee/deployment/UnavailableServiceReferenceBuilder.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/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

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?rev=171145&r1=171144&r2=171145&view=diff
==============================================================================
--- 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
Fri May 20 12:53:16 2005
@@ -89,6 +89,10 @@
 import org.apache.geronimo.xbeans.j2ee.JavaXmlTypeMappingType;
 import org.apache.geronimo.xbeans.j2ee.ServiceEndpointInterfaceMappingType;
 import org.apache.geronimo.xbeans.j2ee.ServiceEndpointMethodMappingType;
+import org.apache.geronimo.xbeans.geronimo.naming.GerServiceRefType;
+import org.apache.geronimo.xbeans.geronimo.naming.GerServiceCompletionType;
+import org.apache.geronimo.xbeans.geronimo.naming.GerPortCompletionType;
+import org.apache.geronimo.xbeans.geronimo.naming.GerPortType;
 
 /**
  * @version $Rev:  $ $Date:  $
@@ -160,7 +164,8 @@
 
 
     //ServicereferenceBuilder
-    public Object createService(Class serviceInterface, URI wsdlURI, URI jaxrpcMappingURI,
QName serviceQName, Map portComponentRefMap, List handlerInfos, Map portLocationMap, Map credentialsNameMap,
DeploymentContext deploymentContext, Module module, ClassLoader classLoader) throws DeploymentException
{
+    public Object createService(Class serviceInterface, URI wsdlURI, URI jaxrpcMappingURI,
QName serviceQName, Map portComponentRefMap, List handlerInfos, Object serviceRefType, DeploymentContext
deploymentContext, Module module, ClassLoader classLoader) throws DeploymentException {
+        GerServiceRefType gerServiceRefType = (GerServiceRefType) serviceRefType;
         JarFile moduleFile = module.getModuleFile();
         SchemaInfoBuilder schemaInfoBuilder = null;
         JavaWsdlMappingType mapping = null;
@@ -170,7 +175,7 @@
             mapping = WSDescriptorParser.readJaxrpcMapping(moduleFile, jaxrpcMappingURI);
         }
 
-        Object service = createService(serviceInterface, schemaInfoBuilder, mapping, serviceQName,
SOAP_VERSION, handlerInfos, portLocationMap, credentialsNameMap, deploymentContext, module,
classLoader);
+        Object service = createService(serviceInterface, schemaInfoBuilder, mapping, serviceQName,
SOAP_VERSION, handlerInfos, gerServiceRefType, deploymentContext, module, classLoader);
         ByteArrayOutputStream baos = new ByteArrayOutputStream();
         ObjectOutputStream oos = null;
         try {
@@ -185,12 +190,12 @@
         return reference;
     }
 
-    public Object createService(Class serviceInterface, SchemaInfoBuilder schemaInfoBuilder,
JavaWsdlMappingType mapping, QName serviceQName, SOAPConstants soapVersion, List handlerInfos,
Map portLocationMap, Map credentialsNameMap, DeploymentContext context, Module module, ClassLoader
classloader) throws DeploymentException {
+    public Object createService(Class serviceInterface, SchemaInfoBuilder schemaInfoBuilder,
JavaWsdlMappingType mapping, QName serviceQName, SOAPConstants soapVersion, List handlerInfos,
GerServiceRefType serviceRefType, DeploymentContext context, Module module, ClassLoader classloader)
throws DeploymentException {
         Map seiPortNameToFactoryMap = new HashMap();
         Map seiClassNameToFactoryMap = new HashMap();
         Object serviceInstance = createServiceInterfaceProxy(serviceInterface, seiPortNameToFactoryMap,
seiClassNameToFactoryMap, context, module, classloader);
         if (schemaInfoBuilder != null) {
-            buildSEIFactoryMap(serviceInterface, schemaInfoBuilder, portLocationMap, credentialsNameMap,
mapping, handlerInfos, serviceQName, soapVersion, seiPortNameToFactoryMap, seiClassNameToFactoryMap,
serviceInstance, context, module, classloader);
+            buildSEIFactoryMap(serviceInterface, schemaInfoBuilder, serviceRefType, mapping,
handlerInfos, serviceQName, soapVersion, seiPortNameToFactoryMap, seiClassNameToFactoryMap,
serviceInstance, context, module, classloader);
         }
         return serviceInstance;
     }
@@ -227,44 +232,105 @@
         }
     }
 
-    public void buildSEIFactoryMap(Class serviceInterface, SchemaInfoBuilder schemaInfoBuilder,
Map portLocationMap, Map credentialsNameMap, 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, SchemaInfoBuilder schemaInfoBuilder,
GerServiceRefType serviceRefType, JavaWsdlMappingType mapping, List handlerInfos, QName serviceQName,
SOAPConstants soapVersion, Map seiPortNameToFactoryMap, Map seiClassNameToFactoryMap, Object
serviceImpl, DeploymentContext context, Module module, ClassLoader classLoader) throws DeploymentException
{
+        Map exceptionMap = WSDescriptorParser.getExceptionMap(mapping);
 
-        //find the service we are working with
-        javax.wsdl.Service service = getService(serviceQName, schemaInfoBuilder.getDefinition());
+        Definition definition = schemaInfoBuilder.getDefinition();
+        //check for consistency
+        if (definition.getServices().size() == 0) {
+            //partial wsdl
+            if (serviceRefType == null || !serviceRefType.isSetServiceCompletion()) {
+                throw new DeploymentException("Partial wsdl, but no service completion supplied");
+            }
+            GerServiceCompletionType serviceCompletion = serviceRefType.getServiceCompletion();
+            String serviceLocalName = serviceCompletion.getServiceName().trim();
+            String namespace = definition.getTargetNamespace();
+            serviceQName = new QName(namespace, serviceLocalName);
+            javax.wsdl.Service service = definition.createService();
+            service.setQName(serviceQName);
+            GerPortCompletionType[] ports = serviceCompletion.getPortArray();
+            for (int i = 0; i < ports.length; i++) {
+                GerPortCompletionType port = ports[i];
+                URL location = getLocation(port);
+                String portName = port.getPortName().trim();
+                String bindingName = port.getBindingName().trim();
+                QName bindingQName = new QName(namespace, bindingName);
+                Binding binding = definition.getBinding(bindingQName);
+                if (binding == null) {
+                    throw new DeploymentException("No binding found with qname: " + bindingQName);
+                }
+                String credentialsName = port.isSetCredentialsName() ? port.getCredentialsName().trim()
: null;
+                mapBinding(binding, mapping, serviceQName, classLoader, context, module,
soapVersion, schemaInfoBuilder, portName, serviceImpl, location, handlerInfos, seiPortNameToFactoryMap,
seiClassNameToFactoryMap, credentialsName, exceptionMap);
 
-        if (portLocationMap != null) {
-            SchemaInfoBuilder.updatePortLocations(service, portLocationMap);
-        }
+            }
+        } else {
+            //full wsdl
+            if (serviceRefType != null && serviceRefType.isSetServiceCompletion())
{
+                throw new DeploymentException("Full wsdl, but service completion supplied");
+            }
+            //organize the extra port info
+            Map portMap = new HashMap();
+            if (serviceRefType != null) {
+                GerPortType[] ports = serviceRefType.getPortArray();
+                for (int i = 0; i < ports.length; i++) {
+                    GerPortType port = ports[i];
+                    String portName = port.getPortName().trim();
+                    portMap.put(portName, port);
+                }
+            }
 
-        Map exceptionMap = WSDescriptorParser.getExceptionMap(mapping);
+            //find the service we are working with
+            javax.wsdl.Service service = getService(serviceQName, schemaInfoBuilder.getDefinition());
 
-        Map wsdlPortMap = service.getPorts();
-        for (Iterator iterator = wsdlPortMap.entrySet().iterator(); iterator.hasNext();)
{
-            Map.Entry entry = (Map.Entry) iterator.next();
-            String portName = (String) entry.getKey();
-            Port port = (Port) entry.getValue();
+            Map wsdlPortMap = service.getPorts();
+            for (Iterator iterator = wsdlPortMap.entrySet().iterator(); iterator.hasNext();)
{
+                Map.Entry entry = (Map.Entry) iterator.next();
+                String portName = (String) entry.getKey();
+                Port port = (Port) entry.getValue();
 
-            URL location = getAddressLocation(port);
+                GerPortType gerPort = (GerPortType) portMap.get(portName);
 
-            Binding binding = port.getBinding();
+                URL location = gerPort == null? getAddressLocation(port): getLocation(gerPort);
+                String credentialsName = gerPort == null || gerPort.getCredentialsName()
== null? null : gerPort.getCredentialsName().trim();
 
-            Style portStyle = getStyle(binding);
+                Binding binding = port.getBinding();
 
-            PortType portType = binding.getPortType();
+                mapBinding(binding, mapping, serviceQName, classLoader, context, module,
soapVersion, schemaInfoBuilder, portName, serviceImpl, location, handlerInfos, seiPortNameToFactoryMap,
seiClassNameToFactoryMap, credentialsName, exceptionMap);
+            }
+        }
+    }
 
-            ServiceEndpointInterfaceMappingType[] endpointMappings = mapping.getServiceEndpointInterfaceMappingArray();
+    private void mapBinding(Binding binding, JavaWsdlMappingType mapping, QName serviceQName,
ClassLoader classLoader, DeploymentContext context, Module module, SOAPConstants soapVersion,
SchemaInfoBuilder schemaInfoBuilder, String portName, Object serviceImpl, URL location, List
handlerInfos, Map seiPortNameToFactoryMap, Map seiClassNameToFactoryMap, String credentialsName,
Map exceptionMap) throws DeploymentException {
+        Style portStyle = getStyle(binding);
 
-            String credentialsName = credentialsNameMap == null ? null : (String) credentialsNameMap.get(port.getName());
+        PortType portType = binding.getPortType();
 
-            //port type corresponds to SEI
-            List operations = portType.getOperations();
-            OperationInfo[] operationInfos = new OperationInfo[operations.size()];
-            if (endpointMappings.length == 0) {
-                doLightweightMapping(service.getQName(), portType, mapping, classLoader,
context, module, operations, binding, portStyle, soapVersion, operationInfos, schemaInfoBuilder,
portName, serviceImpl, location, handlerInfos, seiPortNameToFactoryMap, seiClassNameToFactoryMap,
credentialsName);
-            } else {
-                doHeavyweightMapping(service.getQName(), portType, endpointMappings, classLoader,
context, module, operations, binding, portStyle, soapVersion, exceptionMap, schemaInfoBuilder,
mapping, operationInfos, portName, serviceImpl, location, handlerInfos, seiPortNameToFactoryMap,
seiClassNameToFactoryMap, credentialsName);
-            }
+        ServiceEndpointInterfaceMappingType[] endpointMappings = mapping.getServiceEndpointInterfaceMappingArray();
+
+
+        //port type corresponds to SEI
+        List operations = portType.getOperations();
+        OperationInfo[] operationInfos = new OperationInfo[operations.size()];
+        if (endpointMappings.length == 0) {
+            doLightweightMapping(serviceQName, portType, mapping, classLoader, context, module,
operations, binding, portStyle, soapVersion, operationInfos, schemaInfoBuilder, portName,
serviceImpl, location, handlerInfos, seiPortNameToFactoryMap, seiClassNameToFactoryMap, credentialsName);
+        } else {
+            doHeavyweightMapping(serviceQName, portType, endpointMappings, classLoader, context,
module, operations, binding, portStyle, soapVersion, exceptionMap, schemaInfoBuilder, mapping,
operationInfos, portName, serviceImpl, location, handlerInfos, seiPortNameToFactoryMap, seiClassNameToFactoryMap,
credentialsName);
+        }
+    }
+
+    private URL getLocation(GerPortType port) throws DeploymentException {
+        String protocol = port.getProtocol().trim();
+        String host = port.getHost().trim();
+        int portNum = port.getPort();
+        String uri = port.getUri().trim();
+        String locationURIString = protocol + "://" + host + ":" + portNum + uri;
+        URL location;
+        try {
+            location = new URL(locationURIString);
+        } catch (MalformedURLException e) {
+            throw new DeploymentException("Could not construct web service location URL from
" + locationURIString);
         }
+        return location;
     }
 
     private javax.wsdl.Service getService(QName serviceQName, Definition definition) throws
DeploymentException {
@@ -280,8 +346,7 @@
                 throw new DeploymentException("no serviceQName supplied, and there are "
+ services.size() + " services");
             }
             if (services.size() == 0) {
-                //partial wsdl
-                service = null;
+                throw new DeploymentException("No service in wsdl, and no service completion
supplied!");
             } else {
                 service = (javax.wsdl.Service) services.values().iterator().next();
             }

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?rev=171145&r1=171144&r2=171145&view=diff
==============================================================================
--- 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
Fri May 20 12:53:16 2005
@@ -73,6 +73,7 @@
 import org.apache.geronimo.xbeans.j2ee.JavaWsdlMappingDocument;
 import org.apache.geronimo.xbeans.j2ee.JavaWsdlMappingType;
 import org.apache.geronimo.xbeans.j2ee.PackageMappingType;
+import org.apache.geronimo.xbeans.geronimo.naming.GerServiceRefType;
 
 /**
  * @version $Rev:  $ $Date:  $
@@ -89,8 +90,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 Map credentialsNameMap = new HashMap();
+    private GerServiceRefType gerServiceRefType = null;
 
     private Module module;
 
@@ -159,7 +159,7 @@
         JavaWsdlMappingType mapping = buildLightweightMappingType();
         QName serviceQName = new QName(NAMESPACE, "MockService");
         AxisBuilder builder = new AxisBuilder();
-        Object proxy = builder.createService(MockService.class, schemaInfoBuilder, mapping,
serviceQName, SOAPConstants.SOAP11_CONSTANTS, handlerInfos, portLocationMap, credentialsNameMap,
context, module, isolatedCl);
+        Object proxy = builder.createService(MockService.class, schemaInfoBuilder, mapping,
serviceQName, SOAPConstants.SOAP11_CONSTANTS, handlerInfos, gerServiceRefType, context, module,
isolatedCl);
         assertNotNull(proxy);
         assertTrue(proxy instanceof MockService);
         MockPort mockPort = ((MockService) proxy).getMockPort();
@@ -177,7 +177,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, schemaInfoBuilder, mapping,
serviceQName, SOAPConstants.SOAP11_CONSTANTS, handlerInfos, portLocationMap, credentialsNameMap,
context, module, isolatedCl);
+        Object proxy = builder.createService(BookQuoteService.class, schemaInfoBuilder, mapping,
serviceQName, SOAPConstants.SOAP11_CONSTANTS, handlerInfos, gerServiceRefType, context, module,
isolatedCl);
         assertNotNull(proxy);
         assertTrue(proxy instanceof BookQuoteService);
         BookQuote bookQuote = ((BookQuoteService) proxy).getBookQuotePort();
@@ -195,7 +195,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, schemaInfoBuilder, mapping,
serviceQName, SOAPConstants.SOAP11_CONSTANTS, handlerInfos, portLocationMap, credentialsNameMap,
context, module, isolatedCl);
+        Object proxy = builder.createService(InteropLab.class, schemaInfoBuilder, mapping,
serviceQName, SOAPConstants.SOAP11_CONSTANTS, handlerInfos, gerServiceRefType, context, module,
isolatedCl);
         assertNotNull(proxy);
         assertTrue(proxy instanceof InteropLab);
         InteropTestPortType interopTestPort = ((InteropLab) proxy).getinteropTestPort();
@@ -225,7 +225,7 @@
         AxisBuilder builder = new AxisBuilder();
         Map portComponentRefMap = null;
         List handlers = null;
-        DeserializingReference reference = (DeserializingReference) builder.createService(InteropLab.class,
wsdlURI, jaxrpcmappingURI, serviceQName, portComponentRefMap, handlers, portLocationMap, credentialsNameMap,
context, module, cl);
+        DeserializingReference reference = (DeserializingReference) builder.createService(InteropLab.class,
wsdlURI, jaxrpcmappingURI, serviceQName, portComponentRefMap, handlers, gerServiceRefType,
context, module, cl);
         ClassLoader contextCl = context.getClassLoader(null);
         reference.setClassLoader(contextCl);
         Object proxy = reference.getContent();

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?rev=171145&r1=171144&r2=171145&view=diff
==============================================================================
--- 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
Fri May 20 12:53:16 2005
@@ -149,7 +149,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,
Map portLocationMap, Map credentialsNameMap, DeploymentContext deploymentContext, Module module,
ClassLoader classLoader) {
+                                        public Object createService(Class serviceInterface,
URI wsdlURI, URI jaxrpcMappingURI, QName serviceQName, Map portComponentRefMap, List handlerInfos,
Object serviceRefType, 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?rev=171145&r1=171144&r2=171145&view=diff
==============================================================================
--- 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
Fri May 20 12:53:16 2005
@@ -310,9 +310,9 @@
             return containerName.getCanonicalName();
         }
     }
-
-    public Object getServiceReference(Class serviceInterface, URI wsdlURI, URI jaxrpcMappingURI,
QName serviceQName, Map portComponentRefMap, List handlerInfos, Map portLocationMap, Map credentialsNameMap,
DeploymentContext deploymentContext, Module module, ClassLoader classLoader) throws DeploymentException
{
-        return serviceReferenceBuilder.createService(serviceInterface, wsdlURI, jaxrpcMappingURI,
serviceQName, portComponentRefMap, handlerInfos, portLocationMap, credentialsNameMap, deploymentContext,
module, classLoader);
+                                                  
+    public Object getServiceReference(Class serviceInterface, URI wsdlURI, URI jaxrpcMappingURI,
QName serviceQName, Map portComponentRefMap, List handlerInfos, Object serviceRefType, DeploymentContext
deploymentContext, Module module, ClassLoader classLoader) throws DeploymentException {
+        return serviceReferenceBuilder.createService(serviceInterface, wsdlURI, jaxrpcMappingURI,
serviceQName, portComponentRefMap, handlerInfos, serviceRefType, 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?rev=171145&r1=171144&r2=171145&view=diff
==============================================================================
--- 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
Fri May 20 12:53:16 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, Map portLocationMap, Map credentialsNameMap,
DeploymentContext deploymentContext, Module module, ClassLoader classLoader) throws DeploymentException;
+    Object createService(Class serviceInterface, URI wsdlURI, URI jaxrpcMappingURI, QName
serviceQName, Map portComponentRefMap, List handlerInfos, Object serviceRefType, DeploymentContext
deploymentContext, Module module, ClassLoader classLoader) throws DeploymentException;
 
     //TODO a locate port method for links.
 

Modified: geronimo/trunk/modules/j2ee-builder/src/java/org/apache/geronimo/j2ee/deployment/UnavailableServiceReferenceBuilder.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/j2ee-builder/src/java/org/apache/geronimo/j2ee/deployment/UnavailableServiceReferenceBuilder.java?rev=171145&r1=171144&r2=171145&view=diff
==============================================================================
--- geronimo/trunk/modules/j2ee-builder/src/java/org/apache/geronimo/j2ee/deployment/UnavailableServiceReferenceBuilder.java
(original)
+++ geronimo/trunk/modules/j2ee-builder/src/java/org/apache/geronimo/j2ee/deployment/UnavailableServiceReferenceBuilder.java
Fri May 20 12:53:16 2005
@@ -32,7 +32,7 @@
  */
 public class UnavailableServiceReferenceBuilder implements ServiceReferenceBuilder {
 
-    public Object createService(Class serviceInterface, URI wsdlURI, URI jaxrpcMappingURI,
QName serviceQName, Map portComponentRefMap, List handlerInfos, Map portLocationMap, Map credentialsNameMap,
DeploymentContext deploymentContext, Module module, ClassLoader classLoader) throws DeploymentException
{
+    public Object createService(Class serviceInterface, URI wsdlURI, URI jaxrpcMappingURI,
QName serviceQName, Map portComponentRefMap, List handlerInfos, Object serviceRefType, DeploymentContext
deploymentContext, Module module, ClassLoader classLoader) throws DeploymentException {
         throw new DeploymentException("Service references are not available in this configuration");
     }
 

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?rev=171145&r1=171144&r2=171145&view=diff
==============================================================================
--- 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
Fri May 20 12:53:16 2005
@@ -67,7 +67,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, Map portLocationMap, Map credentialsNameMap,
DeploymentContext deploymentContext, Module module, ClassLoader classLoader) {
+        public Object createService(Class serviceInterface, URI wsdlURI, URI jaxrpcMappingURI,
QName serviceQName, Map portComponentRefMap, List handlerInfos, Object serviceRefType, DeploymentContext
deploymentContext, Module module, ClassLoader classLoader) {
             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?rev=171145&r1=171144&r2=171145&view=diff
==============================================================================
--- 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
Fri May 20 12:53:16 2005
@@ -210,7 +210,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, Map portLocationMap, Map credentialsNameMap,
DeploymentContext deploymentContext, Module module, ClassLoader classLoader) throws DeploymentException
{
+            public Object createService(Class serviceInterface, URI wsdlURI, URI jaxrpcMappingURI,
QName serviceQName, Map portComponentRefMap, List handlerInfos, Object serviceRefType, DeploymentContext
deploymentContext, Module module, ClassLoader classLoader) throws DeploymentException {
                 return null;
             }
         }, kernel);

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?rev=171145&r1=171144&r2=171145&view=diff
==============================================================================
--- 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
Fri May 20 12:53:16 2005
@@ -202,7 +202,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, Map portLocationMap,
Map credentialsNameMap, DeploymentContext deploymentContext, Module module, ClassLoader classLoader)
throws DeploymentException {
+                    public Object createService(Class serviceInterface, URI wsdlURI, URI
jaxrpcMappingURI, QName serviceQName, Map portComponentRefMap, List handlerInfos, Object serviceRefType,
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?rev=171145&r1=171144&r2=171145&view=diff
==============================================================================
--- 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
Fri May 20 12:53:16 2005
@@ -432,16 +432,16 @@
         }
     }
 
-    //TODO current implementation does not deal with portComponentRefs.
-    public static void addServiceRefs(EARContext earContext, Module module, ServiceRefType[]
serviceRefs, Map serviceRefMap, Map serviceRefCredentialsNameMap, ClassLoader cl, ComponentContextBuilder
builder) throws DeploymentException {
+    //TODO current implementation does not deal with portComponentRef links.
+    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);
-            Map credentialsNameMap = (Map) serviceRefCredentialsNameMap.get(name);
+            GerServiceRefType serviceRefType = (GerServiceRefType) serviceRefMap.get(name);
+//            Map credentialsNameMap = (Map) serviceRefCredentialsNameMap.get(name);
             String serviceInterfaceName = getStringValue(serviceRef.getServiceInterface());
             assureInterface(serviceInterfaceName, "javax.xml.rpc.Service", "[Web]Service",
cl);
             Class serviceInterface = null;
@@ -491,7 +491,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, portLocationMap, credentialsNameMap, earContext,
module, cl);
+            Object ref = refContext.getServiceReference(serviceInterface, wsdlURI, jaxrpcMappingURI,
serviceQName, portComponentRefMap, handlerInfos, serviceRefType, earContext, module, cl);
             builder.bind(name, ref);
         }
 
@@ -678,10 +678,11 @@
 
         addMessageDestinationRefs(earContext, uri, messageDestinationRefs, cl, builder);
 
-        Map serviceRefMap = new HashMap();
-        Map serviceRefCredentialsNameMap = new HashMap();
-        mapServiceRefs(gerServiceRefs, serviceRefMap, serviceRefCredentialsNameMap);
-        addServiceRefs(earContext, module, serviceRefs, serviceRefMap, serviceRefCredentialsNameMap,
cl, builder);
+//        Map serviceRefMap = new HashMap();
+//        Map serviceRefCredentialsNameMap = new HashMap();
+//        mapServiceRefs(gerServiceRefs, serviceRefMap, serviceRefCredentialsNameMap);
+        Map serviceRefMap = mapServiceRefs(gerServiceRefs);
+        addServiceRefs(earContext, module, serviceRefs, serviceRefMap, cl, builder);
 
         return builder.getContext();
     }
@@ -730,35 +731,14 @@
         return refMap;
     }
 
-    private static Map mapServiceRefs(GerServiceRefType[] refs, Map refMap, Map serviceRefCredentialsNameMap)
{
-        if (refs != null) {
-            for (int i = 0; i < refs.length; i++) {
-                GerServiceRefType ref = refs[i];
-                String serviceRefName = ref.getServiceRefName().trim();
-                Map portMap = new HashMap();
-                Map credentialsMap = 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);
-
-                    if (port.isSetCredentialsName()) {
-                        String credentialsName = port.getCredentialsName();
-                        credentialsMap.put(portName, credentialsName);
-                    }
-                }
-                refMap.put(serviceRefName, portMap);
-                serviceRefCredentialsNameMap.put(serviceRefName, credentialsMap);
-            }
+    private static Map mapServiceRefs(GerServiceRefType[] refs) {
+        Map refMap = new HashMap();
+        for (int i = 0; i < refs.length; i++) {
+            GerServiceRefType ref = refs[i];
+            String serviceRefName = ref.getServiceRefName().trim();
+            refMap.put(serviceRefName, ref);
         }
         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?rev=171145&r1=171144&r2=171145&view=diff
==============================================================================
--- geronimo/trunk/modules/naming-builder/src/schema/geronimo-naming.xsd (original)
+++ geronimo/trunk/modules/naming-builder/src/schema/geronimo-naming.xsd Fri May 20 12:53:16
2005
@@ -6,9 +6,9 @@
     Licensed 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.
@@ -189,15 +189,35 @@
             <xsd:element name="port-name" type="xsd:string"/>
             <xsd:group ref="gernaming:serverGroup" minOccurs="0"/>
             <xsd:element name="uri" type="xsd:string"/>
-            <xsd:element name="credentials-name" type="xsd:string" minOccurs="0"/>

+            <xsd:element name="credentials-name" type="xsd:string" minOccurs="0"/>
         </xsd:sequence>
     </xsd:complexType>
 
     <xsd:complexType name="service-refType">
         <xsd:sequence>
             <xsd:element name="service-ref-name" type="xsd:string"/>
+            <xsd:choice>
+                <xsd:element name="service-completion" type="gernaming:service-completionType"/>
             <xsd:element name="port" type="gernaming:portType" maxOccurs="unbounded"/>
+            </xsd:choice>
+        </xsd:sequence>
+    </xsd:complexType>
+
+    <xsd:complexType name="service-completionType">
+        <xsd:sequence>
+            <xsd:element name="service-name" type="xsd:string"/>
+            <xsd:element name="port" type="gernaming:port-completionType" maxOccurs="unbounded"/>
         </xsd:sequence>
+    </xsd:complexType>
+
+    <xsd:complexType name="port-completionType">
+        <xsd:complexContent>
+            <xsd:extension base="gernaming:portType">
+                <xsd:sequence>
+                    <xsd:element name="binding-name" type="xsd:string"/>
+                </xsd:sequence>
+            </xsd:extension>
+        </xsd:complexContent>
     </xsd:complexType>
 
     <xsd:group name="corbaNameGroup">



Mime
View raw message