geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ga...@apache.org
Subject svn commit: r702526 - /geronimo/server/trunk/plugins/axis2/geronimo-axis2/src/main/java/org/apache/geronimo/axis2/pojo/
Date Tue, 07 Oct 2008 15:55:59 GMT
Author: gawor
Date: Tue Oct  7 08:55:58 2008
New Revision: 702526

URL: http://svn.apache.org/viewvc?rev=702526&view=rev
Log:
make sure MessageContext of WebServivceContext is updated with WSDL properties in thread safe
way (GERONIMO-4327)

Added:
    geronimo/server/trunk/plugins/axis2/geronimo-axis2/src/main/java/org/apache/geronimo/axis2/pojo/POJOEndpointDispatcherFactory.java
  (with props)
    geronimo/server/trunk/plugins/axis2/geronimo-axis2/src/main/java/org/apache/geronimo/axis2/pojo/POJOProviderDispatcher.java
  (with props)
    geronimo/server/trunk/plugins/axis2/geronimo-axis2/src/main/java/org/apache/geronimo/axis2/pojo/POJOServiceDispatcher.java
  (with props)
Modified:
    geronimo/server/trunk/plugins/axis2/geronimo-axis2/src/main/java/org/apache/geronimo/axis2/pojo/POJOEndpointLifecycleManager.java
    geronimo/server/trunk/plugins/axis2/geronimo-axis2/src/main/java/org/apache/geronimo/axis2/pojo/POJOWebServiceContainer.java
    geronimo/server/trunk/plugins/axis2/geronimo-axis2/src/main/java/org/apache/geronimo/axis2/pojo/POJOWebServiceContext.java

Added: geronimo/server/trunk/plugins/axis2/geronimo-axis2/src/main/java/org/apache/geronimo/axis2/pojo/POJOEndpointDispatcherFactory.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/axis2/geronimo-axis2/src/main/java/org/apache/geronimo/axis2/pojo/POJOEndpointDispatcherFactory.java?rev=702526&view=auto
==============================================================================
--- geronimo/server/trunk/plugins/axis2/geronimo-axis2/src/main/java/org/apache/geronimo/axis2/pojo/POJOEndpointDispatcherFactory.java
(added)
+++ geronimo/server/trunk/plugins/axis2/geronimo-axis2/src/main/java/org/apache/geronimo/axis2/pojo/POJOEndpointDispatcherFactory.java
Tue Oct  7 08:55:58 2008
@@ -0,0 +1,44 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *      
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.geronimo.axis2.pojo;
+
+import javax.xml.ws.Provider;
+
+import org.apache.axis2.jaxws.core.MessageContext;
+import org.apache.axis2.jaxws.server.dispatcher.EndpointDispatcher;
+import org.apache.axis2.jaxws.server.dispatcher.factory.EndpointDispatcherFactory;
+
+public class POJOEndpointDispatcherFactory implements EndpointDispatcherFactory {
+     
+    public EndpointDispatcher createEndpointDispatcher(Class serviceClass, 
+                                                       Object serviceInstance) {
+        return createEndpointDispatcher(null, serviceClass, serviceInstance);
+    }
+
+    public EndpointDispatcher createEndpointDispatcher(MessageContext mc, 
+                                                       Class serviceClass, 
+                                                       Object serviceInstance) {
+        if (Provider.class.isAssignableFrom(serviceClass)) {
+            return new POJOProviderDispatcher(serviceClass, serviceInstance);
+        } else {
+            return new POJOServiceDispatcher(serviceClass, serviceInstance);
+        }
+    }
+
+}

Propchange: geronimo/server/trunk/plugins/axis2/geronimo-axis2/src/main/java/org/apache/geronimo/axis2/pojo/POJOEndpointDispatcherFactory.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/server/trunk/plugins/axis2/geronimo-axis2/src/main/java/org/apache/geronimo/axis2/pojo/POJOEndpointDispatcherFactory.java
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: geronimo/server/trunk/plugins/axis2/geronimo-axis2/src/main/java/org/apache/geronimo/axis2/pojo/POJOEndpointDispatcherFactory.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Modified: geronimo/server/trunk/plugins/axis2/geronimo-axis2/src/main/java/org/apache/geronimo/axis2/pojo/POJOEndpointLifecycleManager.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/axis2/geronimo-axis2/src/main/java/org/apache/geronimo/axis2/pojo/POJOEndpointLifecycleManager.java?rev=702526&r1=702525&r2=702526&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/axis2/geronimo-axis2/src/main/java/org/apache/geronimo/axis2/pojo/POJOEndpointLifecycleManager.java
(original)
+++ geronimo/server/trunk/plugins/axis2/geronimo-axis2/src/main/java/org/apache/geronimo/axis2/pojo/POJOEndpointLifecycleManager.java
Tue Oct  7 08:55:58 2008
@@ -25,7 +25,6 @@
 import org.apache.axis2.jaxws.handler.SoapMessageContext;
 import org.apache.axis2.jaxws.server.endpoint.lifecycle.EndpointLifecycleException;
 import org.apache.axis2.jaxws.server.endpoint.lifecycle.EndpointLifecycleManager;
