You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by pr...@apache.org on 2008/02/17 11:32:47 UTC
svn commit: r628471 - in /webservices/axis2/trunk/java/modules:
jaxws/src/org/apache/axis2/jaxws/
jaxws/src/org/apache/axis2/jaxws/addressing/
jaxws/src/org/apache/axis2/jaxws/addressing/factory/
jaxws/src/org/apache/axis2/jaxws/addressing/factory/impl...
Author: pradine
Date: Sun Feb 17 02:32:45 2008
New Revision: 628471
URL: http://svn.apache.org/viewvc?rev=628471&view=rev
Log:
Various JAX-WS 2.1 related improvements.
Added:
webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/Constants.java (with props)
webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/addressing/factory/impl/
webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/addressing/factory/impl/Axis2EndpointReferenceFactoryImpl.java
- copied, changed from r628167, webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/addressing/factory/Axis2EndpointReferenceFactoryImpl.java
webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/addressing/factory/impl/JAXWSEndpointReferenceFactoryImpl.java
- copied, changed from r628167, webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/addressing/factory/JAXWSEndpointReferenceFactoryImpl.java
webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/addressing/migrator/
webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/addressing/migrator/EndpointContextMapMigrator.java (with props)
webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/addressing/util/EndpointContextMap.java (with props)
webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/addressing/util/EndpointContextMapManager.java (with props)
Removed:
webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/addressing/factory/Axis2EndpointReferenceFactoryImpl.java
webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/addressing/factory/JAXWSEndpointReferenceFactoryImpl.java
webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/addressing/util/EndpointMap.java
webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/addressing/util/EndpointMapManager.java
Modified:
webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/addressing/SubmissionEndpointReferenceBuilder.java
webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/addressing/factory/Axis2EndpointReferenceFactory.java
webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/addressing/factory/JAXWSEndpointReferenceFactory.java
webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/addressing/util/EndpointKey.java
webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/addressing/util/EndpointReferenceUtils.java
webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/registry/ClientConfiguratorRegistry.java
webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/registry/FactoryRegistry.java
webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/server/EndpointController.java
webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/spi/Provider.java
webservices/axis2/trunk/java/modules/metadata/src/org/apache/axis2/jaxws/feature/ServerFramework.java
Added: webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/Constants.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/Constants.java?rev=628471&view=auto
==============================================================================
--- webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/Constants.java (added)
+++ webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/Constants.java Sun Feb 17 02:32:45 2008
@@ -0,0 +1,28 @@
+/*
+ * 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.axis2.jaxws;
+
+/**
+ * Constants that apply to the JAX-WS implementation.
+ *
+ */
+public interface Constants {
+ public static final String ENDPOINT_CONTEXT_MAP =
+ "org.apache.axis2.jaxws.addressing.util.EndpointContextMap";
+}
Propchange: webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/Constants.java
------------------------------------------------------------------------------
svn:eol-style = native
Modified: webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/addressing/SubmissionEndpointReferenceBuilder.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/addressing/SubmissionEndpointReferenceBuilder.java?rev=628471&r1=628470&r2=628471&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/addressing/SubmissionEndpointReferenceBuilder.java (original)
+++ webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/addressing/SubmissionEndpointReferenceBuilder.java Sun Feb 17 02:32:45 2008
@@ -28,6 +28,11 @@
import org.apache.axis2.jaxws.addressing.util.EndpointReferenceUtils;
import org.w3c.dom.Element;
+/**
+ * This class can be used to create instances of {@link SubmissionEndpointReference}.
+ *
+ * @see javax.xml.ws.wsaddressing.W3CEndpointReferenceBuilder
+ */
public final class SubmissionEndpointReferenceBuilder {
private static final Element[] ZERO_LENGTH_ARRAY = new Element[0];
@@ -38,19 +43,45 @@
private List<Element> referenceParameters;
private QName portType;
+ /**
+ * Constructor
+ *
+ */
public SubmissionEndpointReferenceBuilder() {
}
+ /**
+ * Add the address URI to use.
+ *
+ * @param address the address URI
+ * @return an instance of <code>SubmissionEndpointReferenceBuilder</code> that has
+ * been updated as specified.
+ */
public SubmissionEndpointReferenceBuilder address(String address) {
this.address = address;
return this;
}
+ /**
+ * Add the WSDL service name of the endpoint that the endpoint reference will target.
+ *
+ * @param serviceName the WSDL service name
+ * @return an instance of <code>SubmissionEndpointReferenceBuilder</code> that has
+ * been updated as specified.
+ */
public SubmissionEndpointReferenceBuilder serviceName(QName serviceName) {
this.serviceName = serviceName;
return this;
}
+ /**
+ * Add the WSDL port name of the endpoint that the endpoint reference will target.
+ * The WSDL port name can only be set after the WSDL service name has been set.
+ *
+ * @param endpointName the WSDL port name
+ * @return an instance of <code>SubmissionEndpointReferenceBuilder</code> that has
+ * been updated as specified.
+ */
public SubmissionEndpointReferenceBuilder endpointName(QName endpointName) {
//TODO NLS enable
if (this.serviceName == null) {
@@ -61,11 +92,27 @@
return this;
}
+ /**
+ * Add the URI from where the WSDL for the endpoint that the endpoint reference will
+ * target can be retrieved.
+ *
+ * @param wsdlDocumentLocation the location URI of the WSDL
+ * @return an instance of <code>SubmissionEndpointReferenceBuilder</code> that has
+ * been updated as specified.
+ */
public SubmissionEndpointReferenceBuilder wsdlDocumentLocation(String wsdlDocumentLocation) {
this.wsdlDocumentLocation = wsdlDocumentLocation;
return this;
}
+ /**
+ * Add reference properties. These will appear in the endpoint reference as reference
+ * parameters.
+ *
+ * @param referenceProperty the reference property
+ * @return an instance of <code>SubmissionEndpointReferenceBuilder</code> that has
+ * been updated as specified.
+ */
public SubmissionEndpointReferenceBuilder referenceProperty(Element referenceProperty) {
//TODO NLS enable
if (referenceProperty == null) {
@@ -80,6 +127,13 @@
return this;
}
+ /**
+ * Add reference parameters.
+ *
+ * @param referenceParameter the reference parameter
+ * @return an instance of <code>SubmissionEndpointReferenceBuilder</code> that has
+ * been updated as specified.
+ */
public SubmissionEndpointReferenceBuilder referenceParameter(Element referenceParameter) {
//TODO NLS enable
if (referenceParameter == null) {
@@ -94,11 +148,24 @@
return this;
}
+ /**
+ * Add the name of the WSDL port type.
+ *
+ * @param portType the WSDL port type name
+ * @return an instance of <code>SubmissionEndpointReferenceBuilder</code> that has
+ * been updated as specified.
+ */
public SubmissionEndpointReferenceBuilder portType(QName portType) {
this.portType = portType;
return this;
}
+ /**
+ * Construct an instance of <code>EndpointReference</code> based on the values
+ * specified.
+ *
+ * @return an instance of <code>SubmissionEndpointReference</code>
+ */
public SubmissionEndpointReference build() {
SubmissionEndpointReference submissionEPR = null;
@@ -108,8 +175,11 @@
EndpointReferenceUtils.createAxis2EndpointReference(address, serviceName, endpointName, wsdlDocumentLocation, addressingNamespace);
try {
- EndpointReferenceUtils.addReferenceParameters(axis2EPR, referenceParameters.toArray(ZERO_LENGTH_ARRAY));
- EndpointReferenceUtils.addInterface(axis2EPR, portType, InterfaceName.subQName);
+ if (referenceParameters != null)
+ EndpointReferenceUtils.addReferenceParameters(axis2EPR, referenceParameters.toArray(ZERO_LENGTH_ARRAY));
+
+ if (portType != null)
+ EndpointReferenceUtils.addInterface(axis2EPR, portType, InterfaceName.subQName);
submissionEPR =
(SubmissionEndpointReference) EndpointReferenceUtils.convertFromAxis2(axis2EPR, addressingNamespace);
Modified: webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/addressing/factory/Axis2EndpointReferenceFactory.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/addressing/factory/Axis2EndpointReferenceFactory.java?rev=628471&r1=628470&r2=628471&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/addressing/factory/Axis2EndpointReferenceFactory.java (original)
+++ webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/addressing/factory/Axis2EndpointReferenceFactory.java Sun Feb 17 02:32:45 2008
@@ -4,10 +4,47 @@
import org.apache.axis2.addressing.EndpointReference;
+/**
+ * This class represents factories that can be use to create instances of
+ * {@link EndpointReference} that can ultimately be converted into instances
+ * of {@link javax.xml.ws.EndpointReference} that are suitable to be returned
+ * via the appropriate JAX-WS 2.1 API methods.
+ *
+ */
public interface Axis2EndpointReferenceFactory {
+ /**
+ * Create an instance of <code>EndpointReference</code> with the specified address.
+ *
+ * @param address the address URI to use. It cannot be null.
+ * @return an instance of <code>EndpointReference</code>.
+ */
public EndpointReference createEndpointReference(String address);
+ /**
+ * Create an instance of <code>EndpointReference</code> that targets the endpoint
+ * identified by the specified WSDL service name and endpoint name.
+ *
+ * @param serviceName the WSDL service name
+ * @param endpoint the WSDL port name
+ * @return an instance of <code>EndpointReference</code> that targets the specified
+ * endpoint
+ */
public EndpointReference createEndpointReference(QName serviceName, QName endpoint);
+ /**
+ * Create an instance of <code>EndpointReference</code>. If the address is specified
+ * then it will be used. If the address is null, but the WSDL service name and port
+ * name are specified then they will be used to target the specified endpoint. Either
+ * the address URI, or the WSDL service name and port name must be specified.
+ *
+ * @param address the address URI to use, if specified
+ * @param serviceName the WSDL service name, if specified
+ * @param portName the WSDL port name, if specified
+ * @param wsdlDocumentLocation the URI from where the WSDL for the endpoint can be
+ * retrieved, if specified.
+ * @param addressingNamespace the intended WS-Addressing namespace that the <code>
+ * EndpointRefence</code> should comply with.
+ * @return an instance of <code>EndpointReference</code>.
+ */
public EndpointReference createEndpointReference(String address, QName serviceName, QName portName, String wsdlDocumentLocation, String addressingNamespace);
}
Modified: webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/addressing/factory/JAXWSEndpointReferenceFactory.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/addressing/factory/JAXWSEndpointReferenceFactory.java?rev=628471&r1=628470&r2=628471&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/addressing/factory/JAXWSEndpointReferenceFactory.java (original)
+++ webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/addressing/factory/JAXWSEndpointReferenceFactory.java Sun Feb 17 02:32:45 2008
@@ -22,8 +22,25 @@
import javax.xml.transform.Source;
import javax.xml.ws.EndpointReference;
+/**
+ * This class represents factories that can be used to generate instances of the
+ * {@link EndpointReference}.
+ */
public interface JAXWSEndpointReferenceFactory {
+ /**
+ * Create an instance of a supported subclass of <code>EndpointReference</code>.
+ *
+ * @param eprInfoset the endpoint reference
+ * @return an instance of <code>EndpointReference</code>.
+ * @throws JAXBException
+ */
public EndpointReference createEndpointReference(Source eprInfoset) throws JAXBException;
+ /**
+ * Map the specified class to a supported WS-Addressing namespace.
+ *
+ * @param clazz the class.
+ * @return the WS-Addressing namespace that is associated with the class.
+ */
public String getAddressingNamespace(Class clazz);
}
Copied: webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/addressing/factory/impl/Axis2EndpointReferenceFactoryImpl.java (from r628167, webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/addressing/factory/Axis2EndpointReferenceFactoryImpl.java)
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/addressing/factory/impl/Axis2EndpointReferenceFactoryImpl.java?p2=webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/addressing/factory/impl/Axis2EndpointReferenceFactoryImpl.java&p1=webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/addressing/factory/Axis2EndpointReferenceFactoryImpl.java&r1=628167&r2=628471&rev=628471&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/addressing/factory/Axis2EndpointReferenceFactoryImpl.java (original)
+++ webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/addressing/factory/impl/Axis2EndpointReferenceFactoryImpl.java Sun Feb 17 02:32:45 2008
@@ -16,7 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
-package org.apache.axis2.jaxws.addressing.factory;
+package org.apache.axis2.jaxws.addressing.factory.impl;
import java.net.URL;
@@ -27,32 +27,49 @@
import org.apache.axis2.addressing.metadata.ServiceName;
import org.apache.axis2.addressing.metadata.WSDLLocation;
import org.apache.axis2.jaxws.ExceptionFactory;
+import org.apache.axis2.jaxws.addressing.factory.Axis2EndpointReferenceFactory;
import org.apache.axis2.jaxws.addressing.util.EndpointKey;
-import org.apache.axis2.jaxws.addressing.util.EndpointMap;
-import org.apache.axis2.jaxws.addressing.util.EndpointMapManager;
+import org.apache.axis2.jaxws.addressing.util.EndpointContextMap;
+import org.apache.axis2.jaxws.addressing.util.EndpointContextMapManager;
import org.apache.axis2.jaxws.util.WSDL4JWrapper;
import org.apache.axis2.jaxws.util.WSDLWrapper;
+/**
+ * This class produces instances of {@link EndpointReference}.
+ *
+ */
public class Axis2EndpointReferenceFactoryImpl implements Axis2EndpointReferenceFactory {
public Axis2EndpointReferenceFactoryImpl() {
super();
}
+ /*
+ * (non-Javadoc)
+ * @see org.apache.axis2.jaxws.addressing.factory.Axis2EndpointReferenceFactory#createEndpointReference(java.lang.String)
+ */
public EndpointReference createEndpointReference(String address) {
if (address == null)
throw new IllegalStateException("The endpoint address URI is null.");
return new EndpointReference(address);
}
-
+
+ /*
+ * (non-Javadoc)
+ * @see org.apache.axis2.jaxws.addressing.factory.Axis2EndpointReferenceFactory#createEndpointReference(javax.xml.namespace.QName, javax.xml.namespace.QName)
+ */
public EndpointReference createEndpointReference(QName serviceName, QName endpoint) {
EndpointKey key = new EndpointKey(serviceName, endpoint);
- EndpointMap map = EndpointMapManager.getEndpointMap();
- String address = map.get(key);
+ EndpointContextMap map = EndpointContextMapManager.getEndpointContextMap();
+ String address = (String) map.get(key);
return createEndpointReference(address);
}
-
+
+ /*
+ * (non-Javadoc)
+ * @see org.apache.axis2.jaxws.addressing.factory.Axis2EndpointReferenceFactory#createEndpointReference(java.lang.String, javax.xml.namespace.QName, javax.xml.namespace.QName, java.lang.String, java.lang.String)
+ */
public EndpointReference createEndpointReference(String address, QName serviceName, QName portName, String wsdlDocumentLocation, String addressingNamespace) {
EndpointReference axis2EPR = null;
@@ -71,10 +88,13 @@
throw new IllegalStateException("Cannot create an endpoint reference because the address, service name, and/or port name are null.");
}
+ //TODO If no service name and port name are specified, but the wsdl location is
+ //specified, and the WSDL only contains one service and one port then maybe we
+ //should simply use those.
try {
- //TODO If no service name and port name are specified, but the wsdl location is
- //specified, and the WSDL only contains one service and one port then maybe we
- //should simply use those.
+ //This code is locate here instead of in the createEndpointReference(QName, QName)
+ //method so that if the address is also specified the EPR metadata will still be
+ //filled in correctly.
if (serviceName != null && portName != null) {
ServiceName service = new ServiceName(serviceName, portName.getLocalPart());
EndpointReferenceHelper.setServiceNameMetadata(axis2EPR, addressingNamespace, service);
@@ -103,7 +123,7 @@
}
}
- //TODO NLS
+ //TODO NLS enable
if (!found)
throw new IllegalStateException("The specified port name does not exist in the specified WSDL service.");
}
Copied: webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/addressing/factory/impl/JAXWSEndpointReferenceFactoryImpl.java (from r628167, webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/addressing/factory/JAXWSEndpointReferenceFactoryImpl.java)
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/addressing/factory/impl/JAXWSEndpointReferenceFactoryImpl.java?p2=webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/addressing/factory/impl/JAXWSEndpointReferenceFactoryImpl.java&p1=webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/addressing/factory/JAXWSEndpointReferenceFactoryImpl.java&r1=628167&r2=628471&rev=628471&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/addressing/factory/JAXWSEndpointReferenceFactoryImpl.java (original)
+++ webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/addressing/factory/impl/JAXWSEndpointReferenceFactoryImpl.java Sun Feb 17 02:32:45 2008
@@ -16,7 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
-package org.apache.axis2.jaxws.addressing.factory;
+package org.apache.axis2.jaxws.addressing.factory.impl;
import javax.xml.bind.JAXBContext;
import javax.xml.bind.JAXBException;
@@ -30,10 +30,21 @@
import org.apache.axis2.addressing.AddressingConstants.Submission;
import org.apache.axis2.jaxws.ExceptionFactory;
import org.apache.axis2.jaxws.addressing.SubmissionEndpointReference;
+import org.apache.axis2.jaxws.addressing.factory.JAXWSEndpointReferenceFactory;
+/**
+ * This class is used to generate instances of the following subclasses of
+ * {@link EndpointReference}.
+ *
+ * @see javax.xml.ws.wsaddressing.W3CEndpointReference
+ * @see org.apache.axis2.jaxws.addressing.SubmissionEndpointReference
+ */
public class JAXWSEndpointReferenceFactoryImpl implements JAXWSEndpointReferenceFactory {
private JAXBContext jaxbContext;
+ /**
+ * Constructor
+ */
public JAXWSEndpointReferenceFactoryImpl() {
super();
@@ -47,12 +58,19 @@
}
}
+ /*
+ * (non-Javadoc)
+ * @see org.apache.axis2.jaxws.addressing.factory.JAXWSEndpointReferenceFactory#createEndpointReference(javax.xml.transform.Source)
+ */
public EndpointReference createEndpointReference(Source eprInfoset) throws JAXBException {
Unmarshaller um = jaxbContext.createUnmarshaller();
-
return (EndpointReference) um.unmarshal(eprInfoset);
}
+ /*
+ * (non-Javadoc)
+ * @see org.apache.axis2.jaxws.addressing.factory.JAXWSEndpointReferenceFactory#getAddressingNamespace(java.lang.Class)
+ */
public String getAddressingNamespace(Class clazz) {
String addressingNamespace = null;
Added: webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/addressing/migrator/EndpointContextMapMigrator.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/addressing/migrator/EndpointContextMapMigrator.java?rev=628471&view=auto
==============================================================================
--- webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/addressing/migrator/EndpointContextMapMigrator.java (added)
+++ webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/addressing/migrator/EndpointContextMapMigrator.java Sun Feb 17 02:32:45 2008
@@ -0,0 +1,118 @@
+/*
+ * 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.axis2.jaxws.addressing.migrator;
+
+import org.apache.axis2.AxisFault;
+import org.apache.axis2.context.MessageContext;
+import org.apache.axis2.description.AxisOperation;
+import org.apache.axis2.description.Parameter;
+import org.apache.axis2.engine.AxisConfiguration;
+import org.apache.axis2.jaxws.Constants;
+import org.apache.axis2.jaxws.ExceptionFactory;
+import org.apache.axis2.jaxws.addressing.util.EndpointContextMap;
+import org.apache.axis2.jaxws.addressing.util.EndpointContextMapManager;
+import org.apache.axis2.util.ThreadContextMigrator;
+import org.apache.axis2.util.Utils;
+import org.apache.axis2.wsdl.WSDLConstants;
+
+/**
+ * This class will enable the JAX-WS 2.1 API methods to create instances of
+ * {@link javax.xml.ws.EndpointReference} that target a particular web service
+ * endpoint, identified by specifying the WSDL service name and port name of the
+ * endpoint, to work correctly. This is achieved by enabling the implementation of
+ * {@link org.apache.axis2.jaxws.addressing.factory.Axis2EndpointReferenceFactory}
+ * to retrieve the context it needs from the invoking thread. The instances of
+ * {@link org.apache.axis2.addressing.EndpointReference} that it produces can
+ * then converted to instances of {@link javax.xml.ws.EndpointReference}, as
+ * needed.
+ *
+ */
+public class EndpointContextMapMigrator implements ThreadContextMigrator {
+
+ /* (non-Javadoc)
+ * @see org.apache.axis2.util.ThreadContextMigrator#migrateContextToThread(org.apache.axis2.context.MessageContext)
+ */
+ public void migrateContextToThread(MessageContext messageContext)
+ throws AxisFault {
+ //Only make the context map available if we have an inbound request
+ //message, in the server.
+ AxisOperation axisOperation = messageContext.getAxisOperation();
+ String mep = axisOperation.getMessageExchangePattern();
+ int mepConstant = Utils.getAxisSpecifMEPConstant(mep);
+
+ if (mepConstant == WSDLConstants.MEP_CONSTANT_IN_ONLY ||
+ mepConstant == WSDLConstants.MEP_CONSTANT_IN_OUT ||
+ mepConstant == WSDLConstants.MEP_CONSTANT_IN_OPTIONAL_OUT ||
+ mepConstant == WSDLConstants.MEP_CONSTANT_ROBUST_IN_ONLY)
+ {
+ AxisConfiguration axisConfig = axisOperation.getAxisConfiguration();
+ Parameter param = axisConfig.getParameter(Constants.ENDPOINT_CONTEXT_MAP);
+
+ if (param != null) {
+ EndpointContextMap map = (EndpointContextMap) param.getValue();
+
+ if (map != null) {
+ EndpointContextMapManager.setEndpointContextMap(map);
+ }
+ else {
+ //TODO NLS enable.
+ throw ExceptionFactory.makeWebServiceException("The endpoint context map is null.");
+ }
+ }
+ else {
+ //TODO NLS enable.
+ throw ExceptionFactory.makeWebServiceException("Unable to locate endpoint context map.");
+ }
+ }
+ }
+
+ /* (non-Javadoc)
+ * @see org.apache.axis2.util.ThreadContextMigrator#cleanupThread(org.apache.axis2.context.MessageContext)
+ */
+ public void cleanupThread(MessageContext messageContext) {
+ //Only clean up if we are inbound to the server.
+ AxisOperation axisOperation = messageContext.getAxisOperation();
+ String mep = axisOperation.getMessageExchangePattern();
+ int mepConstant = Utils.getAxisSpecifMEPConstant(mep);
+
+ if (mepConstant == WSDLConstants.MEP_CONSTANT_IN_ONLY ||
+ mepConstant == WSDLConstants.MEP_CONSTANT_IN_OUT ||
+ mepConstant == WSDLConstants.MEP_CONSTANT_IN_OPTIONAL_OUT ||
+ mepConstant == WSDLConstants.MEP_CONSTANT_ROBUST_IN_ONLY)
+ {
+ EndpointContextMapManager.setEndpointContextMap(null);
+ }
+ }
+
+ /* (non-Javadoc)
+ * @see org.apache.axis2.util.ThreadContextMigrator#migrateThreadToContext(org.apache.axis2.context.MessageContext)
+ */
+ public void migrateThreadToContext(MessageContext messageContext)
+ throws AxisFault {
+ //Nothing to do.
+ }
+
+ /* (non-Javadoc)
+ * @see org.apache.axis2.util.ThreadContextMigrator#cleanupContext(org.apache.axis2.context.MessageContext)
+ */
+ public void cleanupContext(MessageContext messageContext) {
+ //Nothing to do.
+ }
+
+}
Propchange: webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/addressing/migrator/EndpointContextMapMigrator.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/addressing/util/EndpointContextMap.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/addressing/util/EndpointContextMap.java?rev=628471&view=auto
==============================================================================
--- webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/addressing/util/EndpointContextMap.java (added)
+++ webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/addressing/util/EndpointContextMap.java Sun Feb 17 02:32:45 2008
@@ -0,0 +1,38 @@
+/*
+ * 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.axis2.jaxws.addressing.util;
+
+import java.util.concurrent.ConcurrentHashMap;
+
+import org.apache.axis2.jaxws.addressing.util.EndpointKey;
+
+/**
+ * This class stores the context needed to correctly produce instances of
+ * {@link javax.xml.ws.EndpointReference} for a particular web service endpoint
+ * identified by an {@link EndpointKey}.
+ *
+ */
+public class EndpointContextMap extends ConcurrentHashMap<EndpointKey, Object> {
+
+ private static final long serialVersionUID = 694539734825500599L;
+
+ public EndpointContextMap() {
+ super();
+ }
+}
Propchange: webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/addressing/util/EndpointContextMap.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/addressing/util/EndpointContextMapManager.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/addressing/util/EndpointContextMapManager.java?rev=628471&view=auto
==============================================================================
--- webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/addressing/util/EndpointContextMapManager.java (added)
+++ webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/addressing/util/EndpointContextMapManager.java Sun Feb 17 02:32:45 2008
@@ -0,0 +1,50 @@
+/*
+ * 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.axis2.jaxws.addressing.util;
+
+/**
+ * This class is used to manage the association between an {@link EndpointContextMap}
+ * and a thread.
+ */
+public class EndpointContextMapManager {
+ private static ThreadLocal<EndpointContextMap> variable =
+ new InheritableThreadLocal<EndpointContextMap>();
+
+ public static EndpointContextMap setEndpointContextMap(EndpointContextMap newMap) {
+ EndpointContextMap oldMap = variable.get();
+ variable.set(newMap);
+
+ return oldMap;
+ }
+
+ public static EndpointContextMap getEndpointContextMap() {
+ EndpointContextMap currentMap = variable.get();
+
+ if (currentMap == null) {
+ currentMap = getDefaultEndpointMap();
+ setEndpointContextMap(currentMap);
+ }
+
+ return currentMap;
+ }
+
+ private static EndpointContextMap getDefaultEndpointMap() {
+ return new EndpointContextMap();
+ }
+}
Propchange: webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/addressing/util/EndpointContextMapManager.java
------------------------------------------------------------------------------
svn:eol-style = native
Modified: webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/addressing/util/EndpointKey.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/addressing/util/EndpointKey.java?rev=628471&r1=628470&r2=628471&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/addressing/util/EndpointKey.java (original)
+++ webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/addressing/util/EndpointKey.java Sun Feb 17 02:32:45 2008
@@ -20,6 +20,11 @@
import javax.xml.namespace.QName;
+/**
+ * This class is used to identify a particular web service endpoint based on
+ * the combination of WSDL service name and port name.
+ *
+ */
public class EndpointKey {
private final QName service;
private final QName endpoint;
Modified: webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/addressing/util/EndpointReferenceUtils.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/addressing/util/EndpointReferenceUtils.java?rev=628471&r1=628470&r2=628471&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/addressing/util/EndpointReferenceUtils.java (original)
+++ webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/addressing/util/EndpointReferenceUtils.java Sun Feb 17 02:32:45 2008
@@ -41,10 +41,6 @@
public final class EndpointReferenceUtils {
private static OMFactory omFactory = OMAbstractFactory.getOMFactory();
- private static JAXWSEndpointReferenceFactory jaxwsEPRFactory =
- (JAXWSEndpointReferenceFactory) FactoryRegistry.getFactory(JAXWSEndpointReferenceFactory.class);
- private static Axis2EndpointReferenceFactory axis2EPRFactory =
- (Axis2EndpointReferenceFactory) FactoryRegistry.getFactory(Axis2EndpointReferenceFactory.class);
private EndpointReferenceUtils() {
}
@@ -66,8 +62,10 @@
EndpointReferenceHelper.toOM(omFactory, axis2EPR, qname, addressingNamespace);
Element eprElement = XMLUtils.toDOM(omElement);
Source eprInfoset = new DOMSource(eprElement);
+ JAXWSEndpointReferenceFactory factory = (JAXWSEndpointReferenceFactory)
+ FactoryRegistry.getFactory(JAXWSEndpointReferenceFactory.class);
- return jaxwsEPRFactory.createEndpointReference(eprInfoset);
+ return factory.createEndpointReference(eprInfoset);
}
/**
@@ -82,7 +80,10 @@
*/
public static javax.xml.ws.EndpointReference convertFromSource(Source eprInfoset)
throws Exception {
- return jaxwsEPRFactory.createEndpointReference(eprInfoset);
+ JAXWSEndpointReferenceFactory factory = (JAXWSEndpointReferenceFactory)
+ FactoryRegistry.getFactory(JAXWSEndpointReferenceFactory.class);
+
+ return factory.createEndpointReference(eprInfoset);
}
/**
@@ -105,15 +106,24 @@
}
public static String getAddressingNamespace(Class clazz) {
- return jaxwsEPRFactory.getAddressingNamespace(clazz);
+ JAXWSEndpointReferenceFactory factory = (JAXWSEndpointReferenceFactory)
+ FactoryRegistry.getFactory(JAXWSEndpointReferenceFactory.class);
+
+ return factory.getAddressingNamespace(clazz);
}
public static EndpointReference createAxis2EndpointReference(String address, QName serviceName, QName portName, String wsdlDocumentLocation, String addressingNamespace) {
- return axis2EPRFactory.createEndpointReference(address, serviceName, portName, wsdlDocumentLocation, addressingNamespace);
+ Axis2EndpointReferenceFactory factory = (Axis2EndpointReferenceFactory)
+ FactoryRegistry.getFactory(Axis2EndpointReferenceFactory.class);
+
+ return factory.createEndpointReference(address, serviceName, portName, wsdlDocumentLocation, addressingNamespace);
}
public static EndpointReference createAxis2EndpointReference(String address) {
- return axis2EPRFactory.createEndpointReference(address);
+ Axis2EndpointReferenceFactory factory = (Axis2EndpointReferenceFactory)
+ FactoryRegistry.getFactory(Axis2EndpointReferenceFactory.class);
+
+ return factory.createEndpointReference(address);
}
public static void addReferenceParameters(EndpointReference axis2EPR, Element...referenceParameters)
@@ -140,8 +150,7 @@
throws Exception {
if (portType != null) {
InterfaceName interfaceName = new InterfaceName(portType);
- OMFactory factory = OMAbstractFactory.getOMFactory();
- OMElement omElement = interfaceName.toOM(interfaceType, factory);
+ OMElement omElement = interfaceName.toOM(interfaceType, omFactory);
axis2EPR.addExtensibleElement(omElement);
}
}
Modified: webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/registry/ClientConfiguratorRegistry.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/registry/ClientConfiguratorRegistry.java?rev=628471&r1=628470&r2=628471&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/registry/ClientConfiguratorRegistry.java (original)
+++ webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/registry/ClientConfiguratorRegistry.java Sun Feb 17 02:32:45 2008
@@ -18,9 +18,9 @@
*/
package org.apache.axis2.jaxws.registry;
-import java.util.HashMap;
import java.util.Map;
import java.util.Set;
+import java.util.concurrent.ConcurrentHashMap;
import javax.xml.ws.RespectBindingFeature;
import javax.xml.ws.soap.AddressingFeature;
@@ -34,7 +34,7 @@
public class ClientConfiguratorRegistry {
private static Map<String, ClientConfigurator> map =
- new HashMap<String, ClientConfigurator>();
+ new ConcurrentHashMap<String, ClientConfigurator>();
static {
map.put(AddressingFeature.ID, new AddressingConfigurator());
Modified: webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/registry/FactoryRegistry.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/registry/FactoryRegistry.java?rev=628471&r1=628470&r2=628471&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/registry/FactoryRegistry.java (original)
+++ webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/registry/FactoryRegistry.java Sun Feb 17 02:32:45 2008
@@ -20,9 +20,9 @@
package org.apache.axis2.jaxws.registry;
import org.apache.axis2.jaxws.addressing.factory.Axis2EndpointReferenceFactory;
-import org.apache.axis2.jaxws.addressing.factory.Axis2EndpointReferenceFactoryImpl;
import org.apache.axis2.jaxws.addressing.factory.JAXWSEndpointReferenceFactory;
-import org.apache.axis2.jaxws.addressing.factory.JAXWSEndpointReferenceFactoryImpl;
+import org.apache.axis2.jaxws.addressing.factory.impl.Axis2EndpointReferenceFactoryImpl;
+import org.apache.axis2.jaxws.addressing.factory.impl.JAXWSEndpointReferenceFactoryImpl;
import org.apache.axis2.jaxws.core.controller.InvocationControllerFactory;
import org.apache.axis2.jaxws.core.controller.impl.InvocationControllerFactoryImpl;
import org.apache.axis2.jaxws.handler.factory.HandlerInvokerFactory;
Modified: webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/server/EndpointController.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/server/EndpointController.java?rev=628471&r1=628470&r2=628471&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/server/EndpointController.java (original)
+++ webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/server/EndpointController.java Sun Feb 17 02:32:45 2008
@@ -26,8 +26,8 @@
import org.apache.axis2.java.security.AccessController;
import org.apache.axis2.jaxws.ExceptionFactory;
import org.apache.axis2.jaxws.addressing.util.EndpointKey;
-import org.apache.axis2.jaxws.addressing.util.EndpointMap;
-import org.apache.axis2.jaxws.addressing.util.EndpointMapManager;
+import org.apache.axis2.jaxws.addressing.util.EndpointContextMap;
+import org.apache.axis2.jaxws.addressing.util.EndpointContextMapManager;
import org.apache.axis2.jaxws.core.MessageContext;
import org.apache.axis2.jaxws.core.util.MessageContextUtils;
import org.apache.axis2.jaxws.description.DescriptionFactory;
@@ -405,10 +405,10 @@
Parameter param = axisSvc.getParameter(EndpointDescription.AXIS_SERVICE_PARAMETER);
EndpointDescription ed = (EndpointDescription)param.getValue();
- param = axisSvc.getParameter(EndpointMap.class.getCanonicalName());
+ param = axisSvc.getParameter(EndpointContextMap.class.getCanonicalName());
if(param != null) {
- EndpointMap map = (EndpointMap) param.getValue();
- EndpointMapManager.setEndpointMap(map);
+ EndpointContextMap map = (EndpointContextMap) param.getValue();
+ EndpointContextMapManager.setEndpointContextMap(map);
}
return ed;
@@ -436,16 +436,16 @@
QName endpoint = ed.getPortQName();
EndpointKey key = new EndpointKey(service, endpoint);
axisSvc = ed.getAxisService();
- Parameter param = axisSvc.getParameter(EndpointMap.class.getCanonicalName());
- EndpointMap map = null;
+ Parameter param = axisSvc.getParameter(EndpointContextMap.class.getCanonicalName());
+ EndpointContextMap map = null;
if (param == null) {
- map = EndpointMapManager.getEndpointMap();
- axisSvc.addParameter(EndpointMap.class.getCanonicalName(), map);
+ map = EndpointContextMapManager.getEndpointContextMap();
+ axisSvc.addParameter(EndpointContextMap.class.getCanonicalName(), map);
}
else {
- map = (EndpointMap) param.getValue();
- EndpointMapManager.setEndpointMap(map);
+ map = (EndpointContextMap) param.getValue();
+ EndpointContextMapManager.setEndpointContextMap(map);
}
map.put(key, axisSvc.getEPRs()[0]);
Modified: webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/spi/Provider.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/spi/Provider.java?rev=628471&r1=628470&r2=628471&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/spi/Provider.java (original)
+++ webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/spi/Provider.java Sun Feb 17 02:32:45 2008
@@ -74,8 +74,11 @@
W3CEndpointReference w3cEPR = null;
try {
- EndpointReferenceUtils.addMetadata(axis2EPR, metadata.toArray(ZERO_LENGTH_ARRAY));
- EndpointReferenceUtils.addReferenceParameters(axis2EPR, referenceParameters.toArray(ZERO_LENGTH_ARRAY));
+ if (metadata != null)
+ EndpointReferenceUtils.addMetadata(axis2EPR, metadata.toArray(ZERO_LENGTH_ARRAY));
+
+ if (referenceParameters != null)
+ EndpointReferenceUtils.addReferenceParameters(axis2EPR, referenceParameters.toArray(ZERO_LENGTH_ARRAY));
w3cEPR =
(W3CEndpointReference) EndpointReferenceUtils.convertFromAxis2(axis2EPR, addressingNamespace);
Modified: webservices/axis2/trunk/java/modules/metadata/src/org/apache/axis2/jaxws/feature/ServerFramework.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/metadata/src/org/apache/axis2/jaxws/feature/ServerFramework.java?rev=628471&r1=628470&r2=628471&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/metadata/src/org/apache/axis2/jaxws/feature/ServerFramework.java (original)
+++ webservices/axis2/trunk/java/modules/metadata/src/org/apache/axis2/jaxws/feature/ServerFramework.java Sun Feb 17 02:32:45 2008
@@ -25,7 +25,6 @@
import java.lang.annotation.Annotation;
import java.util.HashMap;
-import java.util.IdentityHashMap;
import java.util.Map;
public class ServerFramework {
@@ -48,8 +47,7 @@
if (annotation == null)
return false;
- WebServiceFeatureAnnotation wsfAnnotation =
- annotation.annotationType().getAnnotation(WebServiceFeatureAnnotation.class);
+ WebServiceFeatureAnnotation wsfAnnotation = getWebServiceFeatureAnnotation(annotation);
String id = null;
if (wsfAnnotation != null)
@@ -63,8 +61,7 @@
if (!isValid(annotation))
throw ExceptionFactory.makeWebServiceException("Invalid or unsupported WebServiceFeature annotation, " + annotation);
- WebServiceFeatureAnnotation wsfAnnotation =
- annotation.annotationType().getAnnotation(WebServiceFeatureAnnotation.class);
+ WebServiceFeatureAnnotation wsfAnnotation = getWebServiceFeatureAnnotation(annotation);
annotationMap.put(wsfAnnotation.id(), annotation);
}
@@ -79,11 +76,13 @@
public void configure(EndpointDescription endpointDescription) {
for (Annotation annotation : getAllAnnotations()) {
- WebServiceFeatureAnnotation wsfAnnotation =
- annotation.annotationType().getAnnotation(WebServiceFeatureAnnotation.class);
-
+ WebServiceFeatureAnnotation wsfAnnotation = getWebServiceFeatureAnnotation(annotation);
ServerConfigurator configurator = configuratorMap.get(wsfAnnotation.id());
configurator.configure(endpointDescription);
}
+ }
+
+ private WebServiceFeatureAnnotation getWebServiceFeatureAnnotation(Annotation annotation) {
+ return annotation.annotationType().getAnnotation(WebServiceFeatureAnnotation.class);
}
}
---------------------------------------------------------------------
To unsubscribe, e-mail: axis-cvs-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-cvs-help@ws.apache.org
Re: svn commit: r628471 - in /webservices/axis2/trunk/java/modules: jaxws/src/org/apache/axis2/jaxws/ jaxws/src/org/apache/axis2/jaxws/addressing/ jaxws/src/org/apache/axis2/jaxws/addressing/factory/ jaxws/src/org/apache/axis2/jaxws/addressing/factory/impl...
Posted by Brian De Pradine <PR...@uk.ibm.com>.
Sure. Old habits from when I was working on this in the branch.
Cheers
Brian DePradine
Web Services Development
IBM Hursley
External +44 (0) 1962 816319 Internal 246319
If you can't find the time to do it right the first time, where will you
find the time to do it again?
Davanum Srinivas <da...@gmail.com> wrote on 17/02/2008 14:31:36:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Brian,
>
> Could you please add a few bullet points next time? (just to get a
> quick flavor of what the checkin is all about).
>
> thanks,
> dims
>
> pradine@apache.org wrote:
> | Author: pradine
> | Date: Sun Feb 17 02:32:45 2008
> | New Revision: 628471
> |
> | URL: http://svn.apache.org/viewvc?rev=628471&view=rev
> | Log:
> | Various JAX-WS 2.1 related improvements.
> |
> | Added:
> |
>
webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/Constants.
> java (with props)
> |
>
webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/addressing/factory/impl/
> |
>
webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/addressing/factory/impl/Axis2EndpointReferenceFactoryImpl.
> java
> | - copied, changed from r628167,
>
webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/addressing/factory/Axis2EndpointReferenceFactoryImpl.
> java
> |
>
webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/addressing/factory/impl/JAXWSEndpointReferenceFactoryImpl.
> java
> | - copied, changed from r628167,
>
webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/addressing/factory/JAXWSEndpointReferenceFactoryImpl.
> java
> |
>
webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/addressing/migrator/
> |
>
webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/addressing/migrator/EndpointContextMapMigrator.
> java
> (with props)
> |
>
webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/addressing/util/EndpointContextMap.
> java
> (with props)
> |
>
webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/addressing/util/EndpointContextMapManager.
> java
> (with props)
> | Removed:
> |
>
webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/addressing/factory/Axis2EndpointReferenceFactoryImpl.
> java
> |
>
webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/addressing/factory/JAXWSEndpointReferenceFactoryImpl.
> java
> |
>
webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/addressing/util/EndpointMap.
> java
> |
>
webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/addressing/util/EndpointMapManager.
> java
> | Modified:
> |
>
webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/addressing/SubmissionEndpointReferenceBuilder.
> java
> |
>
webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/addressing/factory/Axis2EndpointReferenceFactory.
> java
> |
>
webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/addressing/factory/JAXWSEndpointReferenceFactory.
> java
> |
>
webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/addressing/util/EndpointKey.
> java
> |
>
webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/addressing/util/EndpointReferenceUtils.
> java
> |
>
webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/registry/ClientConfiguratorRegistry.
> java
> |
>
webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/registry/FactoryRegistry.
> java
> |
>
webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/server/EndpointController.
> java
> |
>
webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/spi/Provider.
> java
> |
>
webservices/axis2/trunk/java/modules/metadata/src/org/apache/axis2/jaxws/feature/ServerFramework.
> java
> |
> | Added:
>
webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/Constants.
> java
> | URL:
> http://svn.apache.
>
org/viewvc/webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/Constants.
> java?rev=628471&view=auto
> |
>
==============================================================================
> | ---
>
webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/Constants.
> java (added)
> | +++
>
webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/Constants.
> java Sun Feb 17 02:32:45 2008
> | @@ -0,0 +1,28 @@
> | +/*
> | + * 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.axis2.jaxws;
> | +
> | +/**
> | + * Constants that apply to the JAX-WS implementation.
> | + *
> | + */
> | +public interface Constants {
> | + public static final String ENDPOINT_CONTEXT_MAP =
> | + "org.apache.axis2.jaxws.addressing.util.EndpointContextMap";
> | +}
> |
> | Propchange:
>
webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/Constants.
> java
> |
>
------------------------------------------------------------------------------
> | svn:eol-style = native
> |
> | Modified:
>
webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/addressing/SubmissionEndpointReferenceBuilder.
> java
> | URL:
> http://svn.apache.
>
org/viewvc/webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/addressing/SubmissionEndpointReferenceBuilder.
> java?rev=628471&r1=628470&r2=628471&view=diff
> |
>
==============================================================================
> | ---
>
webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/addressing/SubmissionEndpointReferenceBuilder.
> java
> (original)
> | +++
>
webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/addressing/SubmissionEndpointReferenceBuilder.
> java
> Sun Feb 17 02:32:45 2008
> | @@ -28,6 +28,11 @@
> | import org.apache.axis2.jaxws.addressing.util.EndpointReferenceUtils;
> | import org.w3c.dom.Element;
> |
> | +/**
> | + * This class can be used to create instances of {@link
> SubmissionEndpointReference}.
> | + *
> | + * @see javax.xml.ws.wsaddressing.W3CEndpointReferenceBuilder
> | + */
> | public final class SubmissionEndpointReferenceBuilder {
> | private static final Element[] ZERO_LENGTH_ARRAY = new Element[0];
> |
> | @@ -38,19 +43,45 @@
> | private List<Element> referenceParameters;
> | private QName portType;
> |
> | + /**
> | + * Constructor
> | + *
> | + */
> | public SubmissionEndpointReferenceBuilder() {
> | }
> |
> | + /**
> | + * Add the address URI to use.
> | + *
> | + * @param address the address URI
> | + * @return an instance of
> <code>SubmissionEndpointReferenceBuilder</code> that has
> | + * been updated as specified.
> | + */
> | public SubmissionEndpointReferenceBuilder address(String address)
{
> | this.address = address;
> | return this;
> | }
> |
> | + /**
> | + * Add the WSDL service name of the endpoint that the
> endpoint reference will target.
> | + *
> | + * @param serviceName the WSDL service name
> | + * @return an instance of
> <code>SubmissionEndpointReferenceBuilder</code> that has
> | + * been updated as specified.
> | + */
> | public SubmissionEndpointReferenceBuilder serviceName(QName
> serviceName) {
> | this.serviceName = serviceName;
> | return this;
> | }
> |
> | + /**
> | + * Add the WSDL port name of the endpoint that the endpoint
> reference will target.
> | + * The WSDL port name can only be set after the WSDL service
> name has been set.
> | + *
> | + * @param endpointName the WSDL port name
> | + * @return an instance of
> <code>SubmissionEndpointReferenceBuilder</code> that has
> | + * been updated as specified.
> | + */
> | public SubmissionEndpointReferenceBuilder endpointName(QName
> endpointName) {
> | //TODO NLS enable
> | if (this.serviceName == null) {
> | @@ -61,11 +92,27 @@
> | return this;
> | }
> |
> | + /**
> | + * Add the URI from where the WSDL for the endpoint that the
> endpoint reference will
> | + * target can be retrieved.
> | + *
> | + * @param wsdlDocumentLocation the location URI of the WSDL
> | + * @return an instance of
> <code>SubmissionEndpointReferenceBuilder</code> that has
> | + * been updated as specified.
> | + */
> | public SubmissionEndpointReferenceBuilder
> wsdlDocumentLocation(String wsdlDocumentLocation) {
> | this.wsdlDocumentLocation = wsdlDocumentLocation;
> | return this;
> | }
> |
> | + /**
> | + * Add reference properties. These will appear in the
> endpoint reference as reference
> | + * parameters.
> | + *
> | + * @param referenceProperty the reference property
> | + * @return an instance of
> <code>SubmissionEndpointReferenceBuilder</code> that has
> | + * been updated as specified.
> | + */
> | public SubmissionEndpointReferenceBuilder
> referenceProperty(Element referenceProperty) {
> | //TODO NLS enable
> | if (referenceProperty == null) {
> | @@ -80,6 +127,13 @@
> | return this;
> | }
> |
> | + /**
> | + * Add reference parameters.
> | + *
> | + * @param referenceParameter the reference parameter
> | + * @return an instance of
> <code>SubmissionEndpointReferenceBuilder</code> that has
> | + * been updated as specified.
> | + */
> | public SubmissionEndpointReferenceBuilder
> referenceParameter(Element referenceParameter) {
> | //TODO NLS enable
> | if (referenceParameter == null) {
> | @@ -94,11 +148,24 @@
> | return this;
> | }
> |
> | + /**
> | + * Add the name of the WSDL port type.
> | + *
> | + * @param portType the WSDL port type name
> | + * @return an instance of
> <code>SubmissionEndpointReferenceBuilder</code> that has
> | + * been updated as specified.
> | + */
> | public SubmissionEndpointReferenceBuilder portType(QName
portType) {
> | this.portType = portType;
> | return this;
> | }
> |
> | + /**
> | + * Construct an instance of <code>EndpointReference</code>
> based on the values
> | + * specified.
> | + *
> | + * @return an instance of
<code>SubmissionEndpointReference</code>
> | + */
> | public SubmissionEndpointReference build() {
> | SubmissionEndpointReference submissionEPR = null;
> |
> | @@ -108,8 +175,11 @@
> | EndpointReferenceUtils.
> createAxis2EndpointReference(address, serviceName, endpointName,
> wsdlDocumentLocation, addressingNamespace);
> |
> | try {
> | - EndpointReferenceUtils.
> addReferenceParameters(axis2EPR, referenceParameters.
> toArray(ZERO_LENGTH_ARRAY));
> | - EndpointReferenceUtils.addInterface(axis2EPR,
> portType, InterfaceName.subQName);
> | + if (referenceParameters != null)
> | + EndpointReferenceUtils.
> addReferenceParameters(axis2EPR, referenceParameters.
> toArray(ZERO_LENGTH_ARRAY));
> | +
> | + if (portType != null)
> | + EndpointReferenceUtils.addInterface(axis2EPR,
> portType, InterfaceName.subQName);
> |
> | submissionEPR =
> | (SubmissionEndpointReference)
> EndpointReferenceUtils.convertFromAxis2(axis2EPR, addressingNamespace);
> |
> | Modified:
>
webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/addressing/factory/Axis2EndpointReferenceFactory.
> java
> | URL:
> http://svn.apache.
>
org/viewvc/webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/addressing/factory/Axis2EndpointReferenceFactory.
> java?rev=628471&r1=628470&r2=628471&view=diff
> |
>
==============================================================================
> | ---
>
webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/addressing/factory/Axis2EndpointReferenceFactory.
> java
> (original)
> | +++
>
webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/addressing/factory/Axis2EndpointReferenceFactory.
> java
> Sun Feb 17 02:32:45 2008
> | @@ -4,10 +4,47 @@
> |
> | import org.apache.axis2.addressing.EndpointReference;
> |
> | +/**
> | + * This class represents factories that can be use to create
instances of
> | + * {@link EndpointReference} that can ultimately be converted
> into instances
> | + * of {@link javax.xml.ws.EndpointReference} that are suitable to
> be returned
> | + * via the appropriate JAX-WS 2.1 API methods.
> | + *
> | + */
> | public interface Axis2EndpointReferenceFactory {
> | + /**
> | + * Create an instance of <code>EndpointReference</code> with
> the specified address.
> | + *
> | + * @param address the address URI to use. It cannot be null.
> | + * @return an instance of <code>EndpointReference</code>.
> | + */
> | public EndpointReference createEndpointReference(String address);
> |
> | + /**
> | + * Create an instance of <code>EndpointReference</code> that
> targets the endpoint
> | + * identified by the specified WSDL service name and endpoint
name.
> | + *
> | + * @param serviceName the WSDL service name
> | + * @param endpoint the WSDL port name
> | + * @return an instance of <code>EndpointReference</code> that
> targets the specified
> | + * endpoint
> | + */
> | public EndpointReference createEndpointReference(QName
> serviceName, QName endpoint);
> |
> | + /**
> | + * Create an instance of <code>EndpointReference</code>. If
> the address is specified
> | + * then it will be used. If the address is null, but the WSDL
> service name and port
> | + * name are specified then they will be used to target the
> specified endpoint. Either
> | + * the address URI, or the WSDL service name and port name
> must be specified.
> | + *
> | + * @param address the address URI to use, if specified
> | + * @param serviceName the WSDL service name, if specified
> | + * @param portName the WSDL port name, if specified
> | + * @param wsdlDocumentLocation the URI from where the WSDL
> for the endpoint can be
> | + * retrieved, if specified.
> | + * @param addressingNamespace the intended WS-Addressing
> namespace that the <code>
> | + * EndpointRefence</code> should comply with.
> | + * @return an instance of <code>EndpointReference</code>.
> | + */
> | public EndpointReference createEndpointReference(String
> address, QName serviceName, QName portName, String
> wsdlDocumentLocation, String addressingNamespace);
> | }
> |
> | Modified:
>
webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/addressing/factory/JAXWSEndpointReferenceFactory.
> java
> | URL:
> http://svn.apache.
>
org/viewvc/webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/addressing/factory/JAXWSEndpointReferenceFactory.
> java?rev=628471&r1=628470&r2=628471&view=diff
> |
>
==============================================================================
> | ---
>
webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/addressing/factory/JAXWSEndpointReferenceFactory.
> java
> (original)
> | +++
>
webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/addressing/factory/JAXWSEndpointReferenceFactory.
> java
> Sun Feb 17 02:32:45 2008
> | @@ -22,8 +22,25 @@
> | import javax.xml.transform.Source;
> | import javax.xml.ws.EndpointReference;
> |
> | +/**
> | + * This class represents factories that can be used to generate
> instances of the
> | + * {@link EndpointReference}.
> | + */
> | public interface JAXWSEndpointReferenceFactory {
> | + /**
> | + * Create an instance of a supported subclass of
> <code>EndpointReference</code>.
> | + *
> | + * @param eprInfoset the endpoint reference
> | + * @return an instance of <code>EndpointReference</code>.
> | + * @throws JAXBException
> | + */
> | public EndpointReference createEndpointReference(Source
> eprInfoset) throws JAXBException;
> |
> | + /**
> | + * Map the specified class to a supported WS-Addressing
namespace.
> | + *
> | + * @param clazz the class.
> | + * @return the WS-Addressing namespace that is associated
> with the class.
> | + */
> | public String getAddressingNamespace(Class clazz);
> | }
> |
> | Copied:
>
webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/addressing/factory/impl/Axis2EndpointReferenceFactoryImpl.
> java
> (from r628167,
>
webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/addressing/factory/Axis2EndpointReferenceFactoryImpl.
> java)
> | URL:
> http://svn.apache.
>
org/viewvc/webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/addressing/factory/impl/Axis2EndpointReferenceFactoryImpl.
> java?
>
p2=webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/addressing/factory/impl/Axis2EndpointReferenceFactoryImpl.
>
java&p1=webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/addressing/factory/Axis2EndpointReferenceFactoryImpl.
> java&r1=628167&r2=628471&rev=628471&view=diff
> |
>
==============================================================================
> | ---
>
webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/addressing/factory/Axis2EndpointReferenceFactoryImpl.
> java
> (original)
> | +++
>
webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/addressing/factory/impl/Axis2EndpointReferenceFactoryImpl.
> java
> Sun Feb 17 02:32:45 2008
> | @@ -16,7 +16,7 @@
> | * specific language governing permissions and limitations
> | * under the License.
> | */
> | -package org.apache.axis2.jaxws.addressing.factory;
> | +package org.apache.axis2.jaxws.addressing.factory.impl;
> |
> | import java.net.URL;
> |
> | @@ -27,32 +27,49 @@
> | import org.apache.axis2.addressing.metadata.ServiceName;
> | import org.apache.axis2.addressing.metadata.WSDLLocation;
> | import org.apache.axis2.jaxws.ExceptionFactory;
> | +import org.apache.axis2.jaxws.addressing.factory.
> Axis2EndpointReferenceFactory;
> | import org.apache.axis2.jaxws.addressing.util.EndpointKey;
> | -import org.apache.axis2.jaxws.addressing.util.EndpointMap;
> | -import org.apache.axis2.jaxws.addressing.util.EndpointMapManager;
> | +import org.apache.axis2.jaxws.addressing.util.EndpointContextMap;
> | +import
org.apache.axis2.jaxws.addressing.util.EndpointContextMapManager;
> | import org.apache.axis2.jaxws.util.WSDL4JWrapper;
> | import org.apache.axis2.jaxws.util.WSDLWrapper;
> |
> | +/**
> | + * This class produces instances of {@link EndpointReference}.
> | + *
> | + */
> | public class Axis2EndpointReferenceFactoryImpl implements
> Axis2EndpointReferenceFactory {
> | public Axis2EndpointReferenceFactoryImpl() {
> | super();
> | }
> |
> | + /*
> | + * (non-Javadoc)
> | + * @see
> org.apache.axis2.jaxws.addressing.factory.
> Axis2EndpointReferenceFactory#createEndpointReference(java.lang.String)
> | + */
> | public EndpointReference createEndpointReference(String address)
{
> | if (address == null)
> | throw new IllegalStateException("The endpoint address
> URI is null.");
> |
> | return new EndpointReference(address);
> | }
> | -
> | +
> | + /*
> | + * (non-Javadoc)
> | + * @see
> org.apache.axis2.jaxws.addressing.factory.
> Axis2EndpointReferenceFactory#createEndpointReference(javax.xml.
> namespace.QName,
> javax.xml.namespace.QName)
> | + */
> | public EndpointReference createEndpointReference(QName
> serviceName, QName endpoint) {
> | EndpointKey key = new EndpointKey(serviceName, endpoint);
> | - EndpointMap map = EndpointMapManager.getEndpointMap();
> | - String address = map.get(key);
> | + EndpointContextMap map = EndpointContextMapManager.
> getEndpointContextMap();
> | + String address = (String) map.get(key);
> |
> | return createEndpointReference(address);
> | }
> | -
> | +
> | + /*
> | + * (non-Javadoc)
> | + * @see
> org.apache.axis2.jaxws.addressing.factory.
> Axis2EndpointReferenceFactory#createEndpointReference(java.lang.String,
> javax.xml.namespace.QName, javax.xml.namespace.QName, java.lang.
> String, java.lang.String)
> | + */
> | public EndpointReference createEndpointReference(String
> address, QName serviceName, QName portName, String
> wsdlDocumentLocation, String addressingNamespace) {
> | EndpointReference axis2EPR = null;
> |
> | @@ -71,10 +88,13 @@
> | throw new IllegalStateException("Cannot create an
> endpoint reference because the address, service name,
> and/or port name are null.");
> | }
> |
> | + //TODO If no service name and port name are specified,
> but the wsdl location is
> | + //specified, and the WSDL only contains one service and
> one port then maybe we
> | + //should simply use those.
> | try {
> | - //TODO If no service name and port name are
> specified, but the wsdl location is
> | - //specified, and the WSDL only contains one service
> and one port then maybe we
> | - //should simply use those.
> | + //This code is locate here instead of in the
> createEndpointReference(QName, QName)
> | + //method so that if the address is also specified the
> EPR metadata will still be
> | + //filled in correctly.
> | if (serviceName != null && portName != null) {
> | ServiceName service = new
> ServiceName(serviceName, portName.getLocalPart());
> | EndpointReferenceHelper.
> setServiceNameMetadata(axis2EPR, addressingNamespace, service);
> | @@ -103,7 +123,7 @@
> | }
> | }
> |
> | - //TODO NLS
> | + //TODO NLS enable
> | if (!found)
> | throw new IllegalStateException("The
> specified port name does not exist in the specified WSDL
> service.");
> | }
> |
> | Copied:
>
webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/addressing/factory/impl/JAXWSEndpointReferenceFactoryImpl.
> java
> (from r628167,
>
webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/addressing/factory/JAXWSEndpointReferenceFactoryImpl.
> java)
> | URL:
> http://svn.apache.
>
org/viewvc/webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/addressing/factory/impl/JAXWSEndpointReferenceFactoryImpl.
> java?
>
p2=webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/addressing/factory/impl/JAXWSEndpointReferenceFactoryImpl.
>
java&p1=webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/addressing/factory/JAXWSEndpointReferenceFactoryImpl.
> java&r1=628167&r2=628471&rev=628471&view=diff
> |
>
==============================================================================
> | ---
>
webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/addressing/factory/JAXWSEndpointReferenceFactoryImpl.
> java
> (original)
> | +++
>
webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/addressing/factory/impl/JAXWSEndpointReferenceFactoryImpl.
> java
> Sun Feb 17 02:32:45 2008
> | @@ -16,7 +16,7 @@
> | * specific language governing permissions and limitations
> | * under the License.
> | */
> | -package org.apache.axis2.jaxws.addressing.factory;
> | +package org.apache.axis2.jaxws.addressing.factory.impl;
> |
> | import javax.xml.bind.JAXBContext;
> | import javax.xml.bind.JAXBException;
> | @@ -30,10 +30,21 @@
> | import org.apache.axis2.addressing.AddressingConstants.Submission;
> | import org.apache.axis2.jaxws.ExceptionFactory;
> | import org.apache.axis2.jaxws.addressing.SubmissionEndpointReference;
> | +import org.apache.axis2.jaxws.addressing.factory.
> JAXWSEndpointReferenceFactory;
> |
> | +/**
> | + * This class is used to generate instances of the following
subclasses of
> | + * {@link EndpointReference}.
> | + *
> | + * @see javax.xml.ws.wsaddressing.W3CEndpointReference
> | + * @see org.apache.axis2.jaxws.addressing.SubmissionEndpointReference
> | + */
> | public class JAXWSEndpointReferenceFactoryImpl implements
> JAXWSEndpointReferenceFactory {
> | private JAXBContext jaxbContext;
> |
> | + /**
> | + * Constructor
> | + */
> | public JAXWSEndpointReferenceFactoryImpl() {
> | super();
> |
> | @@ -47,12 +58,19 @@
> | }
> | }
> |
> | + /*
> | + * (non-Javadoc)
> | + * @see
> org.apache.axis2.jaxws.addressing.factory.
> JAXWSEndpointReferenceFactory#createEndpointReference(javax.xml.
> transform.Source)
> | + */
> | public EndpointReference createEndpointReference(Source
> eprInfoset) throws JAXBException {
> | Unmarshaller um = jaxbContext.createUnmarshaller();
> | -
> | return (EndpointReference) um.unmarshal(eprInfoset);
> | }
> |
> | + /*
> | + * (non-Javadoc)
> | + * @see
> org.apache.axis2.jaxws.addressing.factory.
> JAXWSEndpointReferenceFactory#getAddressingNamespace(java.lang.Class)
> | + */
> | public String getAddressingNamespace(Class clazz) {
> | String addressingNamespace = null;
> |
> |
> | Added:
>
webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/addressing/migrator/EndpointContextMapMigrator.
> java
> | URL:
> http://svn.apache.
>
org/viewvc/webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/addressing/migrator/EndpointContextMapMigrator.
> java?rev=628471&view=auto
> |
>
==============================================================================
> | ---
>
webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/addressing/migrator/EndpointContextMapMigrator.
> java
> (added)
> | +++
>
webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/addressing/migrator/EndpointContextMapMigrator.
> java
> Sun Feb 17 02:32:45 2008
> | @@ -0,0 +1,118 @@
> | +/*
> | + * 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.axis2.jaxws.addressing.migrator;
> | +
> | +import org.apache.axis2.AxisFault;
> | +import org.apache.axis2.context.MessageContext;
> | +import org.apache.axis2.description.AxisOperation;
> | +import org.apache.axis2.description.Parameter;
> | +import org.apache.axis2.engine.AxisConfiguration;
> | +import org.apache.axis2.jaxws.Constants;
> | +import org.apache.axis2.jaxws.ExceptionFactory;
> | +import org.apache.axis2.jaxws.addressing.util.EndpointContextMap;
> | +import
org.apache.axis2.jaxws.addressing.util.EndpointContextMapManager;
> | +import org.apache.axis2.util.ThreadContextMigrator;
> | +import org.apache.axis2.util.Utils;
> | +import org.apache.axis2.wsdl.WSDLConstants;
> | +
> | +/**
> | + * This class will enable the JAX-WS 2.1 API methods to create
instances of
> | + * {@link javax.xml.ws.EndpointReference} that target a
> particular web service
> | + * endpoint, identified by specifying the WSDL service name and
> port name of the
> | + * endpoint, to work correctly. This is achieved by enabling the
> implementation of
> | + * {@link org.apache.axis2.jaxws.addressing.factory.
> Axis2EndpointReferenceFactory}
> | + * to retrieve the context it needs from the invoking thread. The
> instances of
> | + * {@link org.apache.axis2.addressing.EndpointReference} that it
> produces can
> | + * then converted to instances of {@link javax.xml.ws.
> EndpointReference}, as
> | + * needed.
> | + *
> | + */
> | +public class EndpointContextMapMigrator implements
ThreadContextMigrator {
> | +
> | + /* (non-Javadoc)
> | + * @see org.apache.axis2.util.
> ThreadContextMigrator#migrateContextToThread(org.apache.axis2.
> context.MessageContext)
> | + */
> | + public void migrateContextToThread(MessageContext messageContext)
> | + throws AxisFault {
> | + //Only make the context map available if we have an inbound
request
> | + //message, in the server.
> | + AxisOperation axisOperation =
messageContext.getAxisOperation();
> | + String mep = axisOperation.getMessageExchangePattern();
> | + int mepConstant = Utils.getAxisSpecifMEPConstant(mep);
> | +
> | + if (mepConstant == WSDLConstants.MEP_CONSTANT_IN_ONLY ||
> | + mepConstant == WSDLConstants.MEP_CONSTANT_IN_OUT ||
> | + mepConstant == WSDLConstants.MEP_CONSTANT_IN_OPTIONAL_OUT
||
> | + mepConstant == WSDLConstants.MEP_CONSTANT_ROBUST_IN_ONLY)
> | + {
> | + AxisConfiguration axisConfig = axisOperation.
> getAxisConfiguration();
> | + Parameter param = axisConfig.getParameter(Constants.
> ENDPOINT_CONTEXT_MAP);
> | +
> | + if (param != null) {
> | + EndpointContextMap map = (EndpointContextMap)
> param.getValue();
> | +
> | + if (map != null) {
> | + EndpointContextMapManager.setEndpointContextMap(map);
> | + }
> | + else {
> | + //TODO NLS enable.
> | + throw ExceptionFactory.
> makeWebServiceException("The endpoint context map is null.");
> | + }
> | + }
> | + else {
> | + //TODO NLS enable.
> | + throw ExceptionFactory.
> makeWebServiceException("Unable to locate endpoint context map.");
> | + }
> | + }
> | + }
> | +
> | + /* (non-Javadoc)
> | + * @see org.apache.axis2.util.
>
ThreadContextMigrator#cleanupThread(org.apache.axis2.context.MessageContext)
> | + */
> | + public void cleanupThread(MessageContext messageContext) {
> | + //Only clean up if we are inbound to the server.
> | + AxisOperation axisOperation =
messageContext.getAxisOperation();
> | + String mep = axisOperation.getMessageExchangePattern();
> | + int mepConstant = Utils.getAxisSpecifMEPConstant(mep);
> | +
> | + if (mepConstant == WSDLConstants.MEP_CONSTANT_IN_ONLY ||
> | + mepConstant == WSDLConstants.MEP_CONSTANT_IN_OUT ||
> | + mepConstant == WSDLConstants.MEP_CONSTANT_IN_OPTIONAL_OUT
||
> | + mepConstant == WSDLConstants.MEP_CONSTANT_ROBUST_IN_ONLY)
> | + {
> | + EndpointContextMapManager.setEndpointContextMap(null);
> | + }
> | + }
> | +
> | + /* (non-Javadoc)
> | + * @see org.apache.axis2.util.
> ThreadContextMigrator#migrateThreadToContext(org.apache.axis2.
> context.MessageContext)
> | + */
> | + public void migrateThreadToContext(MessageContext messageContext)
> | + throws AxisFault {
> | + //Nothing to do.
> | + }
> | +
> | + /* (non-Javadoc)
> | + * @see org.apache.axis2.util.
>
ThreadContextMigrator#cleanupContext(org.apache.axis2.context.MessageContext)
> | + */
> | + public void cleanupContext(MessageContext messageContext) {
> | + //Nothing to do.
> | + }
> | +
> | +}
> |
> | Propchange:
>
webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/addressing/migrator/EndpointContextMapMigrator.
> java
> |
>
------------------------------------------------------------------------------
> | svn:eol-style = native
> |
> | Added:
>
webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/addressing/util/EndpointContextMap.
> java
> | URL:
> http://svn.apache.
>
org/viewvc/webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/addressing/util/EndpointContextMap.
> java?rev=628471&view=auto
> |
>
==============================================================================
> | ---
>
webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/addressing/util/EndpointContextMap.
> java (added)
> | +++
>
webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/addressing/util/EndpointContextMap.
> java Sun
> Feb 17 02:32:45 2008
> | @@ -0,0 +1,38 @@
> | +/*
> | + * 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.axis2.jaxws.addressing.util;
> | +
> | +import java.util.concurrent.ConcurrentHashMap;
> | +
> | +import org.apache.axis2.jaxws.addressing.util.EndpointKey;
> | +
> | +/**
> | + * This class stores the context needed to correctly produce
instances of
> | + * {@link javax.xml.ws.EndpointReference} for a particular web
> service endpoint
> | + * identified by an {@link EndpointKey}.
> | + *
> | + */
> | +public class EndpointContextMap extends
> ConcurrentHashMap<EndpointKey, Object> {
> | +
> | + private static final long serialVersionUID = 694539734825500599L;
> | +
> | + public EndpointContextMap() {
> | + super();
> | + }
> | +}
> |
> | Propchange:
>
webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/addressing/util/EndpointContextMap.
> java
> |
>
------------------------------------------------------------------------------
> | svn:eol-style = native
> |
> | Added:
>
webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/addressing/util/EndpointContextMapManager.
> java
> | URL:
> http://svn.apache.
>
org/viewvc/webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/addressing/util/EndpointContextMapManager.
> java?rev=628471&view=auto
> |
>
==============================================================================
> | ---
>
webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/addressing/util/EndpointContextMapManager.
> java (added)
> | +++
>
webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/addressing/util/EndpointContextMapManager.
> java Sun
> Feb 17 02:32:45 2008
> | @@ -0,0 +1,50 @@
> | +/*
> | + * 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.axis2.jaxws.addressing.util;
> | +
> | +/**
> | + * This class is used to manage the association between an {@link
> EndpointContextMap}
> | + * and a thread.
> | + */
> | +public class EndpointContextMapManager {
> | + private static ThreadLocal<EndpointContextMap> variable =
> | + new InheritableThreadLocal<EndpointContextMap>();
> | +
> | + public static EndpointContextMap
> setEndpointContextMap(EndpointContextMap newMap) {
> | + EndpointContextMap oldMap = variable.get();
> | + variable.set(newMap);
> | +
> | + return oldMap;
> | + }
> | +
> | + public static EndpointContextMap getEndpointContextMap() {
> | + EndpointContextMap currentMap = variable.get();
> | +
> | + if (currentMap == null) {
> | + currentMap = getDefaultEndpointMap();
> | + setEndpointContextMap(currentMap);
> | + }
> | +
> | + return currentMap;
> | + }
> | +
> | + private static EndpointContextMap getDefaultEndpointMap() {
> | + return new EndpointContextMap();
> | + }
> | +}
> |
> | Propchange:
>
webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/addressing/util/EndpointContextMapManager.
> java
> |
>
------------------------------------------------------------------------------
> | svn:eol-style = native
> |
> | Modified:
>
webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/addressing/util/EndpointKey.
> java
> | URL:
> http://svn.apache.
>
org/viewvc/webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/addressing/util/EndpointKey.
> java?rev=628471&r1=628470&r2=628471&view=diff
> |
>
==============================================================================
> | ---
>
webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/addressing/util/EndpointKey.
> java (original)
> | +++
>
webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/addressing/util/EndpointKey.
> java Sun Feb 17
> 02:32:45 2008
> | @@ -20,6 +20,11 @@
> |
> | import javax.xml.namespace.QName;
> |
> | +/**
> | + * This class is used to identify a particular web service
> endpoint based on
> | + * the combination of WSDL service name and port name.
> | + *
> | + */
> | public class EndpointKey {
> | private final QName service;
> | private final QName endpoint;
> |
> | Modified:
>
webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/addressing/util/EndpointReferenceUtils.
> java
> | URL:
> http://svn.apache.
>
org/viewvc/webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/addressing/util/EndpointReferenceUtils.
> java?rev=628471&r1=628470&r2=628471&view=diff
> |
>
==============================================================================
> | ---
>
webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/addressing/util/EndpointReferenceUtils.
> java
> (original)
> | +++
>
webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/addressing/util/EndpointReferenceUtils.
> java
> Sun Feb 17 02:32:45 2008
> | @@ -41,10 +41,6 @@
> | public final class EndpointReferenceUtils {
> |
> | private static OMFactory omFactory =
OMAbstractFactory.getOMFactory();
> | - private static JAXWSEndpointReferenceFactory jaxwsEPRFactory =
> | - (JAXWSEndpointReferenceFactory) FactoryRegistry.
> getFactory(JAXWSEndpointReferenceFactory.class);
> | - private static Axis2EndpointReferenceFactory axis2EPRFactory =
> | - (Axis2EndpointReferenceFactory) FactoryRegistry.
> getFactory(Axis2EndpointReferenceFactory.class);
> |
> | private EndpointReferenceUtils() {
> | }
> | @@ -66,8 +62,10 @@
> | EndpointReferenceHelper.toOM(omFactory, axis2EPR,
> qname, addressingNamespace);
> | Element eprElement = XMLUtils.toDOM(omElement);
> | Source eprInfoset = new DOMSource(eprElement);
> | + JAXWSEndpointReferenceFactory factory =
> (JAXWSEndpointReferenceFactory)
> | + FactoryRegistry.
> getFactory(JAXWSEndpointReferenceFactory.class);
> |
> | - return jaxwsEPRFactory.createEndpointReference(eprInfoset);
> | + return factory.createEndpointReference(eprInfoset);
> | }
> |
> | /**
> | @@ -82,7 +80,10 @@
> | */
> | public static javax.xml.ws.EndpointReference
> convertFromSource(Source eprInfoset)
> | throws Exception {
> | - return jaxwsEPRFactory.createEndpointReference(eprInfoset);
> | + JAXWSEndpointReferenceFactory factory =
> (JAXWSEndpointReferenceFactory)
> | + FactoryRegistry.
> getFactory(JAXWSEndpointReferenceFactory.class);
> | +
> | + return factory.createEndpointReference(eprInfoset);
> | }
> |
> | /**
> | @@ -105,15 +106,24 @@
> | }
> |
> | public static String getAddressingNamespace(Class clazz) {
> | - return jaxwsEPRFactory.getAddressingNamespace(clazz);
> | + JAXWSEndpointReferenceFactory factory =
> (JAXWSEndpointReferenceFactory)
> | + FactoryRegistry.
> getFactory(JAXWSEndpointReferenceFactory.class);
> | +
> | + return factory.getAddressingNamespace(clazz);
> | }
> |
> | public static EndpointReference
> createAxis2EndpointReference(String address, QName serviceName,
> QName portName,
> String wsdlDocumentLocation, String addressingNamespace) {
> | - return axis2EPRFactory.createEndpointReference(address,
> serviceName, portName, wsdlDocumentLocation,
> addressingNamespace);
> | + Axis2EndpointReferenceFactory factory =
> (Axis2EndpointReferenceFactory)
> | + FactoryRegistry.
> getFactory(Axis2EndpointReferenceFactory.class);
> | +
> | + return factory.createEndpointReference(address,
> serviceName, portName, wsdlDocumentLocation,
> addressingNamespace);
> | }
> |
> | public static EndpointReference
> createAxis2EndpointReference(String address) {
> | - return axis2EPRFactory.createEndpointReference(address);
> | + Axis2EndpointReferenceFactory factory =
> (Axis2EndpointReferenceFactory)
> | + FactoryRegistry.
> getFactory(Axis2EndpointReferenceFactory.class);
> | +
> | + return factory.createEndpointReference(address);
> | }
> |
> | public static void addReferenceParameters(EndpointReference
> axis2EPR, Element...referenceParameters)
> | @@ -140,8 +150,7 @@
> | throws Exception {
> | if (portType != null) {
> | InterfaceName interfaceName = new InterfaceName(portType);
> | - OMFactory factory = OMAbstractFactory.getOMFactory();
> | - OMElement omElement =
interfaceName.toOM(interfaceType,factory);
> | + OMElement omElement = interfaceName.toOM(interfaceType,
> omFactory);
> | axis2EPR.addExtensibleElement(omElement);
> | }
> | }
> |
> | Modified:
>
webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/registry/ClientConfiguratorRegistry.
> java
> | URL:
> http://svn.apache.
>
org/viewvc/webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/registry/ClientConfiguratorRegistry.
> java?rev=628471&r1=628470&r2=628471&view=diff
> |
>
==============================================================================
> | ---
>
webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/registry/ClientConfiguratorRegistry.
> java
> (original)
> | +++
>
webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/registry/ClientConfiguratorRegistry.
> java Sun
> Feb 17 02:32:45 2008
> | @@ -18,9 +18,9 @@
> | */
> | package org.apache.axis2.jaxws.registry;
> |
> | -import java.util.HashMap;
> | import java.util.Map;
> | import java.util.Set;
> | +import java.util.concurrent.ConcurrentHashMap;
> |
> | import javax.xml.ws.RespectBindingFeature;
> | import javax.xml.ws.soap.AddressingFeature;
> | @@ -34,7 +34,7 @@
> |
> | public class ClientConfiguratorRegistry {
> | private static Map<String, ClientConfigurator> map =
> | - new HashMap<String, ClientConfigurator>();
> | + new ConcurrentHashMap<String, ClientConfigurator>();
> |
> | static {
> | map.put(AddressingFeature.ID, new AddressingConfigurator());
> |
> | Modified:
>
webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/registry/FactoryRegistry.
> java
> | URL:
> http://svn.apache.
>
org/viewvc/webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/registry/FactoryRegistry.
> java?rev=628471&r1=628470&r2=628471&view=diff
> |
>
==============================================================================
> | ---
>
webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/registry/FactoryRegistry.
> java (original)
> | +++
>
webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/registry/FactoryRegistry.
> java Sun Feb 17
> 02:32:45 2008
> | @@ -20,9 +20,9 @@
> | package org.apache.axis2.jaxws.registry;
> |
> | import org.apache.axis2.jaxws.addressing.factory.
> Axis2EndpointReferenceFactory;
> | -import org.apache.axis2.jaxws.addressing.factory.
> Axis2EndpointReferenceFactoryImpl;
> | import org.apache.axis2.jaxws.addressing.factory.
> JAXWSEndpointReferenceFactory;
> | -import org.apache.axis2.jaxws.addressing.factory.
> JAXWSEndpointReferenceFactoryImpl;
> | +import org.apache.axis2.jaxws.addressing.factory.impl.
> Axis2EndpointReferenceFactoryImpl;
> | +import org.apache.axis2.jaxws.addressing.factory.impl.
> JAXWSEndpointReferenceFactoryImpl;
> | import
org.apache.axis2.jaxws.core.controller.InvocationControllerFactory;
> | import org.apache.axis2.jaxws.core.controller.impl.
> InvocationControllerFactoryImpl;
> | import org.apache.axis2.jaxws.handler.factory.HandlerInvokerFactory;
> |
> | Modified:
>
webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/server/EndpointController.
> java
> | URL:
> http://svn.apache.
>
org/viewvc/webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/server/EndpointController.
> java?rev=628471&r1=628470&r2=628471&view=diff
> |
>
==============================================================================
> | ---
>
webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/server/EndpointController.
> java (original)
> | +++
>
webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/server/EndpointController.
> java Sun Feb 17
> 02:32:45 2008
> | @@ -26,8 +26,8 @@
> | import org.apache.axis2.java.security.AccessController;
> | import org.apache.axis2.jaxws.ExceptionFactory;
> | import org.apache.axis2.jaxws.addressing.util.EndpointKey;
> | -import org.apache.axis2.jaxws.addressing.util.EndpointMap;
> | -import org.apache.axis2.jaxws.addressing.util.EndpointMapManager;
> | +import org.apache.axis2.jaxws.addressing.util.EndpointContextMap;
> | +import
org.apache.axis2.jaxws.addressing.util.EndpointContextMapManager;
> | import org.apache.axis2.jaxws.core.MessageContext;
> | import org.apache.axis2.jaxws.core.util.MessageContextUtils;
> | import org.apache.axis2.jaxws.description.DescriptionFactory;
> | @@ -405,10 +405,10 @@
> | Parameter param = axisSvc.
> getParameter(EndpointDescription.AXIS_SERVICE_PARAMETER);
> |
> | EndpointDescription ed =
(EndpointDescription)param.getValue();
> | - param = axisSvc.getParameter(EndpointMap.class.
> getCanonicalName());
> | + param = axisSvc.getParameter(EndpointContextMap.
> class.getCanonicalName());
> | if(param != null) {
> | - EndpointMap map = (EndpointMap) param.getValue();
> | - EndpointMapManager.setEndpointMap(map);
> | + EndpointContextMap map = (EndpointContextMap)
> param.getValue();
> | + EndpointContextMapManager.setEndpointContextMap(map);
> | }
> |
> | return ed;
> | @@ -436,16 +436,16 @@
> | QName endpoint = ed.getPortQName();
> | EndpointKey key = new EndpointKey(service, endpoint);
> | axisSvc = ed.getAxisService();
> | - Parameter param = axisSvc.
> getParameter(EndpointMap.class.getCanonicalName());
> | - EndpointMap map = null;
> | + Parameter param = axisSvc.
> getParameter(EndpointContextMap.class.getCanonicalName());
> | + EndpointContextMap map = null;
> |
> | if (param == null) {
> | - map = EndpointMapManager.getEndpointMap();
> | - axisSvc.addParameter(EndpointMap.class.
> getCanonicalName(), map);
> | + map = EndpointContextMapManager.
> getEndpointContextMap();
> | + axisSvc.addParameter(EndpointContextMap.
> class.getCanonicalName(), map);
> | }
> | else {
> | - map = (EndpointMap) param.getValue();
> | - EndpointMapManager.setEndpointMap(map);
> | + map = (EndpointContextMap) param.getValue();
> | + EndpointContextMapManager.setEndpointContextMap(map);
> | }
> |
> | map.put(key, axisSvc.getEPRs()[0]);
> |
> | Modified:
>
webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/spi/Provider.
> java
> | URL:
> http://svn.apache.
>
org/viewvc/webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/spi/Provider.
> java?rev=628471&r1=628470&r2=628471&view=diff
> |
>
==============================================================================
> | ---
>
webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/spi/Provider.
> java (original)
> | +++
>
webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/spi/Provider.
> java Sun Feb 17 02:32:45 2008
> | @@ -74,8 +74,11 @@
> | W3CEndpointReference w3cEPR = null;
> |
> | try {
> | - EndpointReferenceUtils.addMetadata(axis2EPR, metadata.
> toArray(ZERO_LENGTH_ARRAY));
> | - EndpointReferenceUtils.
> addReferenceParameters(axis2EPR, referenceParameters.
> toArray(ZERO_LENGTH_ARRAY));
> | + if (metadata != null)
> | + EndpointReferenceUtils.addMetadata(axis2EPR,
> metadata.toArray(ZERO_LENGTH_ARRAY));
> | +
> | + if (referenceParameters != null)
> | + EndpointReferenceUtils.
> addReferenceParameters(axis2EPR, referenceParameters.
> toArray(ZERO_LENGTH_ARRAY));
> |
> | w3cEPR =
> | (W3CEndpointReference) EndpointReferenceUtils.
> convertFromAxis2(axis2EPR, addressingNamespace);
> |
> | Modified:
>
webservices/axis2/trunk/java/modules/metadata/src/org/apache/axis2/jaxws/feature/ServerFramework.
> java
> | URL:
> http://svn.apache.
>
org/viewvc/webservices/axis2/trunk/java/modules/metadata/src/org/apache/axis2/jaxws/feature/ServerFramework.
> java?rev=628471&r1=628470&r2=628471&view=diff
> |
>
==============================================================================
> | ---
>
webservices/axis2/trunk/java/modules/metadata/src/org/apache/axis2/jaxws/feature/ServerFramework.
> java (original)
> | +++
>
webservices/axis2/trunk/java/modules/metadata/src/org/apache/axis2/jaxws/feature/ServerFramework.
> java Sun Feb 17
> 02:32:45 2008
> | @@ -25,7 +25,6 @@
> |
> | import java.lang.annotation.Annotation;
> | import java.util.HashMap;
> | -import java.util.IdentityHashMap;
> | import java.util.Map;
> |
> | public class ServerFramework {
> | @@ -48,8 +47,7 @@
> | if (annotation == null)
> | return false;
> |
> | - WebServiceFeatureAnnotation wsfAnnotation =
> | - annotation.annotationType().
> getAnnotation(WebServiceFeatureAnnotation.class);
> | + WebServiceFeatureAnnotation wsfAnnotation =
> getWebServiceFeatureAnnotation(annotation);
> |
> | String id = null;
> | if (wsfAnnotation != null)
> | @@ -63,8 +61,7 @@
> | if (!isValid(annotation))
> | throw ExceptionFactory.
> makeWebServiceException("Invalid or unsupported WebServiceFeature
> annotation, " +
> annotation);
> |
> | - WebServiceFeatureAnnotation wsfAnnotation =
> | - annotation.annotationType().
> getAnnotation(WebServiceFeatureAnnotation.class);
> | + WebServiceFeatureAnnotation wsfAnnotation =
> getWebServiceFeatureAnnotation(annotation);
> |
> | annotationMap.put(wsfAnnotation.id(), annotation);
> | }
> | @@ -79,11 +76,13 @@
> |
> | public void configure(EndpointDescription endpointDescription) {
> | for (Annotation annotation : getAllAnnotations()) {
> | - WebServiceFeatureAnnotation wsfAnnotation =
> | - annotation.annotationType().
> getAnnotation(WebServiceFeatureAnnotation.class);
> | -
> | + WebServiceFeatureAnnotation wsfAnnotation =
> getWebServiceFeatureAnnotation(annotation);
> | ServerConfigurator configurator = configuratorMap.
> get(wsfAnnotation.id());
> | configurator.configure(endpointDescription);
> | }
> | + }
> | +
> | + private WebServiceFeatureAnnotation
> getWebServiceFeatureAnnotation(Annotation annotation) {
> | + return annotation.annotationType().
> getAnnotation(WebServiceFeatureAnnotation.class);
> | }
> | }
> |
> |
> |
> | ---------------------------------------------------------------------
> | To unsubscribe, e-mail: axis-cvs-unsubscribe@ws.apache.org
> | For additional commands, e-mail: axis-cvs-help@ws.apache.org
> |
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.5 (Cygwin)
>
> iD4DBQFHuEVIgNg6eWEDv1kRAvawAKCr+EAcb8/oAJphCNXYXYAFbv6EoQCYo9ZQ
> PHxd22BtrHJQ3cVm+V86mw==
> =gcVU
> -----END PGP SIGNATURE-----
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: axis-dev-unsubscribe@ws.apache.org
> For additional commands, e-mail: axis-dev-help@ws.apache.org
>
Unless stated otherwise above:
IBM United Kingdom Limited - Registered in England and Wales with number
741598.
Registered office: PO Box 41, North Harbour, Portsmouth, Hampshire PO6 3AU
Re: svn commit: r628471 - in /webservices/axis2/trunk/java/modules:
jaxws/src/org/apache/axis2/jaxws/ jaxws/src/org/apache/axis2/jaxws/addressing/
jaxws/src/org/apache/axis2/jaxws/addressing/factory/ jaxws/src/org/apache/axis2/jaxws/addressing/factory/impl...
Posted by Davanum Srinivas <da...@gmail.com>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Brian,
Could you please add a few bullet points next time? (just to get a quick flavor of what the checkin is all about).
thanks,
dims
pradine@apache.org wrote:
| Author: pradine
| Date: Sun Feb 17 02:32:45 2008
| New Revision: 628471
|
| URL: http://svn.apache.org/viewvc?rev=628471&view=rev
| Log:
| Various JAX-WS 2.1 related improvements.
|
| Added:
| webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/Constants.java (with props)
| webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/addressing/factory/impl/
|
webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/addressing/factory/impl/Axis2EndpointReferenceFactoryImpl.java
| - copied, changed from r628167,
webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/addressing/factory/Axis2EndpointReferenceFactoryImpl.java
|
webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/addressing/factory/impl/JAXWSEndpointReferenceFactoryImpl.java
| - copied, changed from r628167,
webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/addressing/factory/JAXWSEndpointReferenceFactoryImpl.java
| webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/addressing/migrator/
|
webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/addressing/migrator/EndpointContextMapMigrator.java
(with props)
| webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/addressing/util/EndpointContextMap.java
(with props)
|
webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/addressing/util/EndpointContextMapManager.java
(with props)
| Removed:
|
webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/addressing/factory/Axis2EndpointReferenceFactoryImpl.java
|
webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/addressing/factory/JAXWSEndpointReferenceFactoryImpl.java
| webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/addressing/util/EndpointMap.java
| webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/addressing/util/EndpointMapManager.java
| Modified:
|
webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/addressing/SubmissionEndpointReferenceBuilder.java
|
webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/addressing/factory/Axis2EndpointReferenceFactory.java
|
webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/addressing/factory/JAXWSEndpointReferenceFactory.java
| webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/addressing/util/EndpointKey.java
| webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/addressing/util/EndpointReferenceUtils.java
| webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/registry/ClientConfiguratorRegistry.java
| webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/registry/FactoryRegistry.java
| webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/server/EndpointController.java
| webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/spi/Provider.java
| webservices/axis2/trunk/java/modules/metadata/src/org/apache/axis2/jaxws/feature/ServerFramework.java
|
| Added: webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/Constants.java
| URL:
http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/Constants.java?rev=628471&view=auto
| ==============================================================================
| --- webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/Constants.java (added)
| +++ webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/Constants.java Sun Feb 17 02:32:45 2008
| @@ -0,0 +1,28 @@
| +/*
| + * 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.axis2.jaxws;
| +
| +/**
| + * Constants that apply to the JAX-WS implementation.
| + *
| + */
| +public interface Constants {
| + public static final String ENDPOINT_CONTEXT_MAP =
| + "org.apache.axis2.jaxws.addressing.util.EndpointContextMap";
| +}
|
| Propchange: webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/Constants.java
| ------------------------------------------------------------------------------
| svn:eol-style = native
|
| Modified:
webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/addressing/SubmissionEndpointReferenceBuilder.java
| URL:
http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/addressing/SubmissionEndpointReferenceBuilder.java?rev=628471&r1=628470&r2=628471&view=diff
| ==============================================================================
| ---
webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/addressing/SubmissionEndpointReferenceBuilder.java
(original)
| +++
webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/addressing/SubmissionEndpointReferenceBuilder.java
Sun Feb 17 02:32:45 2008
| @@ -28,6 +28,11 @@
| import org.apache.axis2.jaxws.addressing.util.EndpointReferenceUtils;
| import org.w3c.dom.Element;
|
| +/**
| + * This class can be used to create instances of {@link SubmissionEndpointReference}.
| + *
| + * @see javax.xml.ws.wsaddressing.W3CEndpointReferenceBuilder
| + */
| public final class SubmissionEndpointReferenceBuilder {
| private static final Element[] ZERO_LENGTH_ARRAY = new Element[0];
|
| @@ -38,19 +43,45 @@
| private List<Element> referenceParameters;
| private QName portType;
|
| + /**
| + * Constructor
| + *
| + */
| public SubmissionEndpointReferenceBuilder() {
| }
|
| + /**
| + * Add the address URI to use.
| + *
| + * @param address the address URI
| + * @return an instance of <code>SubmissionEndpointReferenceBuilder</code> that has
| + * been updated as specified.
| + */
| public SubmissionEndpointReferenceBuilder address(String address) {
| this.address = address;
| return this;
| }
|
| + /**
| + * Add the WSDL service name of the endpoint that the endpoint reference will target.
| + *
| + * @param serviceName the WSDL service name
| + * @return an instance of <code>SubmissionEndpointReferenceBuilder</code> that has
| + * been updated as specified.
| + */
| public SubmissionEndpointReferenceBuilder serviceName(QName serviceName) {
| this.serviceName = serviceName;
| return this;
| }
|
| + /**
| + * Add the WSDL port name of the endpoint that the endpoint reference will target.
| + * The WSDL port name can only be set after the WSDL service name has been set.
| + *
| + * @param endpointName the WSDL port name
| + * @return an instance of <code>SubmissionEndpointReferenceBuilder</code> that has
| + * been updated as specified.
| + */
| public SubmissionEndpointReferenceBuilder endpointName(QName endpointName) {
| //TODO NLS enable
| if (this.serviceName == null) {
| @@ -61,11 +92,27 @@
| return this;
| }
|
| + /**
| + * Add the URI from where the WSDL for the endpoint that the endpoint reference will
| + * target can be retrieved.
| + *
| + * @param wsdlDocumentLocation the location URI of the WSDL
| + * @return an instance of <code>SubmissionEndpointReferenceBuilder</code> that has
| + * been updated as specified.
| + */
| public SubmissionEndpointReferenceBuilder wsdlDocumentLocation(String wsdlDocumentLocation) {
| this.wsdlDocumentLocation = wsdlDocumentLocation;
| return this;
| }
|
| + /**
| + * Add reference properties. These will appear in the endpoint reference as reference
| + * parameters.
| + *
| + * @param referenceProperty the reference property
| + * @return an instance of <code>SubmissionEndpointReferenceBuilder</code> that has
| + * been updated as specified.
| + */
| public SubmissionEndpointReferenceBuilder referenceProperty(Element referenceProperty) {
| //TODO NLS enable
| if (referenceProperty == null) {
| @@ -80,6 +127,13 @@
| return this;
| }
|
| + /**
| + * Add reference parameters.
| + *
| + * @param referenceParameter the reference parameter
| + * @return an instance of <code>SubmissionEndpointReferenceBuilder</code> that has
| + * been updated as specified.
| + */
| public SubmissionEndpointReferenceBuilder referenceParameter(Element referenceParameter) {
| //TODO NLS enable
| if (referenceParameter == null) {
| @@ -94,11 +148,24 @@
| return this;
| }
|
| + /**
| + * Add the name of the WSDL port type.
| + *
| + * @param portType the WSDL port type name
| + * @return an instance of <code>SubmissionEndpointReferenceBuilder</code> that has
| + * been updated as specified.
| + */
| public SubmissionEndpointReferenceBuilder portType(QName portType) {
| this.portType = portType;
| return this;
| }
|
| + /**
| + * Construct an instance of <code>EndpointReference</code> based on the values
| + * specified.
| + *
| + * @return an instance of <code>SubmissionEndpointReference</code>
| + */
| public SubmissionEndpointReference build() {
| SubmissionEndpointReference submissionEPR = null;
|
| @@ -108,8 +175,11 @@
| EndpointReferenceUtils.createAxis2EndpointReference(address, serviceName, endpointName,
wsdlDocumentLocation, addressingNamespace);
|
| try {
| - EndpointReferenceUtils.addReferenceParameters(axis2EPR, referenceParameters.toArray(ZERO_LENGTH_ARRAY));
| - EndpointReferenceUtils.addInterface(axis2EPR, portType, InterfaceName.subQName);
| + if (referenceParameters != null)
| + EndpointReferenceUtils.addReferenceParameters(axis2EPR, referenceParameters.toArray(ZERO_LENGTH_ARRAY));
| +
| + if (portType != null)
| + EndpointReferenceUtils.addInterface(axis2EPR, portType, InterfaceName.subQName);
|
| submissionEPR =
| (SubmissionEndpointReference) EndpointReferenceUtils.convertFromAxis2(axis2EPR, addressingNamespace);
|
| Modified:
webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/addressing/factory/Axis2EndpointReferenceFactory.java
| URL:
http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/addressing/factory/Axis2EndpointReferenceFactory.java?rev=628471&r1=628470&r2=628471&view=diff
| ==============================================================================
| ---
webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/addressing/factory/Axis2EndpointReferenceFactory.java
(original)
| +++
webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/addressing/factory/Axis2EndpointReferenceFactory.java
Sun Feb 17 02:32:45 2008
| @@ -4,10 +4,47 @@
|
| import org.apache.axis2.addressing.EndpointReference;
|
| +/**
| + * This class represents factories that can be use to create instances of
| + * {@link EndpointReference} that can ultimately be converted into instances
| + * of {@link javax.xml.ws.EndpointReference} that are suitable to be returned
| + * via the appropriate JAX-WS 2.1 API methods.
| + *
| + */
| public interface Axis2EndpointReferenceFactory {
| + /**
| + * Create an instance of <code>EndpointReference</code> with the specified address.
| + *
| + * @param address the address URI to use. It cannot be null.
| + * @return an instance of <code>EndpointReference</code>.
| + */
| public EndpointReference createEndpointReference(String address);
|
| + /**
| + * Create an instance of <code>EndpointReference</code> that targets the endpoint
| + * identified by the specified WSDL service name and endpoint name.
| + *
| + * @param serviceName the WSDL service name
| + * @param endpoint the WSDL port name
| + * @return an instance of <code>EndpointReference</code> that targets the specified
| + * endpoint
| + */
| public EndpointReference createEndpointReference(QName serviceName, QName endpoint);
|
| + /**
| + * Create an instance of <code>EndpointReference</code>. If the address is specified
| + * then it will be used. If the address is null, but the WSDL service name and port
| + * name are specified then they will be used to target the specified endpoint. Either
| + * the address URI, or the WSDL service name and port name must be specified.
| + *
| + * @param address the address URI to use, if specified
| + * @param serviceName the WSDL service name, if specified
| + * @param portName the WSDL port name, if specified
| + * @param wsdlDocumentLocation the URI from where the WSDL for the endpoint can be
| + * retrieved, if specified.
| + * @param addressingNamespace the intended WS-Addressing namespace that the <code>
| + * EndpointRefence</code> should comply with.
| + * @return an instance of <code>EndpointReference</code>.
| + */
| public EndpointReference createEndpointReference(String address, QName serviceName, QName portName, String
wsdlDocumentLocation, String addressingNamespace);
| }
|
| Modified:
webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/addressing/factory/JAXWSEndpointReferenceFactory.java
| URL:
http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/addressing/factory/JAXWSEndpointReferenceFactory.java?rev=628471&r1=628470&r2=628471&view=diff
| ==============================================================================
| ---
webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/addressing/factory/JAXWSEndpointReferenceFactory.java
(original)
| +++
webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/addressing/factory/JAXWSEndpointReferenceFactory.java
Sun Feb 17 02:32:45 2008
| @@ -22,8 +22,25 @@
| import javax.xml.transform.Source;
| import javax.xml.ws.EndpointReference;
|
| +/**
| + * This class represents factories that can be used to generate instances of the
| + * {@link EndpointReference}.
| + */
| public interface JAXWSEndpointReferenceFactory {
| + /**
| + * Create an instance of a supported subclass of <code>EndpointReference</code>.
| + *
| + * @param eprInfoset the endpoint reference
| + * @return an instance of <code>EndpointReference</code>.
| + * @throws JAXBException
| + */
| public EndpointReference createEndpointReference(Source eprInfoset) throws JAXBException;
|
| + /**
| + * Map the specified class to a supported WS-Addressing namespace.
| + *
| + * @param clazz the class.
| + * @return the WS-Addressing namespace that is associated with the class.
| + */
| public String getAddressingNamespace(Class clazz);
| }
|
| Copied:
webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/addressing/factory/impl/Axis2EndpointReferenceFactoryImpl.java
(from r628167,
webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/addressing/factory/Axis2EndpointReferenceFactoryImpl.java)
| URL:
http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/addressing/factory/impl/Axis2EndpointReferenceFactoryImpl.java?p2=webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/addressing/factory/impl/Axis2EndpointReferenceFactoryImpl.java&p1=webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/addressing/factory/Axis2EndpointReferenceFactoryImpl.java&r1=628167&r2=628471&rev=628471&view=diff
| ==============================================================================
| ---
webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/addressing/factory/Axis2EndpointReferenceFactoryImpl.java
(original)
| +++
webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/addressing/factory/impl/Axis2EndpointReferenceFactoryImpl.java
Sun Feb 17 02:32:45 2008
| @@ -16,7 +16,7 @@
| * specific language governing permissions and limitations
| * under the License.
| */
| -package org.apache.axis2.jaxws.addressing.factory;
| +package org.apache.axis2.jaxws.addressing.factory.impl;
|
| import java.net.URL;
|
| @@ -27,32 +27,49 @@
| import org.apache.axis2.addressing.metadata.ServiceName;
| import org.apache.axis2.addressing.metadata.WSDLLocation;
| import org.apache.axis2.jaxws.ExceptionFactory;
| +import org.apache.axis2.jaxws.addressing.factory.Axis2EndpointReferenceFactory;
| import org.apache.axis2.jaxws.addressing.util.EndpointKey;
| -import org.apache.axis2.jaxws.addressing.util.EndpointMap;
| -import org.apache.axis2.jaxws.addressing.util.EndpointMapManager;
| +import org.apache.axis2.jaxws.addressing.util.EndpointContextMap;
| +import org.apache.axis2.jaxws.addressing.util.EndpointContextMapManager;
| import org.apache.axis2.jaxws.util.WSDL4JWrapper;
| import org.apache.axis2.jaxws.util.WSDLWrapper;
|
| +/**
| + * This class produces instances of {@link EndpointReference}.
| + *
| + */
| public class Axis2EndpointReferenceFactoryImpl implements Axis2EndpointReferenceFactory {
| public Axis2EndpointReferenceFactoryImpl() {
| super();
| }
|
| + /*
| + * (non-Javadoc)
| + * @see
org.apache.axis2.jaxws.addressing.factory.Axis2EndpointReferenceFactory#createEndpointReference(java.lang.String)
| + */
| public EndpointReference createEndpointReference(String address) {
| if (address == null)
| throw new IllegalStateException("The endpoint address URI is null.");
|
| return new EndpointReference(address);
| }
| -
| +
| + /*
| + * (non-Javadoc)
| + * @see
org.apache.axis2.jaxws.addressing.factory.Axis2EndpointReferenceFactory#createEndpointReference(javax.xml.namespace.QName,
javax.xml.namespace.QName)
| + */
| public EndpointReference createEndpointReference(QName serviceName, QName endpoint) {
| EndpointKey key = new EndpointKey(serviceName, endpoint);
| - EndpointMap map = EndpointMapManager.getEndpointMap();
| - String address = map.get(key);
| + EndpointContextMap map = EndpointContextMapManager.getEndpointContextMap();
| + String address = (String) map.get(key);
|
| return createEndpointReference(address);
| }
| -
| +
| + /*
| + * (non-Javadoc)
| + * @see
org.apache.axis2.jaxws.addressing.factory.Axis2EndpointReferenceFactory#createEndpointReference(java.lang.String,
javax.xml.namespace.QName, javax.xml.namespace.QName, java.lang.String, java.lang.String)
| + */
| public EndpointReference createEndpointReference(String address, QName serviceName, QName portName, String
wsdlDocumentLocation, String addressingNamespace) {
| EndpointReference axis2EPR = null;
|
| @@ -71,10 +88,13 @@
| throw new IllegalStateException("Cannot create an endpoint reference because the address, service name,
and/or port name are null.");
| }
|
| + //TODO If no service name and port name are specified, but the wsdl location is
| + //specified, and the WSDL only contains one service and one port then maybe we
| + //should simply use those.
| try {
| - //TODO If no service name and port name are specified, but the wsdl location is
| - //specified, and the WSDL only contains one service and one port then maybe we
| - //should simply use those.
| + //This code is locate here instead of in the createEndpointReference(QName, QName)
| + //method so that if the address is also specified the EPR metadata will still be
| + //filled in correctly.
| if (serviceName != null && portName != null) {
| ServiceName service = new ServiceName(serviceName, portName.getLocalPart());
| EndpointReferenceHelper.setServiceNameMetadata(axis2EPR, addressingNamespace, service);
| @@ -103,7 +123,7 @@
| }
| }
|
| - //TODO NLS
| + //TODO NLS enable
| if (!found)
| throw new IllegalStateException("The specified port name does not exist in the specified WSDL
service.");
| }
|
| Copied:
webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/addressing/factory/impl/JAXWSEndpointReferenceFactoryImpl.java
(from r628167,
webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/addressing/factory/JAXWSEndpointReferenceFactoryImpl.java)
| URL:
http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/addressing/factory/impl/JAXWSEndpointReferenceFactoryImpl.java?p2=webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/addressing/factory/impl/JAXWSEndpointReferenceFactoryImpl.java&p1=webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/addressing/factory/JAXWSEndpointReferenceFactoryImpl.java&r1=628167&r2=628471&rev=628471&view=diff
| ==============================================================================
| ---
webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/addressing/factory/JAXWSEndpointReferenceFactoryImpl.java
(original)
| +++
webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/addressing/factory/impl/JAXWSEndpointReferenceFactoryImpl.java
Sun Feb 17 02:32:45 2008
| @@ -16,7 +16,7 @@
| * specific language governing permissions and limitations
| * under the License.
| */
| -package org.apache.axis2.jaxws.addressing.factory;
| +package org.apache.axis2.jaxws.addressing.factory.impl;
|
| import javax.xml.bind.JAXBContext;
| import javax.xml.bind.JAXBException;
| @@ -30,10 +30,21 @@
| import org.apache.axis2.addressing.AddressingConstants.Submission;
| import org.apache.axis2.jaxws.ExceptionFactory;
| import org.apache.axis2.jaxws.addressing.SubmissionEndpointReference;
| +import org.apache.axis2.jaxws.addressing.factory.JAXWSEndpointReferenceFactory;
|
| +/**
| + * This class is used to generate instances of the following subclasses of
| + * {@link EndpointReference}.
| + *
| + * @see javax.xml.ws.wsaddressing.W3CEndpointReference
| + * @see org.apache.axis2.jaxws.addressing.SubmissionEndpointReference
| + */
| public class JAXWSEndpointReferenceFactoryImpl implements JAXWSEndpointReferenceFactory {
| private JAXBContext jaxbContext;
|
| + /**
| + * Constructor
| + */
| public JAXWSEndpointReferenceFactoryImpl() {
| super();
|
| @@ -47,12 +58,19 @@
| }
| }
|
| + /*
| + * (non-Javadoc)
| + * @see
org.apache.axis2.jaxws.addressing.factory.JAXWSEndpointReferenceFactory#createEndpointReference(javax.xml.transform.Source)
| + */
| public EndpointReference createEndpointReference(Source eprInfoset) throws JAXBException {
| Unmarshaller um = jaxbContext.createUnmarshaller();
| -
| return (EndpointReference) um.unmarshal(eprInfoset);
| }
|
| + /*
| + * (non-Javadoc)
| + * @see
org.apache.axis2.jaxws.addressing.factory.JAXWSEndpointReferenceFactory#getAddressingNamespace(java.lang.Class)
| + */
| public String getAddressingNamespace(Class clazz) {
| String addressingNamespace = null;
|
|
| Added:
webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/addressing/migrator/EndpointContextMapMigrator.java
| URL:
http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/addressing/migrator/EndpointContextMapMigrator.java?rev=628471&view=auto
| ==============================================================================
| ---
webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/addressing/migrator/EndpointContextMapMigrator.java
(added)
| +++
webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/addressing/migrator/EndpointContextMapMigrator.java
Sun Feb 17 02:32:45 2008
| @@ -0,0 +1,118 @@
| +/*
| + * 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.axis2.jaxws.addressing.migrator;
| +
| +import org.apache.axis2.AxisFault;
| +import org.apache.axis2.context.MessageContext;
| +import org.apache.axis2.description.AxisOperation;
| +import org.apache.axis2.description.Parameter;
| +import org.apache.axis2.engine.AxisConfiguration;
| +import org.apache.axis2.jaxws.Constants;
| +import org.apache.axis2.jaxws.ExceptionFactory;
| +import org.apache.axis2.jaxws.addressing.util.EndpointContextMap;
| +import org.apache.axis2.jaxws.addressing.util.EndpointContextMapManager;
| +import org.apache.axis2.util.ThreadContextMigrator;
| +import org.apache.axis2.util.Utils;
| +import org.apache.axis2.wsdl.WSDLConstants;
| +
| +/**
| + * This class will enable the JAX-WS 2.1 API methods to create instances of
| + * {@link javax.xml.ws.EndpointReference} that target a particular web service
| + * endpoint, identified by specifying the WSDL service name and port name of the
| + * endpoint, to work correctly. This is achieved by enabling the implementation of
| + * {@link org.apache.axis2.jaxws.addressing.factory.Axis2EndpointReferenceFactory}
| + * to retrieve the context it needs from the invoking thread. The instances of
| + * {@link org.apache.axis2.addressing.EndpointReference} that it produces can
| + * then converted to instances of {@link javax.xml.ws.EndpointReference}, as
| + * needed.
| + *
| + */
| +public class EndpointContextMapMigrator implements ThreadContextMigrator {
| +
| + /* (non-Javadoc)
| + * @see org.apache.axis2.util.ThreadContextMigrator#migrateContextToThread(org.apache.axis2.context.MessageContext)
| + */
| + public void migrateContextToThread(MessageContext messageContext)
| + throws AxisFault {
| + //Only make the context map available if we have an inbound request
| + //message, in the server.
| + AxisOperation axisOperation = messageContext.getAxisOperation();
| + String mep = axisOperation.getMessageExchangePattern();
| + int mepConstant = Utils.getAxisSpecifMEPConstant(mep);
| +
| + if (mepConstant == WSDLConstants.MEP_CONSTANT_IN_ONLY ||
| + mepConstant == WSDLConstants.MEP_CONSTANT_IN_OUT ||
| + mepConstant == WSDLConstants.MEP_CONSTANT_IN_OPTIONAL_OUT ||
| + mepConstant == WSDLConstants.MEP_CONSTANT_ROBUST_IN_ONLY)
| + {
| + AxisConfiguration axisConfig = axisOperation.getAxisConfiguration();
| + Parameter param = axisConfig.getParameter(Constants.ENDPOINT_CONTEXT_MAP);
| +
| + if (param != null) {
| + EndpointContextMap map = (EndpointContextMap) param.getValue();
| +
| + if (map != null) {
| + EndpointContextMapManager.setEndpointContextMap(map);
| + }
| + else {
| + //TODO NLS enable.
| + throw ExceptionFactory.makeWebServiceException("The endpoint context map is null.");
| + }
| + }
| + else {
| + //TODO NLS enable.
| + throw ExceptionFactory.makeWebServiceException("Unable to locate endpoint context map.");
| + }
| + }
| + }
| +
| + /* (non-Javadoc)
| + * @see org.apache.axis2.util.ThreadContextMigrator#cleanupThread(org.apache.axis2.context.MessageContext)
| + */
| + public void cleanupThread(MessageContext messageContext) {
| + //Only clean up if we are inbound to the server.
| + AxisOperation axisOperation = messageContext.getAxisOperation();
| + String mep = axisOperation.getMessageExchangePattern();
| + int mepConstant = Utils.getAxisSpecifMEPConstant(mep);
| +
| + if (mepConstant == WSDLConstants.MEP_CONSTANT_IN_ONLY ||
| + mepConstant == WSDLConstants.MEP_CONSTANT_IN_OUT ||
| + mepConstant == WSDLConstants.MEP_CONSTANT_IN_OPTIONAL_OUT ||
| + mepConstant == WSDLConstants.MEP_CONSTANT_ROBUST_IN_ONLY)
| + {
| + EndpointContextMapManager.setEndpointContextMap(null);
| + }
| + }
| +
| + /* (non-Javadoc)
| + * @see org.apache.axis2.util.ThreadContextMigrator#migrateThreadToContext(org.apache.axis2.context.MessageContext)
| + */
| + public void migrateThreadToContext(MessageContext messageContext)
| + throws AxisFault {
| + //Nothing to do.
| + }
| +
| + /* (non-Javadoc)
| + * @see org.apache.axis2.util.ThreadContextMigrator#cleanupContext(org.apache.axis2.context.MessageContext)
| + */
| + public void cleanupContext(MessageContext messageContext) {
| + //Nothing to do.
| + }
| +
| +}
|
| Propchange:
webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/addressing/migrator/EndpointContextMapMigrator.java
| ------------------------------------------------------------------------------
| svn:eol-style = native
|
| Added: webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/addressing/util/EndpointContextMap.java
| URL:
http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/addressing/util/EndpointContextMap.java?rev=628471&view=auto
| ==============================================================================
| --- webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/addressing/util/EndpointContextMap.java (added)
| +++ webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/addressing/util/EndpointContextMap.java Sun
Feb 17 02:32:45 2008
| @@ -0,0 +1,38 @@
| +/*
| + * 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.axis2.jaxws.addressing.util;
| +
| +import java.util.concurrent.ConcurrentHashMap;
| +
| +import org.apache.axis2.jaxws.addressing.util.EndpointKey;
| +
| +/**
| + * This class stores the context needed to correctly produce instances of
| + * {@link javax.xml.ws.EndpointReference} for a particular web service endpoint
| + * identified by an {@link EndpointKey}.
| + *
| + */
| +public class EndpointContextMap extends ConcurrentHashMap<EndpointKey, Object> {
| +
| + private static final long serialVersionUID = 694539734825500599L;
| +
| + public EndpointContextMap() {
| + super();
| + }
| +}
|
| Propchange: webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/addressing/util/EndpointContextMap.java
| ------------------------------------------------------------------------------
| svn:eol-style = native
|
| Added:
webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/addressing/util/EndpointContextMapManager.java
| URL:
http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/addressing/util/EndpointContextMapManager.java?rev=628471&view=auto
| ==============================================================================
| ---
webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/addressing/util/EndpointContextMapManager.java (added)
| +++
webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/addressing/util/EndpointContextMapManager.java Sun
Feb 17 02:32:45 2008
| @@ -0,0 +1,50 @@
| +/*
| + * 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.axis2.jaxws.addressing.util;
| +
| +/**
| + * This class is used to manage the association between an {@link EndpointContextMap}
| + * and a thread.
| + */
| +public class EndpointContextMapManager {
| + private static ThreadLocal<EndpointContextMap> variable =
| + new InheritableThreadLocal<EndpointContextMap>();
| +
| + public static EndpointContextMap setEndpointContextMap(EndpointContextMap newMap) {
| + EndpointContextMap oldMap = variable.get();
| + variable.set(newMap);
| +
| + return oldMap;
| + }
| +
| + public static EndpointContextMap getEndpointContextMap() {
| + EndpointContextMap currentMap = variable.get();
| +
| + if (currentMap == null) {
| + currentMap = getDefaultEndpointMap();
| + setEndpointContextMap(currentMap);
| + }
| +
| + return currentMap;
| + }
| +
| + private static EndpointContextMap getDefaultEndpointMap() {
| + return new EndpointContextMap();
| + }
| +}
|
| Propchange:
webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/addressing/util/EndpointContextMapManager.java
| ------------------------------------------------------------------------------
| svn:eol-style = native
|
| Modified: webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/addressing/util/EndpointKey.java
| URL:
http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/addressing/util/EndpointKey.java?rev=628471&r1=628470&r2=628471&view=diff
| ==============================================================================
| --- webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/addressing/util/EndpointKey.java (original)
| +++ webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/addressing/util/EndpointKey.java Sun Feb 17
02:32:45 2008
| @@ -20,6 +20,11 @@
|
| import javax.xml.namespace.QName;
|
| +/**
| + * This class is used to identify a particular web service endpoint based on
| + * the combination of WSDL service name and port name.
| + *
| + */
| public class EndpointKey {
| private final QName service;
| private final QName endpoint;
|
| Modified:
webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/addressing/util/EndpointReferenceUtils.java
| URL:
http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/addressing/util/EndpointReferenceUtils.java?rev=628471&r1=628470&r2=628471&view=diff
| ==============================================================================
| --- webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/addressing/util/EndpointReferenceUtils.java
(original)
| +++ webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/addressing/util/EndpointReferenceUtils.java
Sun Feb 17 02:32:45 2008
| @@ -41,10 +41,6 @@
| public final class EndpointReferenceUtils {
|
| private static OMFactory omFactory = OMAbstractFactory.getOMFactory();
| - private static JAXWSEndpointReferenceFactory jaxwsEPRFactory =
| - (JAXWSEndpointReferenceFactory) FactoryRegistry.getFactory(JAXWSEndpointReferenceFactory.class);
| - private static Axis2EndpointReferenceFactory axis2EPRFactory =
| - (Axis2EndpointReferenceFactory) FactoryRegistry.getFactory(Axis2EndpointReferenceFactory.class);
|
| private EndpointReferenceUtils() {
| }
| @@ -66,8 +62,10 @@
| EndpointReferenceHelper.toOM(omFactory, axis2EPR, qname, addressingNamespace);
| Element eprElement = XMLUtils.toDOM(omElement);
| Source eprInfoset = new DOMSource(eprElement);
| + JAXWSEndpointReferenceFactory factory = (JAXWSEndpointReferenceFactory)
| + FactoryRegistry.getFactory(JAXWSEndpointReferenceFactory.class);
|
| - return jaxwsEPRFactory.createEndpointReference(eprInfoset);
| + return factory.createEndpointReference(eprInfoset);
| }
|
| /**
| @@ -82,7 +80,10 @@
| */
| public static javax.xml.ws.EndpointReference convertFromSource(Source eprInfoset)
| throws Exception {
| - return jaxwsEPRFactory.createEndpointReference(eprInfoset);
| + JAXWSEndpointReferenceFactory factory = (JAXWSEndpointReferenceFactory)
| + FactoryRegistry.getFactory(JAXWSEndpointReferenceFactory.class);
| +
| + return factory.createEndpointReference(eprInfoset);
| }
|
| /**
| @@ -105,15 +106,24 @@
| }
|
| public static String getAddressingNamespace(Class clazz) {
| - return jaxwsEPRFactory.getAddressingNamespace(clazz);
| + JAXWSEndpointReferenceFactory factory = (JAXWSEndpointReferenceFactory)
| + FactoryRegistry.getFactory(JAXWSEndpointReferenceFactory.class);
| +
| + return factory.getAddressingNamespace(clazz);
| }
|
| public static EndpointReference createAxis2EndpointReference(String address, QName serviceName, QName portName,
String wsdlDocumentLocation, String addressingNamespace) {
| - return axis2EPRFactory.createEndpointReference(address, serviceName, portName, wsdlDocumentLocation,
addressingNamespace);
| + Axis2EndpointReferenceFactory factory = (Axis2EndpointReferenceFactory)
| + FactoryRegistry.getFactory(Axis2EndpointReferenceFactory.class);
| +
| + return factory.createEndpointReference(address, serviceName, portName, wsdlDocumentLocation,
addressingNamespace);
| }
|
| public static EndpointReference createAxis2EndpointReference(String address) {
| - return axis2EPRFactory.createEndpointReference(address);
| + Axis2EndpointReferenceFactory factory = (Axis2EndpointReferenceFactory)
| + FactoryRegistry.getFactory(Axis2EndpointReferenceFactory.class);
| +
| + return factory.createEndpointReference(address);
| }
|
| public static void addReferenceParameters(EndpointReference axis2EPR, Element...referenceParameters)
| @@ -140,8 +150,7 @@
| throws Exception {
| if (portType != null) {
| InterfaceName interfaceName = new InterfaceName(portType);
| - OMFactory factory = OMAbstractFactory.getOMFactory();
| - OMElement omElement = interfaceName.toOM(interfaceType, factory);
| + OMElement omElement = interfaceName.toOM(interfaceType, omFactory);
| axis2EPR.addExtensibleElement(omElement);
| }
| }
|
| Modified: webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/registry/ClientConfiguratorRegistry.java
| URL:
http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/registry/ClientConfiguratorRegistry.java?rev=628471&r1=628470&r2=628471&view=diff
| ==============================================================================
| --- webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/registry/ClientConfiguratorRegistry.java
(original)
| +++ webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/registry/ClientConfiguratorRegistry.java Sun
Feb 17 02:32:45 2008
| @@ -18,9 +18,9 @@
| */
| package org.apache.axis2.jaxws.registry;
|
| -import java.util.HashMap;
| import java.util.Map;
| import java.util.Set;
| +import java.util.concurrent.ConcurrentHashMap;
|
| import javax.xml.ws.RespectBindingFeature;
| import javax.xml.ws.soap.AddressingFeature;
| @@ -34,7 +34,7 @@
|
| public class ClientConfiguratorRegistry {
| private static Map<String, ClientConfigurator> map =
| - new HashMap<String, ClientConfigurator>();
| + new ConcurrentHashMap<String, ClientConfigurator>();
|
| static {
| map.put(AddressingFeature.ID, new AddressingConfigurator());
|
| Modified: webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/registry/FactoryRegistry.java
| URL:
http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/registry/FactoryRegistry.java?rev=628471&r1=628470&r2=628471&view=diff
| ==============================================================================
| --- webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/registry/FactoryRegistry.java (original)
| +++ webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/registry/FactoryRegistry.java Sun Feb 17
02:32:45 2008
| @@ -20,9 +20,9 @@
| package org.apache.axis2.jaxws.registry;
|
| import org.apache.axis2.jaxws.addressing.factory.Axis2EndpointReferenceFactory;
| -import org.apache.axis2.jaxws.addressing.factory.Axis2EndpointReferenceFactoryImpl;
| import org.apache.axis2.jaxws.addressing.factory.JAXWSEndpointReferenceFactory;
| -import org.apache.axis2.jaxws.addressing.factory.JAXWSEndpointReferenceFactoryImpl;
| +import org.apache.axis2.jaxws.addressing.factory.impl.Axis2EndpointReferenceFactoryImpl;
| +import org.apache.axis2.jaxws.addressing.factory.impl.JAXWSEndpointReferenceFactoryImpl;
| import org.apache.axis2.jaxws.core.controller.InvocationControllerFactory;
| import org.apache.axis2.jaxws.core.controller.impl.InvocationControllerFactoryImpl;
| import org.apache.axis2.jaxws.handler.factory.HandlerInvokerFactory;
|
| Modified: webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/server/EndpointController.java
| URL:
http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/server/EndpointController.java?rev=628471&r1=628470&r2=628471&view=diff
| ==============================================================================
| --- webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/server/EndpointController.java (original)
| +++ webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/server/EndpointController.java Sun Feb 17
02:32:45 2008
| @@ -26,8 +26,8 @@
| import org.apache.axis2.java.security.AccessController;
| import org.apache.axis2.jaxws.ExceptionFactory;
| import org.apache.axis2.jaxws.addressing.util.EndpointKey;
| -import org.apache.axis2.jaxws.addressing.util.EndpointMap;
| -import org.apache.axis2.jaxws.addressing.util.EndpointMapManager;
| +import org.apache.axis2.jaxws.addressing.util.EndpointContextMap;
| +import org.apache.axis2.jaxws.addressing.util.EndpointContextMapManager;
| import org.apache.axis2.jaxws.core.MessageContext;
| import org.apache.axis2.jaxws.core.util.MessageContextUtils;
| import org.apache.axis2.jaxws.description.DescriptionFactory;
| @@ -405,10 +405,10 @@
| Parameter param = axisSvc.getParameter(EndpointDescription.AXIS_SERVICE_PARAMETER);
|
| EndpointDescription ed = (EndpointDescription)param.getValue();
| - param = axisSvc.getParameter(EndpointMap.class.getCanonicalName());
| + param = axisSvc.getParameter(EndpointContextMap.class.getCanonicalName());
| if(param != null) {
| - EndpointMap map = (EndpointMap) param.getValue();
| - EndpointMapManager.setEndpointMap(map);
| + EndpointContextMap map = (EndpointContextMap) param.getValue();
| + EndpointContextMapManager.setEndpointContextMap(map);
| }
|
| return ed;
| @@ -436,16 +436,16 @@
| QName endpoint = ed.getPortQName();
| EndpointKey key = new EndpointKey(service, endpoint);
| axisSvc = ed.getAxisService();
| - Parameter param = axisSvc.getParameter(EndpointMap.class.getCanonicalName());
| - EndpointMap map = null;
| + Parameter param = axisSvc.getParameter(EndpointContextMap.class.getCanonicalName());
| + EndpointContextMap map = null;
|
| if (param == null) {
| - map = EndpointMapManager.getEndpointMap();
| - axisSvc.addParameter(EndpointMap.class.getCanonicalName(), map);
| + map = EndpointContextMapManager.getEndpointContextMap();
| + axisSvc.addParameter(EndpointContextMap.class.getCanonicalName(), map);
| }
| else {
| - map = (EndpointMap) param.getValue();
| - EndpointMapManager.setEndpointMap(map);
| + map = (EndpointContextMap) param.getValue();
| + EndpointContextMapManager.setEndpointContextMap(map);
| }
|
| map.put(key, axisSvc.getEPRs()[0]);
|
| Modified: webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/spi/Provider.java
| URL:
http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/spi/Provider.java?rev=628471&r1=628470&r2=628471&view=diff
| ==============================================================================
| --- webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/spi/Provider.java (original)
| +++ webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/spi/Provider.java Sun Feb 17 02:32:45 2008
| @@ -74,8 +74,11 @@
| W3CEndpointReference w3cEPR = null;
|
| try {
| - EndpointReferenceUtils.addMetadata(axis2EPR, metadata.toArray(ZERO_LENGTH_ARRAY));
| - EndpointReferenceUtils.addReferenceParameters(axis2EPR, referenceParameters.toArray(ZERO_LENGTH_ARRAY));
| + if (metadata != null)
| + EndpointReferenceUtils.addMetadata(axis2EPR, metadata.toArray(ZERO_LENGTH_ARRAY));
| +
| + if (referenceParameters != null)
| + EndpointReferenceUtils.addReferenceParameters(axis2EPR, referenceParameters.toArray(ZERO_LENGTH_ARRAY));
|
| w3cEPR =
| (W3CEndpointReference) EndpointReferenceUtils.convertFromAxis2(axis2EPR, addressingNamespace);
|
| Modified: webservices/axis2/trunk/java/modules/metadata/src/org/apache/axis2/jaxws/feature/ServerFramework.java
| URL:
http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/metadata/src/org/apache/axis2/jaxws/feature/ServerFramework.java?rev=628471&r1=628470&r2=628471&view=diff
| ==============================================================================
| --- webservices/axis2/trunk/java/modules/metadata/src/org/apache/axis2/jaxws/feature/ServerFramework.java (original)
| +++ webservices/axis2/trunk/java/modules/metadata/src/org/apache/axis2/jaxws/feature/ServerFramework.java Sun Feb 17
02:32:45 2008
| @@ -25,7 +25,6 @@
|
| import java.lang.annotation.Annotation;
| import java.util.HashMap;
| -import java.util.IdentityHashMap;
| import java.util.Map;
|
| public class ServerFramework {
| @@ -48,8 +47,7 @@
| if (annotation == null)
| return false;
|
| - WebServiceFeatureAnnotation wsfAnnotation =
| - annotation.annotationType().getAnnotation(WebServiceFeatureAnnotation.class);
| + WebServiceFeatureAnnotation wsfAnnotation = getWebServiceFeatureAnnotation(annotation);
|
| String id = null;
| if (wsfAnnotation != null)
| @@ -63,8 +61,7 @@
| if (!isValid(annotation))
| throw ExceptionFactory.makeWebServiceException("Invalid or unsupported WebServiceFeature annotation, " +
annotation);
|
| - WebServiceFeatureAnnotation wsfAnnotation =
| - annotation.annotationType().getAnnotation(WebServiceFeatureAnnotation.class);
| + WebServiceFeatureAnnotation wsfAnnotation = getWebServiceFeatureAnnotation(annotation);
|
| annotationMap.put(wsfAnnotation.id(), annotation);
| }
| @@ -79,11 +76,13 @@
|
| public void configure(EndpointDescription endpointDescription) {
| for (Annotation annotation : getAllAnnotations()) {
| - WebServiceFeatureAnnotation wsfAnnotation =
| - annotation.annotationType().getAnnotation(WebServiceFeatureAnnotation.class);
| -
| + WebServiceFeatureAnnotation wsfAnnotation = getWebServiceFeatureAnnotation(annotation);
| ServerConfigurator configurator = configuratorMap.get(wsfAnnotation.id());
| configurator.configure(endpointDescription);
| }
| + }
| +
| + private WebServiceFeatureAnnotation getWebServiceFeatureAnnotation(Annotation annotation) {
| + return annotation.annotationType().getAnnotation(WebServiceFeatureAnnotation.class);
| }
| }
|
|
|
| ---------------------------------------------------------------------
| To unsubscribe, e-mail: axis-cvs-unsubscribe@ws.apache.org
| For additional commands, e-mail: axis-cvs-help@ws.apache.org
|
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.5 (Cygwin)
iD4DBQFHuEVIgNg6eWEDv1kRAvawAKCr+EAcb8/oAJphCNXYXYAFbv6EoQCYo9ZQ
PHxd22BtrHJQ3cVm+V86mw==
=gcVU
-----END PGP SIGNATURE-----
---------------------------------------------------------------------
To unsubscribe, e-mail: axis-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-dev-help@ws.apache.org