Return-Path: Delivered-To: apmail-geronimo-scm-archive@www.apache.org Received: (qmail 8357 invoked from network); 7 Oct 2008 15:56:20 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 7 Oct 2008 15:56:20 -0000 Received: (qmail 23382 invoked by uid 500); 7 Oct 2008 15:56:19 -0000 Delivered-To: apmail-geronimo-scm-archive@geronimo.apache.org Received: (qmail 23370 invoked by uid 500); 7 Oct 2008 15:56:19 -0000 Mailing-List: contact scm-help@geronimo.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: List-Post: Reply-To: dev@geronimo.apache.org List-Id: Delivered-To: mailing list scm@geronimo.apache.org Received: (qmail 23361 invoked by uid 99); 7 Oct 2008 15:56:19 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 07 Oct 2008 08:56:19 -0700 X-ASF-Spam-Status: No, hits=-1999.9 required=10.0 tests=ALL_TRUSTED,DNS_FROM_SECURITYSAGE X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 07 Oct 2008 15:55:23 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 64EA623888CA; Tue, 7 Oct 2008 08:55:59 -0700 (PDT) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit 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 -0000 To: scm@geronimo.apache.org From: gawor@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20081007155559.64EA623888CA@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org 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); }