-import org.apache.axis2.jaxws.server.endpoint.lifecycle.impl.EndpointLifecycleManagerImpl;
 
 public class POJOEndpointLifecycleManager implements EndpointLifecycleManager {
         
@@ -46,9 +45,6 @@
         // associate JAX-WS MessageContext with the thread
         POJOWebServiceContext.set(wsContext);
         
-        // XXX: JUST A HACK
-        serviceContext.setProperty(EndpointLifecycleManagerImpl.WEBSERVICE_MESSAGE_CONTEXT,
wsContext);
-        
         return instance;
     }
     

Added: geronimo/server/trunk/plugins/axis2/geronimo-axis2/src/main/java/org/apache/geronimo/axis2/pojo/POJOProviderDispatcher.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/axis2/geronimo-axis2/src/main/java/org/apache/geronimo/axis2/pojo/POJOProviderDispatcher.java?rev=702526&view=auto
==============================================================================
--- geronimo/server/trunk/plugins/axis2/geronimo-axis2/src/main/java/org/apache/geronimo/axis2/pojo/POJOProviderDispatcher.java
(added)
+++ geronimo/server/trunk/plugins/axis2/geronimo-axis2/src/main/java/org/apache/geronimo/axis2/pojo/POJOProviderDispatcher.java
Tue Oct  7 08:55:58 2008
@@ -0,0 +1,41 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *      
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.geronimo.axis2.pojo;
+
+import javax.xml.ws.handler.soap.SOAPMessageContext;
+
+import org.apache.axis2.jaxws.context.utils.ContextUtils;
+import org.apache.axis2.jaxws.core.MessageContext;
+import org.apache.axis2.jaxws.server.dispatcher.ProviderDispatcher;
+
+public class POJOProviderDispatcher extends ProviderDispatcher {   
+
+    public POJOProviderDispatcher(Class serviceClass, Object instance) {
+        super(serviceClass, instance);
+    }
+
+    @Override
+    protected void initialize(MessageContext mc) {
+        super.initialize(mc);    
+        
+        SOAPMessageContext soapMC = (SOAPMessageContext)POJOWebServiceContext.get().getMessageContext();
+        ContextUtils.addWSDLProperties_provider(mc, soapMC);
+    }
+    
+}

Propchange: geronimo/server/trunk/plugins/axis2/geronimo-axis2/src/main/java/org/apache/geronimo/axis2/pojo/POJOProviderDispatcher.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/server/trunk/plugins/axis2/geronimo-axis2/src/main/java/org/apache/geronimo/axis2/pojo/POJOProviderDispatcher.java
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: geronimo/server/trunk/plugins/axis2/geronimo-axis2/src/main/java/org/apache/geronimo/axis2/pojo/POJOProviderDispatcher.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: geronimo/server/trunk/plugins/axis2/geronimo-axis2/src/main/java/org/apache/geronimo/axis2/pojo/POJOServiceDispatcher.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/axis2/geronimo-axis2/src/main/java/org/apache/geronimo/axis2/pojo/POJOServiceDispatcher.java?rev=702526&view=auto
==============================================================================
--- geronimo/server/trunk/plugins/axis2/geronimo-axis2/src/main/java/org/apache/geronimo/axis2/pojo/POJOServiceDispatcher.java
(added)
+++ geronimo/server/trunk/plugins/axis2/geronimo-axis2/src/main/java/org/apache/geronimo/axis2/pojo/POJOServiceDispatcher.java
Tue Oct  7 08:55:58 2008
@@ -0,0 +1,41 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *      
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.geronimo.axis2.pojo;
+
+import javax.xml.ws.handler.soap.SOAPMessageContext;
+
+import org.apache.axis2.jaxws.context.utils.ContextUtils;
+import org.apache.axis2.jaxws.core.MessageContext;
+import org.apache.axis2.jaxws.server.dispatcher.JavaBeanDispatcher;
+
+public class POJOServiceDispatcher extends JavaBeanDispatcher {
+
+    public POJOServiceDispatcher(Class serviceClass, Object instance) {
+        super(serviceClass, instance);
+    }
+
+    @Override
+    protected void initialize(MessageContext mc) {
+        super.initialize(mc);    
+        
+        SOAPMessageContext soapMC = (SOAPMessageContext)POJOWebServiceContext.get().getMessageContext();
+        ContextUtils.addWSDLProperties(mc, soapMC);
+    }
+ 
+}

