cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dk...@apache.org
Subject svn commit: r593686 - in /incubator/cxf/branches/2.0.x-fixes: ./ api/src/main/java/org/apache/cxf/service/model/ rt/core/src/main/java/org/apache/cxf/bus/spring/ rt/core/src/main/java/org/apache/cxf/wsdl11/ rt/frontend/jaxws/src/main/java/org/apache/cx...
Date Fri, 09 Nov 2007 23:02:35 GMT
Author: dkulp
Date: Fri Nov  9 15:02:33 2007
New Revision: 593686

URL: http://svn.apache.org/viewvc?rev=593686&view=rev
Log:
Merged revisions 593678 via svnmerge from 
https://svn.apache.org/repos/asf/incubator/cxf/trunk

........
  r593678 | dkulp | 2007-11-09 17:41:21 -0500 (Fri, 09 Nov 2007) | 3 lines
  
  [CXF-1192] Fix concurrency problem with Jsr250 injection
  More fixes to make sure MessagePartInfo's have xmlschematype set for jaxws/jaxb case.
........

Modified:
    incubator/cxf/branches/2.0.x-fixes/   (props changed)
    incubator/cxf/branches/2.0.x-fixes/api/src/main/java/org/apache/cxf/service/model/MessagePartInfo.java
    incubator/cxf/branches/2.0.x-fixes/rt/core/src/main/java/org/apache/cxf/bus/spring/Jsr250BeanPostProcessor.java
    incubator/cxf/branches/2.0.x-fixes/rt/core/src/main/java/org/apache/cxf/wsdl11/WSDLServiceBuilder.java
    incubator/cxf/branches/2.0.x-fixes/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/interceptors/WrapperClassInInterceptor.java
    incubator/cxf/branches/2.0.x-fixes/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/interceptors/WrapperClassOutInterceptor.java
    incubator/cxf/branches/2.0.x-fixes/rt/frontend/simple/src/main/java/org/apache/cxf/service/factory/ReflectionServiceFactoryBean.java
    incubator/cxf/branches/2.0.x-fixes/systests/src/test/java/org/apache/cxf/systest/ws/rm/SequenceTest.java

Propchange: incubator/cxf/branches/2.0.x-fixes/
------------------------------------------------------------------------------
Binary property 'svnmerge-integrated' - no diff available.

Modified: incubator/cxf/branches/2.0.x-fixes/api/src/main/java/org/apache/cxf/service/model/MessagePartInfo.java
URL: http://svn.apache.org/viewvc/incubator/cxf/branches/2.0.x-fixes/api/src/main/java/org/apache/cxf/service/model/MessagePartInfo.java?rev=593686&r1=593685&r2=593686&view=diff
==============================================================================
--- incubator/cxf/branches/2.0.x-fixes/api/src/main/java/org/apache/cxf/service/model/MessagePartInfo.java
(original)
+++ incubator/cxf/branches/2.0.x-fixes/api/src/main/java/org/apache/cxf/service/model/MessagePartInfo.java
Fri Nov  9 15:02:33 2007
@@ -22,6 +22,7 @@
 import javax.xml.namespace.QName;
 
 import org.apache.ws.commons.schema.XmlSchemaAnnotated;
+import org.apache.ws.commons.schema.XmlSchemaElement;
 
 public final class MessagePartInfo extends AbstractPropertiesHolder {
 
@@ -78,6 +79,8 @@
     public QName getTypeQName() {
         if (!isElement) {
             return typeName;
+        } else if (xmlSchema instanceof XmlSchemaElement) {
+            return ((XmlSchemaElement)xmlSchema).getSchemaTypeName();
         }
         return null;
     }

Modified: incubator/cxf/branches/2.0.x-fixes/rt/core/src/main/java/org/apache/cxf/bus/spring/Jsr250BeanPostProcessor.java
URL: http://svn.apache.org/viewvc/incubator/cxf/branches/2.0.x-fixes/rt/core/src/main/java/org/apache/cxf/bus/spring/Jsr250BeanPostProcessor.java?rev=593686&r1=593685&r2=593686&view=diff
==============================================================================
--- incubator/cxf/branches/2.0.x-fixes/rt/core/src/main/java/org/apache/cxf/bus/spring/Jsr250BeanPostProcessor.java
(original)
+++ incubator/cxf/branches/2.0.x-fixes/rt/core/src/main/java/org/apache/cxf/bus/spring/Jsr250BeanPostProcessor.java
Fri Nov  9 15:02:33 2007
@@ -37,11 +37,12 @@
 public class Jsr250BeanPostProcessor 
     implements DestructionAwareBeanPostProcessor, Ordered, ApplicationContextAware {
 
-    private ResourceInjector injector;
+    private ResourceManager resourceManager;
+    private List<ResourceResolver> resolvers;
+    
     private ApplicationContext context;
 
     Jsr250BeanPostProcessor() {
-        injector = new ResourceInjector(null, null); 
     }
     
     public void setApplicationContext(ApplicationContext arg0) throws BeansException {
@@ -53,32 +54,30 @@
     }
         
     public Object postProcessAfterInitialization(Object bean, String beanId) throws BeansException
{
-        if (bean != null
-            && injector != null) {
-            injector.construct(bean);
+        if (bean != null) {
+            new ResourceInjector(resourceManager, resolvers).construct(bean);
         }
         if (bean instanceof ResourceManager) {
-            ResourceManager rm = (ResourceManager)bean;
+            resourceManager = (ResourceManager)bean;
 
             Map<String, Object> mp = CastUtils.cast(context.getBeansOfType(ResourceResolver.class));
             Collection<ResourceResolver> resolvs = CastUtils.cast(mp.values());
-            List<ResourceResolver> resolvers = new ArrayList<ResourceResolver>(rm.getResourceResolvers());
+            resolvers = new ArrayList<ResourceResolver>(resourceManager.getResourceResolvers());
             resolvers.addAll(resolvs);
-            injector = new ResourceInjector(rm, resolvers);
         }
         return bean;
     }
 
     public Object postProcessBeforeInitialization(Object bean, String beanId) throws BeansException
{
-        if (bean != null && injector != null) {
-            injector.inject(bean);
+        if (bean != null) {
+            new ResourceInjector(resourceManager, resolvers).inject(bean);
         }
         return bean;
     }
 
     public void postProcessBeforeDestruction(Object bean, String beanId) {
         if (bean != null) {
-            injector.destroy(bean);
+            new ResourceInjector(resourceManager, resolvers).destroy(bean);
         }
     }
 

Modified: incubator/cxf/branches/2.0.x-fixes/rt/core/src/main/java/org/apache/cxf/wsdl11/WSDLServiceBuilder.java
URL: http://svn.apache.org/viewvc/incubator/cxf/branches/2.0.x-fixes/rt/core/src/main/java/org/apache/cxf/wsdl11/WSDLServiceBuilder.java?rev=593686&r1=593685&r2=593686&view=diff
==============================================================================
--- incubator/cxf/branches/2.0.x-fixes/rt/core/src/main/java/org/apache/cxf/wsdl11/WSDLServiceBuilder.java
(original)
+++ incubator/cxf/branches/2.0.x-fixes/rt/core/src/main/java/org/apache/cxf/wsdl11/WSDLServiceBuilder.java
Fri Nov  9 15:02:33 2007
@@ -619,10 +619,14 @@
                     MessagePartInfo mpi = wrapper.addMessagePart(new QName(namespaceURI,
el.getName()));
                     mpi.setTypeQName(el.getSchemaTypeName());
                     mpi.setConcreteName(el.getQName());
+                    mpi.setElement(true);
+                    mpi.setElementQName(el.getQName());
                     mpi.setXmlSchema(el);
                 } else if (el.getRefName() != null) {
                     MessagePartInfo mpi = wrapper.addMessagePart(el.getRefName());
                     mpi.setTypeQName(el.getRefName());
+                    mpi.setElementQName(el.getRefName());
+                    mpi.setElement(true);
                     mpi.setXmlSchema(el);
                     // element reference is not permitted for wrapper element
                     if (!allowRefs) {
@@ -631,6 +635,7 @@
                 } else {
                     // anonymous type
                     MessagePartInfo mpi = wrapper.addMessagePart(new QName(namespaceURI,
el.getName()));
+                    mpi.setConcreteName(el.getQName());
                     mpi.setElementQName(mpi.getName());
                     mpi.setElement(true);
                     mpi.setXmlSchema(el);

Modified: incubator/cxf/branches/2.0.x-fixes/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/interceptors/WrapperClassInInterceptor.java
URL: http://svn.apache.org/viewvc/incubator/cxf/branches/2.0.x-fixes/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/interceptors/WrapperClassInInterceptor.java?rev=593686&r1=593685&r2=593686&view=diff
==============================================================================
--- incubator/cxf/branches/2.0.x-fixes/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/interceptors/WrapperClassInInterceptor.java
(original)
+++ incubator/cxf/branches/2.0.x-fixes/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/interceptors/WrapperClassInInterceptor.java
Fri Nov  9 15:02:33 2007
@@ -168,15 +168,11 @@
                 partNames.set(idx, null);
             } else {
                 String elementType = null;
-                if (p.isElement()) {
-                    elementType = p.getElementQName().getLocalPart();
+                if (p.getTypeQName() == null) {
+                    // handling anonymous complex type
+                    elementType = null;
                 } else {
-                    if (p.getTypeQName() == null) {
-                        // handling anonymous complex type
-                        elementType = null;
-                    } else {
-                        elementType = p.getTypeQName().getLocalPart();
-                    }
+                    elementType = p.getTypeQName().getLocalPart();
                 }
                 int idx = p.getIndex();
                 ensureSize(elTypeNames, idx);

Modified: incubator/cxf/branches/2.0.x-fixes/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/interceptors/WrapperClassOutInterceptor.java
URL: http://svn.apache.org/viewvc/incubator/cxf/branches/2.0.x-fixes/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/interceptors/WrapperClassOutInterceptor.java?rev=593686&r1=593685&r2=593686&view=diff
==============================================================================
--- incubator/cxf/branches/2.0.x-fixes/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/interceptors/WrapperClassOutInterceptor.java
(original)
+++ incubator/cxf/branches/2.0.x-fixes/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/interceptors/WrapperClassOutInterceptor.java
Fri Nov  9 15:02:33 2007
@@ -80,15 +80,11 @@
                     partNames.set(p.getIndex(), p.getName().getLocalPart());
                     
                     String elementType = null;
-                    if (p.isElement()) {
-                        elementType = p.getElementQName().getLocalPart();
+                    if (p.getTypeQName() == null) {
+                        // handling anonymous complex type
+                        elementType = null;
                     } else {
-                        if (p.getTypeQName() == null) {
-                            // handling anonymous complex type
-                            elementType = null;
-                        } else {
-                            elementType = p.getTypeQName().getLocalPart();
-                        }
+                        elementType = p.getTypeQName().getLocalPart();
                     }
                     
                     elTypeNames.set(p.getIndex(), elementType);

Modified: incubator/cxf/branches/2.0.x-fixes/rt/frontend/simple/src/main/java/org/apache/cxf/service/factory/ReflectionServiceFactoryBean.java
URL: http://svn.apache.org/viewvc/incubator/cxf/branches/2.0.x-fixes/rt/frontend/simple/src/main/java/org/apache/cxf/service/factory/ReflectionServiceFactoryBean.java?rev=593686&r1=593685&r2=593686&view=diff
==============================================================================
--- incubator/cxf/branches/2.0.x-fixes/rt/frontend/simple/src/main/java/org/apache/cxf/service/factory/ReflectionServiceFactoryBean.java
(original)
+++ incubator/cxf/branches/2.0.x-fixes/rt/frontend/simple/src/main/java/org/apache/cxf/service/factory/ReflectionServiceFactoryBean.java
Fri Nov  9 15:02:33 2007
@@ -332,10 +332,10 @@
         } else {
             buildServiceFromClass();
         }
-        //assert validateServiceModel();
+        //validateServiceModel();
     }
     
-    public boolean validateServiceModel() {
+    public void validateServiceModel() {
         for (ServiceInfo si : getService().getServiceInfos()) {
             for (OperationInfo opInfo : si.getInterface().getOperations()) {
                 for (MessagePartInfo mpi : opInfo.getInput().getMessageParts()) {
@@ -346,17 +346,8 @@
                         assert !(mpi.getXmlSchema() instanceof XmlSchemaElement);
                     }
                 }
-                for (MessagePartInfo mpi : opInfo.getOutput().getMessageParts()) {
-                    assert mpi.getXmlSchema() != null;
-                    if (mpi.isElement()) {
-                        assert mpi.getXmlSchema() instanceof XmlSchemaElement;
-                    } else {
-                        assert !(mpi.getXmlSchema() instanceof XmlSchemaElement);
-                    }
-                }
-                if (opInfo.isUnwrappedCapable()) {
-                    opInfo = opInfo.getUnwrappedOperation();
-                    for (MessagePartInfo mpi : opInfo.getInput().getMessageParts()) {
+                if (opInfo.hasOutput()) {
+                    for (MessagePartInfo mpi : opInfo.getOutput().getMessageParts()) {
                         assert mpi.getXmlSchema() != null;
                         if (mpi.isElement()) {
                             assert mpi.getXmlSchema() instanceof XmlSchemaElement;
@@ -364,7 +355,10 @@
                             assert !(mpi.getXmlSchema() instanceof XmlSchemaElement);
                         }
                     }
-                    for (MessagePartInfo mpi : opInfo.getOutput().getMessageParts()) {
+                }
+                if (opInfo.isUnwrappedCapable()) {
+                    opInfo = opInfo.getUnwrappedOperation();
+                    for (MessagePartInfo mpi : opInfo.getInput().getMessageParts()) {
                         assert mpi.getXmlSchema() != null;
                         if (mpi.isElement()) {
                             assert mpi.getXmlSchema() instanceof XmlSchemaElement;
@@ -372,6 +366,16 @@
                             assert !(mpi.getXmlSchema() instanceof XmlSchemaElement);
                         }
                     }
+                    if (opInfo.hasOutput()) {
+                        for (MessagePartInfo mpi : opInfo.getOutput().getMessageParts())
{
+                            assert mpi.getXmlSchema() != null;
+                            if (mpi.isElement()) {
+                                assert mpi.getXmlSchema() instanceof XmlSchemaElement;
+                            } else {
+                                assert !(mpi.getXmlSchema() instanceof XmlSchemaElement);
+                            }
+                        }
+                    }
                 }
                 if (opInfo.hasFaults()) {
                     //check to make sure the faults are elements
@@ -386,7 +390,6 @@
 
             }
         }
-        return true;
     }
 
     public boolean isPopulateFromClass() {
@@ -617,6 +620,7 @@
         for (SchemaInfo s : serviceInfo.getSchemas()) {
             XmlSchemaElement e = s.getElementByQName(mpi.getElementQName());
             if (e != null) {
+                mpi.setXmlSchema(e);
                 return;
             }
         }
@@ -637,6 +641,7 @@
 
         XmlSchemaType tp = (XmlSchemaType)mpi.getXmlSchema();
         el.setSchemaTypeName(tp.getQName());
+        mpi.setXmlSchema(el);
     }
 
     public boolean getAnonymousWrapperTypes() {
@@ -723,6 +728,7 @@
                 if (schema != null && schema.getElementByName(qname) != null) {
                     mpi.setElement(true);
                     mpi.setElementQName(qname);
+                    mpi.setXmlSchema(schema.getElementByName(qname));
                     paraNumber++;
                     continue;
                 }
@@ -866,11 +872,12 @@
                 boolean wasType = !mpi.isElement();
                 if (wasType) {
                     QName concreteName = mpi.getConcreteName();
-                    mpi.setXmlSchema(el);
                     mpi.setElement(true);
                     mpi.setElementQName(el.getQName());
                     mpi.setConcreteName(concreteName);
                 }
+                mpi.setXmlSchema(el);
+
                 if (mpi.getTypeClass() != null && mpi.getTypeClass().isArray()
                     && !Byte.TYPE.equals(mpi.getTypeClass().getComponentType()))
{
                     String min = (String)mpi.getProperty("minOccurs");

Modified: incubator/cxf/branches/2.0.x-fixes/systests/src/test/java/org/apache/cxf/systest/ws/rm/SequenceTest.java
URL: http://svn.apache.org/viewvc/incubator/cxf/branches/2.0.x-fixes/systests/src/test/java/org/apache/cxf/systest/ws/rm/SequenceTest.java?rev=593686&r1=593685&r2=593686&view=diff
==============================================================================
--- incubator/cxf/branches/2.0.x-fixes/systests/src/test/java/org/apache/cxf/systest/ws/rm/SequenceTest.java
(original)
+++ incubator/cxf/branches/2.0.x-fixes/systests/src/test/java/org/apache/cxf/systest/ws/rm/SequenceTest.java
Fri Nov  9 15:02:33 2007
@@ -126,8 +126,12 @@
     
     @After
     public void tearDown() {
-        stopGreeter();
-        stopControl();
+        try {
+            stopGreeter();
+            stopControl();
+        } catch (Throwable t) {
+            //ignore
+        }
     }
 
     /** 



Mime
View raw message