Propchange: geronimo/server/trunk/plugins/axis2/geronimo-axis2/src/main/java/org/apache/geronimo/axis2/pojo/POJOServiceDispatcher.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/server/trunk/plugins/axis2/geronimo-axis2/src/main/java/org/apache/geronimo/axis2/pojo/POJOServiceDispatcher.java
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: geronimo/server/trunk/plugins/axis2/geronimo-axis2/src/main/java/org/apache/geronimo/axis2/pojo/POJOServiceDispatcher.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Modified: geronimo/server/trunk/plugins/axis2/geronimo-axis2/src/main/java/org/apache/geronimo/axis2/pojo/POJOWebServiceContainer.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/axis2/geronimo-axis2/src/main/java/org/apache/geronimo/axis2/pojo/POJOWebServiceContainer.java?rev=702526&r1=702525&r2=702526&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/axis2/geronimo-axis2/src/main/java/org/apache/geronimo/axis2/pojo/POJOWebServiceContainer.java
(original)
+++ geronimo/server/trunk/plugins/axis2/geronimo-axis2/src/main/java/org/apache/geronimo/axis2/pojo/POJOWebServiceContainer.java
Tue Oct  7 08:55:58 2008
@@ -30,6 +30,7 @@
 import org.apache.axis2.description.AxisService;
 import org.apache.axis2.engine.Handler.InvocationResponse;
 import org.apache.axis2.jaxws.registry.FactoryRegistry;
+import org.apache.axis2.jaxws.server.dispatcher.factory.EndpointDispatcherFactory;
 import org.apache.axis2.jaxws.server.endpoint.lifecycle.factory.EndpointLifecycleManagerFactory;
 import org.apache.axis2.transport.http.HTTPConstants;
 import org.apache.axis2.transport.http.HTTPTransportReceiver;
@@ -70,11 +71,16 @@
         super.init();
         
         /*
-         * This replaces EndpointLifecycleManagerFactory for all web services.
-         * This should be ok as we do our own endpoint instance management and injection.
      
+         * This replaces EndpointLifecycleManagerFactory and EndpointDispatcherFactory
+         * for all web services. This is because we do our own endpoint instance management

+         * and injection. 
+         * This does not affect EJB web services as the EJB container does not use the FactoryRegistry
+         * to lookup the EndpointLifecycleManagerFactory or EndpointDispatcherFactory.
          */
         FactoryRegistry.setFactory(EndpointLifecycleManagerFactory.class, 
                                    new POJOEndpointLifecycleManagerFactory());
+        FactoryRegistry.setFactory(EndpointDispatcherFactory.class, 
+                                   new POJOEndpointDispatcherFactory());
                                       
         String servicePath = trimContext(getServicePath(this.contextRoot));
         this.configurationContext.setServicePath(servicePath);

Modified: geronimo/server/trunk/plugins/axis2/geronimo-axis2/src/main/java/org/apache/geronimo/axis2/pojo/POJOWebServiceContext.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/axis2/geronimo-axis2/src/main/java/org/apache/geronimo/axis2/pojo/POJOWebServiceContext.java?rev=702526&r1=702525&r2=702526&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/axis2/geronimo-axis2/src/main/java/org/apache/geronimo/axis2/pojo/POJOWebServiceContext.java
(original)
+++ geronimo/server/trunk/plugins/axis2/geronimo-axis2/src/main/java/org/apache/geronimo/axis2/pojo/POJOWebServiceContext.java
Tue Oct  7 08:55:58 2008
@@ -66,10 +66,14 @@
         return (wsContext == null) ? null : wsContext.getEndpointReference(clazz, referenceParameters);
     }
     
+    static WebServiceContextImpl get() {
+        return context.get();
+    }
+    
     static void set(WebServiceContextImpl ctx) {
         context.set(ctx);
     }
-
+    
     static void clear() {
         context.set(null);
     }



Mime
View raw message