JBossWS SVN: r9456 - in stack/native/tags/jbossws-native-3.1.0.CR3: modules/client and 10 other directories.
by jbossws-commits@lists.jboss.org
Author: alessio.soldano(a)jboss.com
Date: 2009-02-28 10:42:42 -0500 (Sat, 28 Feb 2009)
New Revision: 9456
Modified:
stack/native/tags/jbossws-native-3.1.0.CR3/modules/client/pom.xml
stack/native/tags/jbossws-native-3.1.0.CR3/modules/core/pom.xml
stack/native/tags/jbossws-native-3.1.0.CR3/modules/jaxrpc/pom.xml
stack/native/tags/jbossws-native-3.1.0.CR3/modules/jaxws-ext/pom.xml
stack/native/tags/jbossws-native-3.1.0.CR3/modules/jaxws/pom.xml
stack/native/tags/jbossws-native-3.1.0.CR3/modules/management/pom.xml
stack/native/tags/jbossws-native-3.1.0.CR3/modules/resources/pom.xml
stack/native/tags/jbossws-native-3.1.0.CR3/modules/saaj/pom.xml
stack/native/tags/jbossws-native-3.1.0.CR3/modules/testsuite/framework-tests/pom.xml
stack/native/tags/jbossws-native-3.1.0.CR3/modules/testsuite/native-tests/pom.xml
stack/native/tags/jbossws-native-3.1.0.CR3/modules/testsuite/pom.xml
stack/native/tags/jbossws-native-3.1.0.CR3/pom.xml
Log:
Updating pom files to 3.1.0.CR3
Modified: stack/native/tags/jbossws-native-3.1.0.CR3/modules/client/pom.xml
===================================================================
--- stack/native/tags/jbossws-native-3.1.0.CR3/modules/client/pom.xml 2009-02-28 15:30:46 UTC (rev 9455)
+++ stack/native/tags/jbossws-native-3.1.0.CR3/modules/client/pom.xml 2009-02-28 15:42:42 UTC (rev 9456)
@@ -10,7 +10,7 @@
<parent>
<groupId>org.jboss.ws.native</groupId>
<artifactId>jbossws-native</artifactId>
- <version>3.1.0.GA</version>
+ <version>3.1.0.CR3</version>
<relativePath>../../pom.xml</relativePath>
</parent>
Modified: stack/native/tags/jbossws-native-3.1.0.CR3/modules/core/pom.xml
===================================================================
--- stack/native/tags/jbossws-native-3.1.0.CR3/modules/core/pom.xml 2009-02-28 15:30:46 UTC (rev 9455)
+++ stack/native/tags/jbossws-native-3.1.0.CR3/modules/core/pom.xml 2009-02-28 15:42:42 UTC (rev 9456)
@@ -10,7 +10,7 @@
<parent>
<groupId>org.jboss.ws.native</groupId>
<artifactId>jbossws-native</artifactId>
- <version>3.1.0.GA</version>
+ <version>3.1.0.CR3</version>
<relativePath>../../pom.xml</relativePath>
</parent>
Modified: stack/native/tags/jbossws-native-3.1.0.CR3/modules/jaxrpc/pom.xml
===================================================================
--- stack/native/tags/jbossws-native-3.1.0.CR3/modules/jaxrpc/pom.xml 2009-02-28 15:30:46 UTC (rev 9455)
+++ stack/native/tags/jbossws-native-3.1.0.CR3/modules/jaxrpc/pom.xml 2009-02-28 15:42:42 UTC (rev 9456)
@@ -10,7 +10,7 @@
<parent>
<groupId>org.jboss.ws.native</groupId>
<artifactId>jbossws-native</artifactId>
- <version>3.1.0.GA</version>
+ <version>3.1.0.CR3</version>
<relativePath>../../pom.xml</relativePath>
</parent>
Modified: stack/native/tags/jbossws-native-3.1.0.CR3/modules/jaxws/pom.xml
===================================================================
--- stack/native/tags/jbossws-native-3.1.0.CR3/modules/jaxws/pom.xml 2009-02-28 15:30:46 UTC (rev 9455)
+++ stack/native/tags/jbossws-native-3.1.0.CR3/modules/jaxws/pom.xml 2009-02-28 15:42:42 UTC (rev 9456)
@@ -10,7 +10,7 @@
<parent>
<groupId>org.jboss.ws.native</groupId>
<artifactId>jbossws-native</artifactId>
- <version>3.1.0.GA</version>
+ <version>3.1.0.CR3</version>
<relativePath>../../pom.xml</relativePath>
</parent>
Modified: stack/native/tags/jbossws-native-3.1.0.CR3/modules/jaxws-ext/pom.xml
===================================================================
--- stack/native/tags/jbossws-native-3.1.0.CR3/modules/jaxws-ext/pom.xml 2009-02-28 15:30:46 UTC (rev 9455)
+++ stack/native/tags/jbossws-native-3.1.0.CR3/modules/jaxws-ext/pom.xml 2009-02-28 15:42:42 UTC (rev 9456)
@@ -10,7 +10,7 @@
<parent>
<groupId>org.jboss.ws.native</groupId>
<artifactId>jbossws-native</artifactId>
- <version>3.1.0.GA</version>
+ <version>3.1.0.CR3</version>
<relativePath>../../pom.xml</relativePath>
</parent>
Modified: stack/native/tags/jbossws-native-3.1.0.CR3/modules/management/pom.xml
===================================================================
--- stack/native/tags/jbossws-native-3.1.0.CR3/modules/management/pom.xml 2009-02-28 15:30:46 UTC (rev 9455)
+++ stack/native/tags/jbossws-native-3.1.0.CR3/modules/management/pom.xml 2009-02-28 15:42:42 UTC (rev 9456)
@@ -9,7 +9,7 @@
<parent>
<groupId>org.jboss.ws.native</groupId>
<artifactId>jbossws-native</artifactId>
- <version>3.1.0.GA</version>
+ <version>3.1.0.CR3</version>
<relativePath>../../pom.xml</relativePath>
</parent>
Modified: stack/native/tags/jbossws-native-3.1.0.CR3/modules/resources/pom.xml
===================================================================
--- stack/native/tags/jbossws-native-3.1.0.CR3/modules/resources/pom.xml 2009-02-28 15:30:46 UTC (rev 9455)
+++ stack/native/tags/jbossws-native-3.1.0.CR3/modules/resources/pom.xml 2009-02-28 15:42:42 UTC (rev 9456)
@@ -10,7 +10,7 @@
<parent>
<groupId>org.jboss.ws.native</groupId>
<artifactId>jbossws-native</artifactId>
- <version>3.1.0.GA</version>
+ <version>3.1.0.CR3</version>
<relativePath>../../pom.xml</relativePath>
</parent>
Modified: stack/native/tags/jbossws-native-3.1.0.CR3/modules/saaj/pom.xml
===================================================================
--- stack/native/tags/jbossws-native-3.1.0.CR3/modules/saaj/pom.xml 2009-02-28 15:30:46 UTC (rev 9455)
+++ stack/native/tags/jbossws-native-3.1.0.CR3/modules/saaj/pom.xml 2009-02-28 15:42:42 UTC (rev 9456)
@@ -10,7 +10,7 @@
<parent>
<groupId>org.jboss.ws.native</groupId>
<artifactId>jbossws-native</artifactId>
- <version>3.1.0.GA</version>
+ <version>3.1.0.CR3</version>
<relativePath>../../pom.xml</relativePath>
</parent>
Modified: stack/native/tags/jbossws-native-3.1.0.CR3/modules/testsuite/framework-tests/pom.xml
===================================================================
--- stack/native/tags/jbossws-native-3.1.0.CR3/modules/testsuite/framework-tests/pom.xml 2009-02-28 15:30:46 UTC (rev 9455)
+++ stack/native/tags/jbossws-native-3.1.0.CR3/modules/testsuite/framework-tests/pom.xml 2009-02-28 15:42:42 UTC (rev 9456)
@@ -10,7 +10,7 @@
<parent>
<groupId>org.jboss.ws.native</groupId>
<artifactId>jbossws-native-testsuite</artifactId>
- <version>3.1.0.GA</version>
+ <version>3.1.0.CR3</version>
<relativePath>../pom.xml</relativePath>
</parent>
Modified: stack/native/tags/jbossws-native-3.1.0.CR3/modules/testsuite/native-tests/pom.xml
===================================================================
--- stack/native/tags/jbossws-native-3.1.0.CR3/modules/testsuite/native-tests/pom.xml 2009-02-28 15:30:46 UTC (rev 9455)
+++ stack/native/tags/jbossws-native-3.1.0.CR3/modules/testsuite/native-tests/pom.xml 2009-02-28 15:42:42 UTC (rev 9456)
@@ -10,7 +10,7 @@
<parent>
<groupId>org.jboss.ws.native</groupId>
<artifactId>jbossws-native-testsuite</artifactId>
- <version>3.1.0.GA</version>
+ <version>3.1.0.CR3</version>
<relativePath>../pom.xml</relativePath>
</parent>
Modified: stack/native/tags/jbossws-native-3.1.0.CR3/modules/testsuite/pom.xml
===================================================================
--- stack/native/tags/jbossws-native-3.1.0.CR3/modules/testsuite/pom.xml 2009-02-28 15:30:46 UTC (rev 9455)
+++ stack/native/tags/jbossws-native-3.1.0.CR3/modules/testsuite/pom.xml 2009-02-28 15:42:42 UTC (rev 9456)
@@ -10,7 +10,7 @@
<parent>
<groupId>org.jboss.ws.native</groupId>
<artifactId>jbossws-native</artifactId>
- <version>3.1.0.GA</version>
+ <version>3.1.0.CR3</version>
<relativePath>../../pom.xml</relativePath>
</parent>
Modified: stack/native/tags/jbossws-native-3.1.0.CR3/pom.xml
===================================================================
--- stack/native/tags/jbossws-native-3.1.0.CR3/pom.xml 2009-02-28 15:30:46 UTC (rev 9455)
+++ stack/native/tags/jbossws-native-3.1.0.CR3/pom.xml 2009-02-28 15:42:42 UTC (rev 9456)
@@ -18,7 +18,7 @@
<artifactId>jbossws-native</artifactId>
<packaging>pom</packaging>
- <version>3.1.0.GA</version>
+ <version>3.1.0.CR3</version>
<!-- Parent -->
<parent>
15 years, 9 months
JBossWS SVN: r9455 - stack/native/tags.
by jbossws-commits@lists.jboss.org
Author: alessio.soldano(a)jboss.com
Date: 2009-02-28 10:30:46 -0500 (Sat, 28 Feb 2009)
New Revision: 9455
Added:
stack/native/tags/jbossws-native-3.1.0.CR3/
Log:
Tagging jbossws-native-3.1.0.CR3
Copied: stack/native/tags/jbossws-native-3.1.0.CR3 (from rev 9454, stack/native/branches/jbossws-native-3.1.0)
15 years, 9 months
JBossWS SVN: r9454 - framework/trunk.
by jbossws-commits@lists.jboss.org
Author: alessio.soldano(a)jboss.com
Date: 2009-02-28 10:28:31 -0500 (Sat, 28 Feb 2009)
New Revision: 9454
Modified:
framework/trunk/pom.xml
Log:
Move to jbossws-common 1.0.10-SNAPSHOT
Modified: framework/trunk/pom.xml
===================================================================
--- framework/trunk/pom.xml 2009-02-28 15:27:48 UTC (rev 9453)
+++ framework/trunk/pom.xml 2009-02-28 15:28:31 UTC (rev 9454)
@@ -25,7 +25,7 @@
<!-- Properties -->
<properties>
- <jbossws.common.version>1.0.9-SNAPSHOT</jbossws.common.version>
+ <jbossws.common.version>1.0.10-SNAPSHOT</jbossws.common.version>
<jbossws.spi.version>1.1.0-SNAPSHOT</jbossws.spi.version>
<jboss.common.version>1.2.1.GA</jboss.common.version>
<jbossxb.version>1.0.0.SP1</jbossxb.version>
15 years, 9 months
JBossWS SVN: r9453 - stack/cxf/trunk.
by jbossws-commits@lists.jboss.org
Author: alessio.soldano(a)jboss.com
Date: 2009-02-28 10:27:48 -0500 (Sat, 28 Feb 2009)
New Revision: 9453
Modified:
stack/cxf/trunk/pom.xml
Log:
Move to jbossws-common 1.0.10-SNAPSHOT
Modified: stack/cxf/trunk/pom.xml
===================================================================
--- stack/cxf/trunk/pom.xml 2009-02-28 15:27:09 UTC (rev 9452)
+++ stack/cxf/trunk/pom.xml 2009-02-28 15:27:48 UTC (rev 9453)
@@ -44,7 +44,7 @@
<!-- Properties -->
<properties>
- <jbossws.common.version>1.0.9.GA</jbossws.common.version>
+ <jbossws.common.version>1.0.10-SNAPSHOT</jbossws.common.version>
<jbossws.framework.version>3.1.1-SNAPSHOT</jbossws.framework.version>
<jbossws.spi.version>1.1.1-SNAPSHOT</jbossws.spi.version>
<jbossws.jboss423.version>3.1.0.GA</jbossws.jboss423.version>
15 years, 9 months
JBossWS SVN: r9452 - stack/native/trunk.
by jbossws-commits@lists.jboss.org
Author: alessio.soldano(a)jboss.com
Date: 2009-02-28 10:27:09 -0500 (Sat, 28 Feb 2009)
New Revision: 9452
Modified:
stack/native/trunk/pom.xml
Log:
Move to jbossws-common 1.0.10-SNAPSHOT
Modified: stack/native/trunk/pom.xml
===================================================================
--- stack/native/trunk/pom.xml 2009-02-28 15:24:46 UTC (rev 9451)
+++ stack/native/trunk/pom.xml 2009-02-28 15:27:09 UTC (rev 9452)
@@ -48,7 +48,7 @@
<!-- Properties -->
<properties>
- <jbossws.common.version>1.0.9.GA</jbossws.common.version>
+ <jbossws.common.version>1.0.10-SNAPSHOT</jbossws.common.version>
<jbossws.framework.version>3.1.1-SNAPSHOT</jbossws.framework.version>
<jbossws.spi.version>1.1.1-SNAPSHOT</jbossws.spi.version>
<jbossws.jboss423.version>3.1.0.GA</jbossws.jboss423.version>
15 years, 9 months
JBossWS SVN: r9451 - stack/metro/trunk.
by jbossws-commits@lists.jboss.org
Author: alessio.soldano(a)jboss.com
Date: 2009-02-28 10:24:46 -0500 (Sat, 28 Feb 2009)
New Revision: 9451
Modified:
stack/metro/trunk/pom.xml
Log:
Move to jbossws-common 1.0.10-SNAPSHOT
Modified: stack/metro/trunk/pom.xml
===================================================================
--- stack/metro/trunk/pom.xml 2009-02-28 15:23:28 UTC (rev 9450)
+++ stack/metro/trunk/pom.xml 2009-02-28 15:24:46 UTC (rev 9451)
@@ -45,7 +45,7 @@
<!-- Properties -->
<properties>
- <jbossws.common.version>1.0.9.GA</jbossws.common.version>
+ <jbossws.common.version>1.0.10-SNAPSHOT</jbossws.common.version>
<jbossws.framework.version>3.1.1-SNAPSHOT</jbossws.framework.version>
<jbossws.spi.version>1.1.1-SNAPSHOT</jbossws.spi.version>
<jbossws.jboss423.version>3.1.0.GA</jbossws.jboss423.version>
15 years, 9 months
JBossWS SVN: r9450 - common/trunk/src/main/java/org/jboss/wsf/test.
by jbossws-commits@lists.jboss.org
Author: alessio.soldano(a)jboss.com
Date: 2009-02-28 10:23:28 -0500 (Sat, 28 Feb 2009)
New Revision: 9450
Modified:
common/trunk/src/main/java/org/jboss/wsf/test/JBossWSTestHelper.java
Log:
[JBWS-2564] Use Server MBean to get JBoss version
Modified: common/trunk/src/main/java/org/jboss/wsf/test/JBossWSTestHelper.java
===================================================================
--- common/trunk/src/main/java/org/jboss/wsf/test/JBossWSTestHelper.java 2009-02-28 14:51:59 UTC (rev 9449)
+++ common/trunk/src/main/java/org/jboss/wsf/test/JBossWSTestHelper.java 2009-02-28 15:23:28 UTC (rev 9450)
@@ -227,8 +227,8 @@
String jbossVersion = null;
try
{
- ObjectName oname = ObjectNameFactory.create("jboss.system:type=ServerConfig");
- jbossVersion = (String)getServer().getAttribute(oname, "SpecificationVersion");
+ ObjectName oname = ObjectNameFactory.create("jboss.system:type=Server");
+ jbossVersion = (String)getServer().getAttribute(oname, "VersionNumber");
if (jbossVersion == null)
throw new IllegalStateException("Cannot obtain jboss version");
15 years, 9 months
JBossWS SVN: r9449 - in stack/native/branches/jbossws-native-3.1.0/modules: core/src/main/java/org/jboss/ws/core/jaxws and 6 other directories.
by jbossws-commits@lists.jboss.org
Author: alessio.soldano(a)jboss.com
Date: 2009-02-28 09:51:59 -0500 (Sat, 28 Feb 2009)
New Revision: 9449
Added:
stack/native/branches/jbossws-native-3.1.0/modules/core/src/main/java/org/jboss/ws/core/jaxws/wsaddressing/
stack/native/branches/jbossws-native-3.1.0/modules/core/src/main/java/org/jboss/ws/core/jaxws/wsaddressing/EndpointReferenceUtil.java
stack/native/branches/jbossws-native-3.1.0/modules/core/src/main/java/org/jboss/ws/core/jaxws/wsaddressing/NativeEndpointReference.java
stack/native/branches/jbossws-native-3.1.0/modules/jaxws/src/main/java/javax/xml/ws/wsaddressing/package-info.java
Removed:
stack/native/branches/jbossws-native-3.1.0/modules/core/src/main/java/org/jboss/ws/core/jaxws/binding/EndpointReferenceUtil.java
stack/native/branches/jbossws-native-3.1.0/modules/core/src/main/java/org/jboss/ws/core/jaxws/wsaddressing/EndpointReferenceUtil.java
stack/native/branches/jbossws-native-3.1.0/modules/core/src/main/java/org/jboss/ws/core/jaxws/wsaddressing/NativeEndpointReference.java
Modified:
stack/native/branches/jbossws-native-3.1.0/modules/core/src/main/java/org/jboss/ws/core/CommonBindingProvider.java
stack/native/branches/jbossws-native-3.1.0/modules/core/src/main/java/org/jboss/ws/core/jaxws/spi/EndpointImpl.java
stack/native/branches/jbossws-native-3.1.0/modules/core/src/main/java/org/jboss/ws/core/jaxws/spi/ProviderImpl.java
stack/native/branches/jbossws-native-3.1.0/modules/core/src/main/java/org/jboss/ws/core/jaxws/spi/ServiceDelegateImpl.java
stack/native/branches/jbossws-native-3.1.0/modules/core/src/main/java/org/jboss/wsf/stack/jbws/NativeWebServiceContext.java
stack/native/branches/jbossws-native-3.1.0/modules/jaxws/src/main/java/javax/xml/ws/EndpointReference.java
stack/native/branches/jbossws-native-3.1.0/modules/jaxws/src/main/java/javax/xml/ws/RespectBindingFeature.java
stack/native/branches/jbossws-native-3.1.0/modules/jaxws/src/main/java/javax/xml/ws/wsaddressing/W3CEndpointReference.java
stack/native/branches/jbossws-native-3.1.0/modules/jaxws/src/main/java/javax/xml/ws/wsaddressing/W3CEndpointReferenceBuilder.java
Log:
[JBWS-2452][JBCTS-902] Fix signature test failures + using internal endpoint reference implementation to build W3CEndpointReference instances
Modified: stack/native/branches/jbossws-native-3.1.0/modules/core/src/main/java/org/jboss/ws/core/CommonBindingProvider.java
===================================================================
--- stack/native/branches/jbossws-native-3.1.0/modules/core/src/main/java/org/jboss/ws/core/CommonBindingProvider.java 2009-02-28 14:33:21 UTC (rev 9448)
+++ stack/native/branches/jbossws-native-3.1.0/modules/core/src/main/java/org/jboss/ws/core/CommonBindingProvider.java 2009-02-28 14:51:59 UTC (rev 9449)
@@ -32,10 +32,10 @@
import org.jboss.logging.Logger;
import org.jboss.ws.core.jaxrpc.SOAP11BindingJAXRPC;
import org.jboss.ws.core.jaxrpc.SOAP12BindingJAXRPC;
-import org.jboss.ws.core.jaxws.binding.EndpointReferenceUtil;
import org.jboss.ws.core.jaxws.binding.HTTPBindingJAXWS;
import org.jboss.ws.core.jaxws.binding.SOAP11BindingJAXWS;
import org.jboss.ws.core.jaxws.binding.SOAP12BindingJAXWS;
+import org.jboss.ws.core.jaxws.wsaddressing.EndpointReferenceUtil;
import org.jboss.ws.metadata.config.Configurable;
import org.jboss.ws.metadata.umdm.EndpointMetaData;
import org.jboss.ws.metadata.umdm.EndpointMetaData.Type;
Deleted: stack/native/branches/jbossws-native-3.1.0/modules/core/src/main/java/org/jboss/ws/core/jaxws/binding/EndpointReferenceUtil.java
===================================================================
--- stack/native/branches/jbossws-native-3.1.0/modules/core/src/main/java/org/jboss/ws/core/jaxws/binding/EndpointReferenceUtil.java 2009-02-28 14:33:21 UTC (rev 9448)
+++ stack/native/branches/jbossws-native-3.1.0/modules/core/src/main/java/org/jboss/ws/core/jaxws/binding/EndpointReferenceUtil.java 2009-02-28 14:51:59 UTC (rev 9449)
@@ -1,52 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2006, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file in the
- * distribution for a full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.ws.core.jaxws.binding;
-
-import javax.xml.ws.EndpointReference;
-import javax.xml.ws.WebServiceException;
-import javax.xml.ws.wsaddressing.W3CEndpointReference;
-
-/**
- * Transforms an EPR to an instance of a given EndpointReference class
- *
- * @since 12-Jan-2009
- * @author alessio.soldano(a)jboss.com
- *
- */
-public class EndpointReferenceUtil {
-
- public static <T extends EndpointReference> T transform(Class<T> clazz, EndpointReference epr) {
- assert epr != null;
- if (clazz.isAssignableFrom(W3CEndpointReference.class)) {
- if (epr instanceof W3CEndpointReference) {
- return (T) epr;
- }
- else
- {
- throw new WebServiceException("Unsupported EndpointReference: " + epr);
- }
- }
- //transformations from different types of EndpointReference could be supported in future...
-
- throw new WebServiceException("EndpointReference of type " + clazz + " not supported.");
- }
-}
Modified: stack/native/branches/jbossws-native-3.1.0/modules/core/src/main/java/org/jboss/ws/core/jaxws/spi/EndpointImpl.java
===================================================================
--- stack/native/branches/jbossws-native-3.1.0/modules/core/src/main/java/org/jboss/ws/core/jaxws/spi/EndpointImpl.java 2009-02-28 14:33:21 UTC (rev 9448)
+++ stack/native/branches/jbossws-native-3.1.0/modules/core/src/main/java/org/jboss/ws/core/jaxws/spi/EndpointImpl.java 2009-02-28 14:51:59 UTC (rev 9449)
@@ -41,7 +41,7 @@
import org.jboss.logging.Logger;
import org.jboss.ws.core.jaxws.binding.BindingProviderImpl;
-import org.jboss.ws.core.jaxws.binding.EndpointReferenceUtil;
+import org.jboss.ws.core.jaxws.wsaddressing.EndpointReferenceUtil;
import org.jboss.wsf.spi.SPIProvider;
import org.jboss.wsf.spi.SPIProviderResolver;
import org.jboss.wsf.spi.http.HttpContext;
Modified: stack/native/branches/jbossws-native-3.1.0/modules/core/src/main/java/org/jboss/ws/core/jaxws/spi/ProviderImpl.java
===================================================================
--- stack/native/branches/jbossws-native-3.1.0/modules/core/src/main/java/org/jboss/ws/core/jaxws/spi/ProviderImpl.java 2009-02-28 14:33:21 UTC (rev 9448)
+++ stack/native/branches/jbossws-native-3.1.0/modules/core/src/main/java/org/jboss/ws/core/jaxws/spi/ProviderImpl.java 2009-02-28 14:51:59 UTC (rev 9449)
@@ -36,8 +36,9 @@
import javax.xml.ws.spi.Provider;
import javax.xml.ws.spi.ServiceDelegate;
import javax.xml.ws.wsaddressing.W3CEndpointReference;
-import javax.xml.ws.wsaddressing.W3CEndpointReferenceBuilder;
+import org.jboss.ws.core.jaxws.wsaddressing.EndpointReferenceUtil;
+import org.jboss.ws.core.jaxws.wsaddressing.NativeEndpointReference;
import org.jboss.wsf.common.DOMUtils;
import org.w3c.dom.Element;
@@ -112,13 +113,14 @@
public W3CEndpointReference createW3CEndpointReference(String address, QName serviceName, QName portName, List<Element> metadata, String wsdlDocumentLocation,
List<Element> referenceParameters)
{
- W3CEndpointReferenceBuilder builder = new W3CEndpointReferenceBuilder();
- builder = builder.address(address).serviceName(serviceName).endpointName(portName).wsdlDocumentLocation(wsdlDocumentLocation);
- for (Element el : metadata)
- builder = builder.metadata(el);
- for (Element el : referenceParameters)
- builder = builder.referenceParameter(el);
- return builder.build();
+ NativeEndpointReference epr = new NativeEndpointReference();
+ epr.setAddress(address);
+ epr.setServiceName(serviceName);
+ epr.setEndpointName(portName);
+ epr.setMetadata(metadata);
+ epr.setWsdlLocation(wsdlDocumentLocation);
+ epr.setReferenceParameters(referenceParameters);
+ return EndpointReferenceUtil.transform(W3CEndpointReference.class, epr);
}
@Override
@@ -126,12 +128,10 @@
{
URL wsdlLocation = null;
QName serviceName = null;
- if (epr instanceof W3CEndpointReference)
- {
- W3CEndpointReference w3c = (W3CEndpointReference)epr;
- wsdlLocation = w3c.getWsdlLocation();
- serviceName = w3c.getServiceName();
- }
+ NativeEndpointReference nepr = EndpointReferenceUtil.transform(NativeEndpointReference.class, epr);
+
+ wsdlLocation = nepr.getWsdlLocation();
+ serviceName = nepr.getServiceName();
ServiceDelegate delegate = createServiceDelegate(wsdlLocation, serviceName, Service.class);
return delegate.getPort(epr, sei, features);
}
Modified: stack/native/branches/jbossws-native-3.1.0/modules/core/src/main/java/org/jboss/ws/core/jaxws/spi/ServiceDelegateImpl.java
===================================================================
--- stack/native/branches/jbossws-native-3.1.0/modules/core/src/main/java/org/jboss/ws/core/jaxws/spi/ServiceDelegateImpl.java 2009-02-28 14:33:21 UTC (rev 9448)
+++ stack/native/branches/jbossws-native-3.1.0/modules/core/src/main/java/org/jboss/ws/core/jaxws/spi/ServiceDelegateImpl.java 2009-02-28 14:51:59 UTC (rev 9449)
@@ -50,7 +50,6 @@
import javax.xml.ws.addressing.ReferenceParameters;
import javax.xml.ws.handler.HandlerResolver;
import javax.xml.ws.spi.ServiceDelegate;
-import javax.xml.ws.wsaddressing.W3CEndpointReference;
import org.jboss.logging.Logger;
import org.jboss.ws.core.StubExt;
@@ -60,6 +59,8 @@
import org.jboss.ws.core.jaxws.client.DispatchImpl;
import org.jboss.ws.core.jaxws.client.ServiceObjectFactoryJAXWS;
import org.jboss.ws.core.jaxws.handler.HandlerResolverImpl;
+import org.jboss.ws.core.jaxws.wsaddressing.EndpointReferenceUtil;
+import org.jboss.ws.core.jaxws.wsaddressing.NativeEndpointReference;
import org.jboss.ws.extensions.wsrm.api.RMProvider;
import org.jboss.ws.metadata.builder.jaxws.JAXWSClientMetaDataBuilder;
import org.jboss.ws.metadata.builder.jaxws.JAXWSMetaDataBuilder;
@@ -471,11 +472,8 @@
public <T> Dispatch<T> createDispatch(EndpointReference epr, Class<T> type, Mode mode, WebServiceFeature... features)
{
QName portName = null;
- if (epr instanceof W3CEndpointReference)
- {
- W3CEndpointReference w3c = (W3CEndpointReference)epr;
- portName = w3c.getEndpointName();
- }
+ NativeEndpointReference nepr = EndpointReferenceUtil.transform(NativeEndpointReference.class, epr);
+ portName = nepr.getEndpointName();
Dispatch<T> dispatch = createDispatch(portName, type, mode);
initAddressingProperties(dispatch, epr);
@@ -495,11 +493,8 @@
public Dispatch<Object> createDispatch(EndpointReference epr, JAXBContext context, Mode mode, WebServiceFeature... features)
{
QName portName = null;
- if (epr instanceof W3CEndpointReference)
- {
- W3CEndpointReference w3c = (W3CEndpointReference)epr;
- portName = w3c.getEndpointName();
- }
+ NativeEndpointReference nepr = EndpointReferenceUtil.transform(NativeEndpointReference.class, epr);
+ portName = nepr.getEndpointName();
Dispatch<Object> dispatch = createDispatch(portName, context, mode);
initAddressingProperties(dispatch, epr);
@@ -551,33 +546,26 @@
AddressingBuilder builder = AddressingBuilder.getAddressingBuilder();
AddressingProperties addrProps = builder.newAddressingProperties();
reqContext.put(JAXWSAConstants.CLIENT_ADDRESSING_PROPERTIES_OUTBOUND, addrProps);
-
- if (epr instanceof W3CEndpointReference)
+
+ NativeEndpointReference nepr = EndpointReferenceUtil.transform(NativeEndpointReference.class, epr);
+ try
{
- try
+ if (nepr.getAddress() != null)
+ addrProps.setTo(builder.newURI(nepr.getAddress()));
+
+ List<Element> w3cRefParams = nepr.getReferenceParameters();
+ if (w3cRefParams != null)
{
- W3CEndpointReference w3cepr = (W3CEndpointReference)epr;
- if (w3cepr.getAddress() != null)
- addrProps.setTo(builder.newURI(w3cepr.getAddress()));
-
- List<Element> w3cRefParams = w3cepr.getReferenceParameters();
- if (w3cRefParams != null)
+ ReferenceParameters refParams = addrProps.getReferenceParameters();
+ for (Element w3cRefParam : w3cRefParams)
{
- ReferenceParameters refParams = addrProps.getReferenceParameters();
- for (Element w3cRefParam : w3cRefParams)
- {
- refParams.addElement(w3cRefParam);
- }
+ refParams.addElement(w3cRefParam);
}
}
- catch (URISyntaxException ex)
- {
- throw new IllegalArgumentException(ex);
- }
}
- else
+ catch (URISyntaxException ex)
{
- throw new IllegalArgumentException("Unsupported EPR type: " + epr);
+ throw new IllegalArgumentException(ex);
}
}
}
Copied: stack/native/branches/jbossws-native-3.1.0/modules/core/src/main/java/org/jboss/ws/core/jaxws/wsaddressing (from rev 9448, stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/jaxws/wsaddressing)
Deleted: stack/native/branches/jbossws-native-3.1.0/modules/core/src/main/java/org/jboss/ws/core/jaxws/wsaddressing/EndpointReferenceUtil.java
===================================================================
--- stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/jaxws/wsaddressing/EndpointReferenceUtil.java 2009-02-28 14:33:21 UTC (rev 9448)
+++ stack/native/branches/jbossws-native-3.1.0/modules/core/src/main/java/org/jboss/ws/core/jaxws/wsaddressing/EndpointReferenceUtil.java 2009-02-28 14:51:59 UTC (rev 9449)
@@ -1,78 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2006, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file in the
- * distribution for a full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.ws.core.jaxws.wsaddressing;
-
-import java.io.ByteArrayInputStream;
-import java.io.ByteArrayOutputStream;
-
-import javax.xml.transform.Source;
-import javax.xml.transform.stream.StreamResult;
-import javax.xml.transform.stream.StreamSource;
-import javax.xml.ws.EndpointReference;
-import javax.xml.ws.WebServiceException;
-import javax.xml.ws.wsaddressing.W3CEndpointReference;
-
-
-/**
- * Transforms an EPR to an instance of a given EndpointReference class
- *
- * @since 12-Jan-2009
- * @author alessio.soldano(a)jboss.com
- *
- */
-public class EndpointReferenceUtil {
-
- public static <T extends EndpointReference> T transform(Class<T> clazz, EndpointReference epr)
- {
- assert epr != null;
- if (clazz.isAssignableFrom(W3CEndpointReference.class))
- {
- if (epr instanceof W3CEndpointReference)
- {
- return (T)epr;
- }
- else if (epr instanceof NativeEndpointReference)
- {
- return (T)W3CEndpointReference.readFrom(getSourceFromEndpointReference(epr));
- }
- else
- {
- throw new WebServiceException("Unsupported EndpointReference: " + epr);
- }
- }
- else if (clazz.isAssignableFrom(NativeEndpointReference.class))
- {
- return (T)NativeEndpointReference.readFrom(getSourceFromEndpointReference(epr));
- }
- //transformations from different types of EndpointReference could be supported in future...
-
- throw new WebServiceException("EndpointReference of type " + clazz + " not supported.");
- }
-
- private static Source getSourceFromEndpointReference(EndpointReference epr)
- {
- ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
- StreamResult result = new StreamResult(outputStream);
- epr.writeTo(result);
- return new StreamSource(new ByteArrayInputStream(outputStream.toByteArray()));
- }
-}
Copied: stack/native/branches/jbossws-native-3.1.0/modules/core/src/main/java/org/jboss/ws/core/jaxws/wsaddressing/EndpointReferenceUtil.java (from rev 9448, stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/jaxws/wsaddressing/EndpointReferenceUtil.java)
===================================================================
--- stack/native/branches/jbossws-native-3.1.0/modules/core/src/main/java/org/jboss/ws/core/jaxws/wsaddressing/EndpointReferenceUtil.java (rev 0)
+++ stack/native/branches/jbossws-native-3.1.0/modules/core/src/main/java/org/jboss/ws/core/jaxws/wsaddressing/EndpointReferenceUtil.java 2009-02-28 14:51:59 UTC (rev 9449)
@@ -0,0 +1,78 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.ws.core.jaxws.wsaddressing;
+
+import java.io.ByteArrayInputStream;
+import java.io.ByteArrayOutputStream;
+
+import javax.xml.transform.Source;
+import javax.xml.transform.stream.StreamResult;
+import javax.xml.transform.stream.StreamSource;
+import javax.xml.ws.EndpointReference;
+import javax.xml.ws.WebServiceException;
+import javax.xml.ws.wsaddressing.W3CEndpointReference;
+
+
+/**
+ * Transforms an EPR to an instance of a given EndpointReference class
+ *
+ * @since 12-Jan-2009
+ * @author alessio.soldano(a)jboss.com
+ *
+ */
+public class EndpointReferenceUtil {
+
+ public static <T extends EndpointReference> T transform(Class<T> clazz, EndpointReference epr)
+ {
+ assert epr != null;
+ if (clazz.isAssignableFrom(W3CEndpointReference.class))
+ {
+ if (epr instanceof W3CEndpointReference)
+ {
+ return (T)epr;
+ }
+ else if (epr instanceof NativeEndpointReference)
+ {
+ return (T)W3CEndpointReference.readFrom(getSourceFromEndpointReference(epr));
+ }
+ else
+ {
+ throw new WebServiceException("Unsupported EndpointReference: " + epr);
+ }
+ }
+ else if (clazz.isAssignableFrom(NativeEndpointReference.class))
+ {
+ return (T)NativeEndpointReference.readFrom(getSourceFromEndpointReference(epr));
+ }
+ //transformations from different types of EndpointReference could be supported in future...
+
+ throw new WebServiceException("EndpointReference of type " + clazz + " not supported.");
+ }
+
+ private static Source getSourceFromEndpointReference(EndpointReference epr)
+ {
+ ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
+ StreamResult result = new StreamResult(outputStream);
+ epr.writeTo(result);
+ return new StreamSource(new ByteArrayInputStream(outputStream.toByteArray()));
+ }
+}
Deleted: stack/native/branches/jbossws-native-3.1.0/modules/core/src/main/java/org/jboss/ws/core/jaxws/wsaddressing/NativeEndpointReference.java
===================================================================
--- stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/jaxws/wsaddressing/NativeEndpointReference.java 2009-02-28 14:33:21 UTC (rev 9448)
+++ stack/native/branches/jbossws-native-3.1.0/modules/core/src/main/java/org/jboss/ws/core/jaxws/wsaddressing/NativeEndpointReference.java 2009-02-28 14:51:59 UTC (rev 9449)
@@ -1,322 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2006, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file in the
- * distribution for a full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.ws.core.jaxws.wsaddressing;
-
-import java.net.MalformedURLException;
-import java.net.URL;
-import java.util.List;
-import java.util.Map;
-
-import javax.xml.bind.JAXBContext;
-import javax.xml.bind.JAXBException;
-import javax.xml.bind.Marshaller;
-import javax.xml.bind.annotation.XmlAnyAttribute;
-import javax.xml.bind.annotation.XmlAnyElement;
-import javax.xml.bind.annotation.XmlElement;
-import javax.xml.bind.annotation.XmlRootElement;
-import javax.xml.bind.annotation.XmlTransient;
-import javax.xml.bind.annotation.XmlType;
-import javax.xml.bind.annotation.XmlValue;
-import javax.xml.namespace.QName;
-import javax.xml.transform.Result;
-import javax.xml.transform.Source;
-import javax.xml.ws.EndpointReference;
-import javax.xml.ws.WebServiceException;
-
-import org.w3c.dom.Element;
-
-/**
- * Internal representation of the W3CEndpointReference.
- * This allows the W3CEndpointReference to programmatically
- * build an EndpointReference specifying every parameter.
- * Instances of this class are converted to (and can be
- * created from) W3CEndpointReference using the
- * @see EndpointReferenceUtil class.
- *
- * @author alessio.soldano(a)jboss.com
- * @since 28-Feb-2009
- *
- */
-
-// XmlRootElement allows this class to be marshalled on its own
-@XmlRootElement(name = "EndpointReference", namespace = NativeEndpointReference.NS)
-@XmlType(name = "EndpointReferenceType", namespace = NativeEndpointReference.NS)
-public final class NativeEndpointReference extends EndpointReference
-{
- protected static final String NS = "http://www.w3.org/2005/08/addressing";
-
- private final static JAXBContext jc = getJaxbContext();
-
- // private but necessary properties for databinding
- @XmlElement(name = "Address", namespace = NS)
- private Address address;
- @XmlElement(name = "ReferenceParameters", namespace = NS)
- private Elements referenceParameters;
- @XmlElement(name = "Metadata", namespace = NS)
- private Elements metadata;
- @XmlAnyAttribute
- Map<QName, String> attributes;
- @XmlAnyElement
- List<Element> elements;
-
- // not marshalled
- private QName serviceName;
- private QName endpointName;
- private URL wsdlLocation;
-
- public NativeEndpointReference()
- {
- }
-
- /**
- * Creates an EPR from infoset representation
- *
- * @param source A source object containing valid XmlInfoset
- * instance consistent with the W3C WS-Addressing Core
- * recommendation.
- *
- * @throws WebServiceException
- * If the source does NOT contain a valid W3C WS-Addressing
- * EndpointReference.
- * @throws NullPointerException
- * If the <code>null</code> <code>source</code> value is given
- */
- public NativeEndpointReference(Source source)
- {
- try
- {
- NativeEndpointReference epr = jc.createUnmarshaller().unmarshal(source, NativeEndpointReference.class).getValue();
- this.address = epr.address;
- this.metadata = epr.metadata;
- this.referenceParameters = epr.referenceParameters;
- }
- catch (JAXBException e)
- {
- throw new WebServiceException("Error unmarshalling NativeEndpointReference ", e);
- }
- catch (ClassCastException e)
- {
- throw new WebServiceException("Source did not contain NativeEndpointReference", e);
- }
- }
-
- @XmlTransient
- public String getAddress()
- {
- return address != null ? address.getUri() : null;
- }
-
- public void setAddress(String address)
- {
- this.address = new Address(address);
- }
-
- @XmlTransient
- public QName getServiceName()
- {
- return serviceName;
- }
-
- public void setServiceName(QName serviceName)
- {
- this.serviceName = serviceName;
- }
-
- @XmlTransient
- public QName getEndpointName()
- {
- return endpointName;
- }
-
- public void setEndpointName(QName endpointName)
- {
- this.endpointName = endpointName;
- }
-
- @XmlTransient
- public List<Element> getMetadata()
- {
- return metadata != null ? metadata.getElements() : null;
- }
-
- public void setMetadata(List<Element> metadata)
- {
- this.metadata = new Elements(metadata);
- }
-
- @XmlTransient
- public URL getWsdlLocation()
- {
- return wsdlLocation;
- }
-
- public void setWsdlLocation(String wsdlLocation)
- {
- try
- {
- this.wsdlLocation = wsdlLocation != null ? new URL(wsdlLocation) : null;
- }
- catch (MalformedURLException e)
- {
- throw new IllegalArgumentException("Invalid URL: " + wsdlLocation);
- }
- }
-
- @XmlTransient
- public List<Element> getReferenceParameters()
- {
- return referenceParameters != null ? referenceParameters.getElements() : null;
- }
-
- public void setReferenceParameters(List<Element> metadata)
- {
- this.referenceParameters = new Elements(metadata);
- }
-
- /**
- * Directly read a NativeEndpointReference from the given source
- * instead of leveraging the Provider's readEndpointReference method.
- *
- * @param eprInfoset
- * @return
- */
- public static EndpointReference readFrom(Source eprInfoset)
- {
- if (eprInfoset == null)
- throw new NullPointerException("Provided eprInfoset cannot be null");
- try
- {
- return new NativeEndpointReference(eprInfoset);
- }
- catch (Exception e)
- {
- throw new WebServiceException(e);
- }
- }
-
- /**
- * {@inheritDoc}
- */
- public void writeTo(Result result)
- {
- try
- {
- Marshaller marshaller = jc.createMarshaller();
- marshaller.setProperty(Marshaller.JAXB_FRAGMENT, true);
- marshaller.marshal(this, result);
- }
- catch (JAXBException e)
- {
- throw new WebServiceException("Error marshalling NativeEndpointReference. ", e);
- }
- }
-
- private static JAXBContext getJaxbContext()
- {
- try
- {
- return JAXBContext.newInstance(new Class[] { NativeEndpointReference.class });
- }
- catch (JAXBException ex)
- {
- throw new WebServiceException("Cannot obtain JAXB context", ex);
- }
- }
-
- private static class Address
- {
- @XmlValue
- String uri;
- @XmlAnyAttribute
- Map<QName, String> attributes;
-
- protected Address()
- {
- }
-
- public Address(String uri)
- {
- this.uri = uri;
- }
-
- @XmlTransient
- public String getUri()
- {
- return uri;
- }
-
- public void setUri(String uri)
- {
- this.uri = uri;
- }
-
- @XmlTransient
- public Map<QName, String> getAttributes()
- {
- return attributes;
- }
-
- public void setAttributes(Map<QName, String> attributes)
- {
- this.attributes = attributes;
- }
- }
-
- private static class Elements
- {
- @XmlAnyElement
- List<Element> elements;
- @XmlAnyAttribute
- Map<QName, String> attributes;
-
- protected Elements()
- {
- }
-
- public Elements(List<Element> elements)
- {
- this.elements = elements;
- }
-
- @XmlTransient
- public List<Element> getElements()
- {
- return elements;
- }
-
- public void setElements(List<Element> elements)
- {
- this.elements = elements;
- }
-
- @XmlTransient
- public Map<QName, String> getAttributes()
- {
- return attributes;
- }
-
- public void setAttributes(Map<QName, String> attributes)
- {
- this.attributes = attributes;
- }
- }
-}
Copied: stack/native/branches/jbossws-native-3.1.0/modules/core/src/main/java/org/jboss/ws/core/jaxws/wsaddressing/NativeEndpointReference.java (from rev 9448, stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/jaxws/wsaddressing/NativeEndpointReference.java)
===================================================================
--- stack/native/branches/jbossws-native-3.1.0/modules/core/src/main/java/org/jboss/ws/core/jaxws/wsaddressing/NativeEndpointReference.java (rev 0)
+++ stack/native/branches/jbossws-native-3.1.0/modules/core/src/main/java/org/jboss/ws/core/jaxws/wsaddressing/NativeEndpointReference.java 2009-02-28 14:51:59 UTC (rev 9449)
@@ -0,0 +1,322 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.ws.core.jaxws.wsaddressing;
+
+import java.net.MalformedURLException;
+import java.net.URL;
+import java.util.List;
+import java.util.Map;
+
+import javax.xml.bind.JAXBContext;
+import javax.xml.bind.JAXBException;
+import javax.xml.bind.Marshaller;
+import javax.xml.bind.annotation.XmlAnyAttribute;
+import javax.xml.bind.annotation.XmlAnyElement;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlRootElement;
+import javax.xml.bind.annotation.XmlTransient;
+import javax.xml.bind.annotation.XmlType;
+import javax.xml.bind.annotation.XmlValue;
+import javax.xml.namespace.QName;
+import javax.xml.transform.Result;
+import javax.xml.transform.Source;
+import javax.xml.ws.EndpointReference;
+import javax.xml.ws.WebServiceException;
+
+import org.w3c.dom.Element;
+
+/**
+ * Internal representation of the W3CEndpointReference.
+ * This allows the W3CEndpointReference to programmatically
+ * build an EndpointReference specifying every parameter.
+ * Instances of this class are converted to (and can be
+ * created from) W3CEndpointReference using the
+ * @see EndpointReferenceUtil class.
+ *
+ * @author alessio.soldano(a)jboss.com
+ * @since 28-Feb-2009
+ *
+ */
+
+// XmlRootElement allows this class to be marshalled on its own
+@XmlRootElement(name = "EndpointReference", namespace = NativeEndpointReference.NS)
+@XmlType(name = "EndpointReferenceType", namespace = NativeEndpointReference.NS)
+public final class NativeEndpointReference extends EndpointReference
+{
+ protected static final String NS = "http://www.w3.org/2005/08/addressing";
+
+ private final static JAXBContext jc = getJaxbContext();
+
+ // private but necessary properties for databinding
+ @XmlElement(name = "Address", namespace = NS)
+ private Address address;
+ @XmlElement(name = "ReferenceParameters", namespace = NS)
+ private Elements referenceParameters;
+ @XmlElement(name = "Metadata", namespace = NS)
+ private Elements metadata;
+ @XmlAnyAttribute
+ Map<QName, String> attributes;
+ @XmlAnyElement
+ List<Element> elements;
+
+ // not marshalled
+ private QName serviceName;
+ private QName endpointName;
+ private URL wsdlLocation;
+
+ public NativeEndpointReference()
+ {
+ }
+
+ /**
+ * Creates an EPR from infoset representation
+ *
+ * @param source A source object containing valid XmlInfoset
+ * instance consistent with the W3C WS-Addressing Core
+ * recommendation.
+ *
+ * @throws WebServiceException
+ * If the source does NOT contain a valid W3C WS-Addressing
+ * EndpointReference.
+ * @throws NullPointerException
+ * If the <code>null</code> <code>source</code> value is given
+ */
+ public NativeEndpointReference(Source source)
+ {
+ try
+ {
+ NativeEndpointReference epr = jc.createUnmarshaller().unmarshal(source, NativeEndpointReference.class).getValue();
+ this.address = epr.address;
+ this.metadata = epr.metadata;
+ this.referenceParameters = epr.referenceParameters;
+ }
+ catch (JAXBException e)
+ {
+ throw new WebServiceException("Error unmarshalling NativeEndpointReference ", e);
+ }
+ catch (ClassCastException e)
+ {
+ throw new WebServiceException("Source did not contain NativeEndpointReference", e);
+ }
+ }
+
+ @XmlTransient
+ public String getAddress()
+ {
+ return address != null ? address.getUri() : null;
+ }
+
+ public void setAddress(String address)
+ {
+ this.address = new Address(address);
+ }
+
+ @XmlTransient
+ public QName getServiceName()
+ {
+ return serviceName;
+ }
+
+ public void setServiceName(QName serviceName)
+ {
+ this.serviceName = serviceName;
+ }
+
+ @XmlTransient
+ public QName getEndpointName()
+ {
+ return endpointName;
+ }
+
+ public void setEndpointName(QName endpointName)
+ {
+ this.endpointName = endpointName;
+ }
+
+ @XmlTransient
+ public List<Element> getMetadata()
+ {
+ return metadata != null ? metadata.getElements() : null;
+ }
+
+ public void setMetadata(List<Element> metadata)
+ {
+ this.metadata = new Elements(metadata);
+ }
+
+ @XmlTransient
+ public URL getWsdlLocation()
+ {
+ return wsdlLocation;
+ }
+
+ public void setWsdlLocation(String wsdlLocation)
+ {
+ try
+ {
+ this.wsdlLocation = wsdlLocation != null ? new URL(wsdlLocation) : null;
+ }
+ catch (MalformedURLException e)
+ {
+ throw new IllegalArgumentException("Invalid URL: " + wsdlLocation);
+ }
+ }
+
+ @XmlTransient
+ public List<Element> getReferenceParameters()
+ {
+ return referenceParameters != null ? referenceParameters.getElements() : null;
+ }
+
+ public void setReferenceParameters(List<Element> metadata)
+ {
+ this.referenceParameters = new Elements(metadata);
+ }
+
+ /**
+ * Directly read a NativeEndpointReference from the given source
+ * instead of leveraging the Provider's readEndpointReference method.
+ *
+ * @param eprInfoset
+ * @return
+ */
+ public static EndpointReference readFrom(Source eprInfoset)
+ {
+ if (eprInfoset == null)
+ throw new NullPointerException("Provided eprInfoset cannot be null");
+ try
+ {
+ return new NativeEndpointReference(eprInfoset);
+ }
+ catch (Exception e)
+ {
+ throw new WebServiceException(e);
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void writeTo(Result result)
+ {
+ try
+ {
+ Marshaller marshaller = jc.createMarshaller();
+ marshaller.setProperty(Marshaller.JAXB_FRAGMENT, true);
+ marshaller.marshal(this, result);
+ }
+ catch (JAXBException e)
+ {
+ throw new WebServiceException("Error marshalling NativeEndpointReference. ", e);
+ }
+ }
+
+ private static JAXBContext getJaxbContext()
+ {
+ try
+ {
+ return JAXBContext.newInstance(new Class[] { NativeEndpointReference.class });
+ }
+ catch (JAXBException ex)
+ {
+ throw new WebServiceException("Cannot obtain JAXB context", ex);
+ }
+ }
+
+ private static class Address
+ {
+ @XmlValue
+ String uri;
+ @XmlAnyAttribute
+ Map<QName, String> attributes;
+
+ protected Address()
+ {
+ }
+
+ public Address(String uri)
+ {
+ this.uri = uri;
+ }
+
+ @XmlTransient
+ public String getUri()
+ {
+ return uri;
+ }
+
+ public void setUri(String uri)
+ {
+ this.uri = uri;
+ }
+
+ @XmlTransient
+ public Map<QName, String> getAttributes()
+ {
+ return attributes;
+ }
+
+ public void setAttributes(Map<QName, String> attributes)
+ {
+ this.attributes = attributes;
+ }
+ }
+
+ private static class Elements
+ {
+ @XmlAnyElement
+ List<Element> elements;
+ @XmlAnyAttribute
+ Map<QName, String> attributes;
+
+ protected Elements()
+ {
+ }
+
+ public Elements(List<Element> elements)
+ {
+ this.elements = elements;
+ }
+
+ @XmlTransient
+ public List<Element> getElements()
+ {
+ return elements;
+ }
+
+ public void setElements(List<Element> elements)
+ {
+ this.elements = elements;
+ }
+
+ @XmlTransient
+ public Map<QName, String> getAttributes()
+ {
+ return attributes;
+ }
+
+ public void setAttributes(Map<QName, String> attributes)
+ {
+ this.attributes = attributes;
+ }
+ }
+}
Modified: stack/native/branches/jbossws-native-3.1.0/modules/core/src/main/java/org/jboss/wsf/stack/jbws/NativeWebServiceContext.java
===================================================================
--- stack/native/branches/jbossws-native-3.1.0/modules/core/src/main/java/org/jboss/wsf/stack/jbws/NativeWebServiceContext.java 2009-02-28 14:33:21 UTC (rev 9448)
+++ stack/native/branches/jbossws-native-3.1.0/modules/core/src/main/java/org/jboss/wsf/stack/jbws/NativeWebServiceContext.java 2009-02-28 14:51:59 UTC (rev 9449)
@@ -29,7 +29,7 @@
import javax.xml.ws.wsaddressing.W3CEndpointReferenceBuilder;
import org.jboss.ws.core.CommonMessageContext;
-import org.jboss.ws.core.jaxws.binding.EndpointReferenceUtil;
+import org.jboss.ws.core.jaxws.wsaddressing.EndpointReferenceUtil;
import org.jboss.ws.metadata.umdm.EndpointMetaData;
import org.jboss.wsf.spi.invocation.ExtensibleWebServiceContext;
import org.w3c.dom.Element;
Modified: stack/native/branches/jbossws-native-3.1.0/modules/jaxws/src/main/java/javax/xml/ws/EndpointReference.java
===================================================================
--- stack/native/branches/jbossws-native-3.1.0/modules/jaxws/src/main/java/javax/xml/ws/EndpointReference.java 2009-02-28 14:33:21 UTC (rev 9448)
+++ stack/native/branches/jbossws-native-3.1.0/modules/jaxws/src/main/java/javax/xml/ws/EndpointReference.java 2009-02-28 14:51:59 UTC (rev 9449)
@@ -23,6 +23,7 @@
import java.io.StringWriter;
+import javax.xml.bind.annotation.XmlTransient;
import javax.xml.transform.Result;
import javax.xml.transform.Source;
import javax.xml.transform.stream.StreamResult;
@@ -79,7 +80,7 @@
* @see Service
* @since JAX-WS 2.1
*/
-//@XmlTransient // to treat this class like Object as far as databinding is concerned (proposed JAXB 2.1 feature)
+@XmlTransient // to treat this class like Object as far as databinding is concerned (proposed JAXB 2.1 feature)
public abstract class EndpointReference
{
//
Modified: stack/native/branches/jbossws-native-3.1.0/modules/jaxws/src/main/java/javax/xml/ws/RespectBindingFeature.java
===================================================================
--- stack/native/branches/jbossws-native-3.1.0/modules/jaxws/src/main/java/javax/xml/ws/RespectBindingFeature.java 2009-02-28 14:33:21 UTC (rev 9448)
+++ stack/native/branches/jbossws-native-3.1.0/modules/jaxws/src/main/java/javax/xml/ws/RespectBindingFeature.java 2009-02-28 14:51:59 UTC (rev 9449)
@@ -94,7 +94,7 @@
*
* Constant value identifying the RespectBindingFeature
*/
- public static final String ID = "javax.xml.ws.InspectBindingFeature";
+ public static final String ID = "javax.xml.ws.RespectBindingFeature";
/**
* Create an <code>RespectBindingFeature</code>.
Modified: stack/native/branches/jbossws-native-3.1.0/modules/jaxws/src/main/java/javax/xml/ws/wsaddressing/W3CEndpointReference.java
===================================================================
--- stack/native/branches/jbossws-native-3.1.0/modules/jaxws/src/main/java/javax/xml/ws/wsaddressing/W3CEndpointReference.java 2009-02-28 14:33:21 UTC (rev 9448)
+++ stack/native/branches/jbossws-native-3.1.0/modules/jaxws/src/main/java/javax/xml/ws/wsaddressing/W3CEndpointReference.java 2009-02-28 14:51:59 UTC (rev 9449)
@@ -21,7 +21,6 @@
*/
package javax.xml.ws.wsaddressing;
-import java.net.MalformedURLException;
import java.net.URL;
import java.util.List;
import java.util.Map;
@@ -82,11 +81,6 @@
Map<QName, String> attributes;
@XmlAnyElement
List<Element> elements;
-
- // not marshalled
- private QName serviceName;
- private QName endpointName;
- private URL wsdlLocation;
protected W3CEndpointReference()
{
@@ -124,79 +118,6 @@
}
}
- @XmlTransient
- public String getAddress()
- {
- return address != null ? address.getUri() : null;
- }
-
- void setAddress(String address)
- {
- this.address = new Address(address);
- }
-
- @XmlTransient
- public QName getServiceName()
- {
- return serviceName;
- }
-
- public void setServiceName(QName serviceName)
- {
- this.serviceName = serviceName;
- }
-
- @XmlTransient
- public QName getEndpointName()
- {
- return endpointName;
- }
-
- public void setEndpointName(QName endpointName)
- {
- this.endpointName = endpointName;
- }
-
- @XmlTransient
- public List<Element> getMetadata()
- {
- return metadata != null ? metadata.getElements() : null;
- }
-
- public void setMetadata(List<Element> metadata)
- {
- this.metadata = new Elements(metadata);
- }
-
- @XmlTransient
- public URL getWsdlLocation()
- {
- return wsdlLocation;
- }
-
- public void setWsdlLocation(String wsdlLocation)
- {
- try
- {
- this.wsdlLocation = wsdlLocation != null ? new URL(wsdlLocation) : null;
- }
- catch (MalformedURLException e)
- {
- throw new IllegalArgumentException("Invalid URL: " + wsdlLocation);
- }
- }
-
- @XmlTransient
- public List<Element> getReferenceParameters()
- {
- return referenceParameters != null ? referenceParameters.getElements() : null;
- }
-
- public void setReferenceParameters(List<Element> metadata)
- {
- this.referenceParameters = new Elements(metadata);
- }
-
/**
* {@inheritDoc}
*/
Modified: stack/native/branches/jbossws-native-3.1.0/modules/jaxws/src/main/java/javax/xml/ws/wsaddressing/W3CEndpointReferenceBuilder.java
===================================================================
--- stack/native/branches/jbossws-native-3.1.0/modules/jaxws/src/main/java/javax/xml/ws/wsaddressing/W3CEndpointReferenceBuilder.java 2009-02-28 14:33:21 UTC (rev 9448)
+++ stack/native/branches/jbossws-native-3.1.0/modules/jaxws/src/main/java/javax/xml/ws/wsaddressing/W3CEndpointReferenceBuilder.java 2009-02-28 14:51:59 UTC (rev 9449)
@@ -26,6 +26,7 @@
import javax.xml.namespace.QName;
import javax.xml.ws.WebServiceException;
+import javax.xml.ws.spi.Provider;
import org.w3c.dom.Element;
@@ -260,13 +261,8 @@
*/
public W3CEndpointReference build()
{
- W3CEndpointReference epr = new W3CEndpointReference();
- epr.setAddress(address);
- epr.setServiceName(serviceName);
- epr.setEndpointName(endpointName);
- epr.setMetadata(metadata);
- epr.setWsdlLocation(wsdlLocation);
- epr.setReferenceParameters(parameters);
- return epr;
+ return Provider.provider().createW3CEndpointReference(address,
+ serviceName, endpointName, metadata, wsdlLocation,
+ parameters);
}
}
Copied: stack/native/branches/jbossws-native-3.1.0/modules/jaxws/src/main/java/javax/xml/ws/wsaddressing/package-info.java (from rev 9448, stack/native/trunk/modules/jaxws/src/main/java/javax/xml/ws/wsaddressing/package-info.java)
===================================================================
--- stack/native/branches/jbossws-native-3.1.0/modules/jaxws/src/main/java/javax/xml/ws/wsaddressing/package-info.java (rev 0)
+++ stack/native/branches/jbossws-native-3.1.0/modules/jaxws/src/main/java/javax/xml/ws/wsaddressing/package-info.java 2009-02-28 14:51:59 UTC (rev 9449)
@@ -0,0 +1,24 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+(a)javax.xml.bind.annotation.XmlSchema(namespace = "http://www.w3.org/2005/08/addressing",
+ location = "http://www.w3.org/2006/03/addressing/ws-addr.xsd")
+package javax.xml.ws.wsaddressing;
\ No newline at end of file
15 years, 9 months
JBossWS SVN: r9448 - in stack/native/trunk/modules: core/src/main/java/org/jboss/ws/core/jaxws and 6 other directories.
by jbossws-commits@lists.jboss.org
Author: alessio.soldano(a)jboss.com
Date: 2009-02-28 09:33:21 -0500 (Sat, 28 Feb 2009)
New Revision: 9448
Added:
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/jaxws/wsaddressing/
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/jaxws/wsaddressing/EndpointReferenceUtil.java
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/jaxws/wsaddressing/NativeEndpointReference.java
stack/native/trunk/modules/jaxws/src/main/java/javax/xml/ws/wsaddressing/package-info.java
Removed:
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/jaxws/binding/EndpointReferenceUtil.java
Modified:
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/CommonBindingProvider.java
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/jaxws/spi/EndpointImpl.java
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/jaxws/spi/ProviderImpl.java
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/jaxws/spi/ServiceDelegateImpl.java
stack/native/trunk/modules/core/src/main/java/org/jboss/wsf/stack/jbws/NativeWebServiceContext.java
stack/native/trunk/modules/jaxws/src/main/java/javax/xml/ws/EndpointReference.java
stack/native/trunk/modules/jaxws/src/main/java/javax/xml/ws/RespectBindingFeature.java
stack/native/trunk/modules/jaxws/src/main/java/javax/xml/ws/wsaddressing/W3CEndpointReference.java
stack/native/trunk/modules/jaxws/src/main/java/javax/xml/ws/wsaddressing/W3CEndpointReferenceBuilder.java
Log:
[JBWS-2452][JBCTS-902] Fix signature test failures + using internal endpoint reference implementation to build W3CEndpointReference instances
Modified: stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/CommonBindingProvider.java
===================================================================
--- stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/CommonBindingProvider.java 2009-02-27 18:24:18 UTC (rev 9447)
+++ stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/CommonBindingProvider.java 2009-02-28 14:33:21 UTC (rev 9448)
@@ -32,10 +32,10 @@
import org.jboss.logging.Logger;
import org.jboss.ws.core.jaxrpc.SOAP11BindingJAXRPC;
import org.jboss.ws.core.jaxrpc.SOAP12BindingJAXRPC;
-import org.jboss.ws.core.jaxws.binding.EndpointReferenceUtil;
import org.jboss.ws.core.jaxws.binding.HTTPBindingJAXWS;
import org.jboss.ws.core.jaxws.binding.SOAP11BindingJAXWS;
import org.jboss.ws.core.jaxws.binding.SOAP12BindingJAXWS;
+import org.jboss.ws.core.jaxws.wsaddressing.EndpointReferenceUtil;
import org.jboss.ws.metadata.config.Configurable;
import org.jboss.ws.metadata.umdm.EndpointMetaData;
import org.jboss.ws.metadata.umdm.EndpointMetaData.Type;
Deleted: stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/jaxws/binding/EndpointReferenceUtil.java
===================================================================
--- stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/jaxws/binding/EndpointReferenceUtil.java 2009-02-27 18:24:18 UTC (rev 9447)
+++ stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/jaxws/binding/EndpointReferenceUtil.java 2009-02-28 14:33:21 UTC (rev 9448)
@@ -1,52 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2006, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file in the
- * distribution for a full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.ws.core.jaxws.binding;
-
-import javax.xml.ws.EndpointReference;
-import javax.xml.ws.WebServiceException;
-import javax.xml.ws.wsaddressing.W3CEndpointReference;
-
-/**
- * Transforms an EPR to an instance of a given EndpointReference class
- *
- * @since 12-Jan-2009
- * @author alessio.soldano(a)jboss.com
- *
- */
-public class EndpointReferenceUtil {
-
- public static <T extends EndpointReference> T transform(Class<T> clazz, EndpointReference epr) {
- assert epr != null;
- if (clazz.isAssignableFrom(W3CEndpointReference.class)) {
- if (epr instanceof W3CEndpointReference) {
- return (T) epr;
- }
- else
- {
- throw new WebServiceException("Unsupported EndpointReference: " + epr);
- }
- }
- //transformations from different types of EndpointReference could be supported in future...
-
- throw new WebServiceException("EndpointReference of type " + clazz + " not supported.");
- }
-}
Modified: stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/jaxws/spi/EndpointImpl.java
===================================================================
--- stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/jaxws/spi/EndpointImpl.java 2009-02-27 18:24:18 UTC (rev 9447)
+++ stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/jaxws/spi/EndpointImpl.java 2009-02-28 14:33:21 UTC (rev 9448)
@@ -41,7 +41,7 @@
import org.jboss.logging.Logger;
import org.jboss.ws.core.jaxws.binding.BindingProviderImpl;
-import org.jboss.ws.core.jaxws.binding.EndpointReferenceUtil;
+import org.jboss.ws.core.jaxws.wsaddressing.EndpointReferenceUtil;
import org.jboss.wsf.spi.SPIProvider;
import org.jboss.wsf.spi.SPIProviderResolver;
import org.jboss.wsf.spi.http.HttpContext;
Modified: stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/jaxws/spi/ProviderImpl.java
===================================================================
--- stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/jaxws/spi/ProviderImpl.java 2009-02-27 18:24:18 UTC (rev 9447)
+++ stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/jaxws/spi/ProviderImpl.java 2009-02-28 14:33:21 UTC (rev 9448)
@@ -36,8 +36,9 @@
import javax.xml.ws.spi.Provider;
import javax.xml.ws.spi.ServiceDelegate;
import javax.xml.ws.wsaddressing.W3CEndpointReference;
-import javax.xml.ws.wsaddressing.W3CEndpointReferenceBuilder;
+import org.jboss.ws.core.jaxws.wsaddressing.EndpointReferenceUtil;
+import org.jboss.ws.core.jaxws.wsaddressing.NativeEndpointReference;
import org.jboss.wsf.common.DOMUtils;
import org.w3c.dom.Element;
@@ -112,13 +113,14 @@
public W3CEndpointReference createW3CEndpointReference(String address, QName serviceName, QName portName, List<Element> metadata, String wsdlDocumentLocation,
List<Element> referenceParameters)
{
- W3CEndpointReferenceBuilder builder = new W3CEndpointReferenceBuilder();
- builder = builder.address(address).serviceName(serviceName).endpointName(portName).wsdlDocumentLocation(wsdlDocumentLocation);
- for (Element el : metadata)
- builder = builder.metadata(el);
- for (Element el : referenceParameters)
- builder = builder.referenceParameter(el);
- return builder.build();
+ NativeEndpointReference epr = new NativeEndpointReference();
+ epr.setAddress(address);
+ epr.setServiceName(serviceName);
+ epr.setEndpointName(portName);
+ epr.setMetadata(metadata);
+ epr.setWsdlLocation(wsdlDocumentLocation);
+ epr.setReferenceParameters(referenceParameters);
+ return EndpointReferenceUtil.transform(W3CEndpointReference.class, epr);
}
@Override
@@ -126,12 +128,10 @@
{
URL wsdlLocation = null;
QName serviceName = null;
- if (epr instanceof W3CEndpointReference)
- {
- W3CEndpointReference w3c = (W3CEndpointReference)epr;
- wsdlLocation = w3c.getWsdlLocation();
- serviceName = w3c.getServiceName();
- }
+ NativeEndpointReference nepr = EndpointReferenceUtil.transform(NativeEndpointReference.class, epr);
+
+ wsdlLocation = nepr.getWsdlLocation();
+ serviceName = nepr.getServiceName();
ServiceDelegate delegate = createServiceDelegate(wsdlLocation, serviceName, Service.class);
return delegate.getPort(epr, sei, features);
}
Modified: stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/jaxws/spi/ServiceDelegateImpl.java
===================================================================
--- stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/jaxws/spi/ServiceDelegateImpl.java 2009-02-27 18:24:18 UTC (rev 9447)
+++ stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/jaxws/spi/ServiceDelegateImpl.java 2009-02-28 14:33:21 UTC (rev 9448)
@@ -50,7 +50,6 @@
import javax.xml.ws.addressing.ReferenceParameters;
import javax.xml.ws.handler.HandlerResolver;
import javax.xml.ws.spi.ServiceDelegate;
-import javax.xml.ws.wsaddressing.W3CEndpointReference;
import org.jboss.logging.Logger;
import org.jboss.ws.core.StubExt;
@@ -60,6 +59,8 @@
import org.jboss.ws.core.jaxws.client.DispatchImpl;
import org.jboss.ws.core.jaxws.client.ServiceObjectFactoryJAXWS;
import org.jboss.ws.core.jaxws.handler.HandlerResolverImpl;
+import org.jboss.ws.core.jaxws.wsaddressing.EndpointReferenceUtil;
+import org.jboss.ws.core.jaxws.wsaddressing.NativeEndpointReference;
import org.jboss.ws.extensions.wsrm.api.RMProvider;
import org.jboss.ws.metadata.builder.jaxws.JAXWSClientMetaDataBuilder;
import org.jboss.ws.metadata.builder.jaxws.JAXWSMetaDataBuilder;
@@ -471,11 +472,8 @@
public <T> Dispatch<T> createDispatch(EndpointReference epr, Class<T> type, Mode mode, WebServiceFeature... features)
{
QName portName = null;
- if (epr instanceof W3CEndpointReference)
- {
- W3CEndpointReference w3c = (W3CEndpointReference)epr;
- portName = w3c.getEndpointName();
- }
+ NativeEndpointReference nepr = EndpointReferenceUtil.transform(NativeEndpointReference.class, epr);
+ portName = nepr.getEndpointName();
Dispatch<T> dispatch = createDispatch(portName, type, mode);
initAddressingProperties(dispatch, epr);
@@ -495,11 +493,8 @@
public Dispatch<Object> createDispatch(EndpointReference epr, JAXBContext context, Mode mode, WebServiceFeature... features)
{
QName portName = null;
- if (epr instanceof W3CEndpointReference)
- {
- W3CEndpointReference w3c = (W3CEndpointReference)epr;
- portName = w3c.getEndpointName();
- }
+ NativeEndpointReference nepr = EndpointReferenceUtil.transform(NativeEndpointReference.class, epr);
+ portName = nepr.getEndpointName();
Dispatch<Object> dispatch = createDispatch(portName, context, mode);
initAddressingProperties(dispatch, epr);
@@ -551,33 +546,26 @@
AddressingBuilder builder = AddressingBuilder.getAddressingBuilder();
AddressingProperties addrProps = builder.newAddressingProperties();
reqContext.put(JAXWSAConstants.CLIENT_ADDRESSING_PROPERTIES_OUTBOUND, addrProps);
-
- if (epr instanceof W3CEndpointReference)
+
+ NativeEndpointReference nepr = EndpointReferenceUtil.transform(NativeEndpointReference.class, epr);
+ try
{
- try
+ if (nepr.getAddress() != null)
+ addrProps.setTo(builder.newURI(nepr.getAddress()));
+
+ List<Element> w3cRefParams = nepr.getReferenceParameters();
+ if (w3cRefParams != null)
{
- W3CEndpointReference w3cepr = (W3CEndpointReference)epr;
- if (w3cepr.getAddress() != null)
- addrProps.setTo(builder.newURI(w3cepr.getAddress()));
-
- List<Element> w3cRefParams = w3cepr.getReferenceParameters();
- if (w3cRefParams != null)
+ ReferenceParameters refParams = addrProps.getReferenceParameters();
+ for (Element w3cRefParam : w3cRefParams)
{
- ReferenceParameters refParams = addrProps.getReferenceParameters();
- for (Element w3cRefParam : w3cRefParams)
- {
- refParams.addElement(w3cRefParam);
- }
+ refParams.addElement(w3cRefParam);
}
}
- catch (URISyntaxException ex)
- {
- throw new IllegalArgumentException(ex);
- }
}
- else
+ catch (URISyntaxException ex)
{
- throw new IllegalArgumentException("Unsupported EPR type: " + epr);
+ throw new IllegalArgumentException(ex);
}
}
}
Added: stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/jaxws/wsaddressing/EndpointReferenceUtil.java
===================================================================
--- stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/jaxws/wsaddressing/EndpointReferenceUtil.java (rev 0)
+++ stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/jaxws/wsaddressing/EndpointReferenceUtil.java 2009-02-28 14:33:21 UTC (rev 9448)
@@ -0,0 +1,78 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.ws.core.jaxws.wsaddressing;
+
+import java.io.ByteArrayInputStream;
+import java.io.ByteArrayOutputStream;
+
+import javax.xml.transform.Source;
+import javax.xml.transform.stream.StreamResult;
+import javax.xml.transform.stream.StreamSource;
+import javax.xml.ws.EndpointReference;
+import javax.xml.ws.WebServiceException;
+import javax.xml.ws.wsaddressing.W3CEndpointReference;
+
+
+/**
+ * Transforms an EPR to an instance of a given EndpointReference class
+ *
+ * @since 12-Jan-2009
+ * @author alessio.soldano(a)jboss.com
+ *
+ */
+public class EndpointReferenceUtil {
+
+ public static <T extends EndpointReference> T transform(Class<T> clazz, EndpointReference epr)
+ {
+ assert epr != null;
+ if (clazz.isAssignableFrom(W3CEndpointReference.class))
+ {
+ if (epr instanceof W3CEndpointReference)
+ {
+ return (T)epr;
+ }
+ else if (epr instanceof NativeEndpointReference)
+ {
+ return (T)W3CEndpointReference.readFrom(getSourceFromEndpointReference(epr));
+ }
+ else
+ {
+ throw new WebServiceException("Unsupported EndpointReference: " + epr);
+ }
+ }
+ else if (clazz.isAssignableFrom(NativeEndpointReference.class))
+ {
+ return (T)NativeEndpointReference.readFrom(getSourceFromEndpointReference(epr));
+ }
+ //transformations from different types of EndpointReference could be supported in future...
+
+ throw new WebServiceException("EndpointReference of type " + clazz + " not supported.");
+ }
+
+ private static Source getSourceFromEndpointReference(EndpointReference epr)
+ {
+ ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
+ StreamResult result = new StreamResult(outputStream);
+ epr.writeTo(result);
+ return new StreamSource(new ByteArrayInputStream(outputStream.toByteArray()));
+ }
+}
Property changes on: stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/jaxws/wsaddressing/EndpointReferenceUtil.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/jaxws/wsaddressing/NativeEndpointReference.java
===================================================================
--- stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/jaxws/wsaddressing/NativeEndpointReference.java (rev 0)
+++ stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/jaxws/wsaddressing/NativeEndpointReference.java 2009-02-28 14:33:21 UTC (rev 9448)
@@ -0,0 +1,322 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.ws.core.jaxws.wsaddressing;
+
+import java.net.MalformedURLException;
+import java.net.URL;
+import java.util.List;
+import java.util.Map;
+
+import javax.xml.bind.JAXBContext;
+import javax.xml.bind.JAXBException;
+import javax.xml.bind.Marshaller;
+import javax.xml.bind.annotation.XmlAnyAttribute;
+import javax.xml.bind.annotation.XmlAnyElement;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlRootElement;
+import javax.xml.bind.annotation.XmlTransient;
+import javax.xml.bind.annotation.XmlType;
+import javax.xml.bind.annotation.XmlValue;
+import javax.xml.namespace.QName;
+import javax.xml.transform.Result;
+import javax.xml.transform.Source;
+import javax.xml.ws.EndpointReference;
+import javax.xml.ws.WebServiceException;
+
+import org.w3c.dom.Element;
+
+/**
+ * Internal representation of the W3CEndpointReference.
+ * This allows the W3CEndpointReference to programmatically
+ * build an EndpointReference specifying every parameter.
+ * Instances of this class are converted to (and can be
+ * created from) W3CEndpointReference using the
+ * @see EndpointReferenceUtil class.
+ *
+ * @author alessio.soldano(a)jboss.com
+ * @since 28-Feb-2009
+ *
+ */
+
+// XmlRootElement allows this class to be marshalled on its own
+@XmlRootElement(name = "EndpointReference", namespace = NativeEndpointReference.NS)
+@XmlType(name = "EndpointReferenceType", namespace = NativeEndpointReference.NS)
+public final class NativeEndpointReference extends EndpointReference
+{
+ protected static final String NS = "http://www.w3.org/2005/08/addressing";
+
+ private final static JAXBContext jc = getJaxbContext();
+
+ // private but necessary properties for databinding
+ @XmlElement(name = "Address", namespace = NS)
+ private Address address;
+ @XmlElement(name = "ReferenceParameters", namespace = NS)
+ private Elements referenceParameters;
+ @XmlElement(name = "Metadata", namespace = NS)
+ private Elements metadata;
+ @XmlAnyAttribute
+ Map<QName, String> attributes;
+ @XmlAnyElement
+ List<Element> elements;
+
+ // not marshalled
+ private QName serviceName;
+ private QName endpointName;
+ private URL wsdlLocation;
+
+ public NativeEndpointReference()
+ {
+ }
+
+ /**
+ * Creates an EPR from infoset representation
+ *
+ * @param source A source object containing valid XmlInfoset
+ * instance consistent with the W3C WS-Addressing Core
+ * recommendation.
+ *
+ * @throws WebServiceException
+ * If the source does NOT contain a valid W3C WS-Addressing
+ * EndpointReference.
+ * @throws NullPointerException
+ * If the <code>null</code> <code>source</code> value is given
+ */
+ public NativeEndpointReference(Source source)
+ {
+ try
+ {
+ NativeEndpointReference epr = jc.createUnmarshaller().unmarshal(source, NativeEndpointReference.class).getValue();
+ this.address = epr.address;
+ this.metadata = epr.metadata;
+ this.referenceParameters = epr.referenceParameters;
+ }
+ catch (JAXBException e)
+ {
+ throw new WebServiceException("Error unmarshalling NativeEndpointReference ", e);
+ }
+ catch (ClassCastException e)
+ {
+ throw new WebServiceException("Source did not contain NativeEndpointReference", e);
+ }
+ }
+
+ @XmlTransient
+ public String getAddress()
+ {
+ return address != null ? address.getUri() : null;
+ }
+
+ public void setAddress(String address)
+ {
+ this.address = new Address(address);
+ }
+
+ @XmlTransient
+ public QName getServiceName()
+ {
+ return serviceName;
+ }
+
+ public void setServiceName(QName serviceName)
+ {
+ this.serviceName = serviceName;
+ }
+
+ @XmlTransient
+ public QName getEndpointName()
+ {
+ return endpointName;
+ }
+
+ public void setEndpointName(QName endpointName)
+ {
+ this.endpointName = endpointName;
+ }
+
+ @XmlTransient
+ public List<Element> getMetadata()
+ {
+ return metadata != null ? metadata.getElements() : null;
+ }
+
+ public void setMetadata(List<Element> metadata)
+ {
+ this.metadata = new Elements(metadata);
+ }
+
+ @XmlTransient
+ public URL getWsdlLocation()
+ {
+ return wsdlLocation;
+ }
+
+ public void setWsdlLocation(String wsdlLocation)
+ {
+ try
+ {
+ this.wsdlLocation = wsdlLocation != null ? new URL(wsdlLocation) : null;
+ }
+ catch (MalformedURLException e)
+ {
+ throw new IllegalArgumentException("Invalid URL: " + wsdlLocation);
+ }
+ }
+
+ @XmlTransient
+ public List<Element> getReferenceParameters()
+ {
+ return referenceParameters != null ? referenceParameters.getElements() : null;
+ }
+
+ public void setReferenceParameters(List<Element> metadata)
+ {
+ this.referenceParameters = new Elements(metadata);
+ }
+
+ /**
+ * Directly read a NativeEndpointReference from the given source
+ * instead of leveraging the Provider's readEndpointReference method.
+ *
+ * @param eprInfoset
+ * @return
+ */
+ public static EndpointReference readFrom(Source eprInfoset)
+ {
+ if (eprInfoset == null)
+ throw new NullPointerException("Provided eprInfoset cannot be null");
+ try
+ {
+ return new NativeEndpointReference(eprInfoset);
+ }
+ catch (Exception e)
+ {
+ throw new WebServiceException(e);
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void writeTo(Result result)
+ {
+ try
+ {
+ Marshaller marshaller = jc.createMarshaller();
+ marshaller.setProperty(Marshaller.JAXB_FRAGMENT, true);
+ marshaller.marshal(this, result);
+ }
+ catch (JAXBException e)
+ {
+ throw new WebServiceException("Error marshalling NativeEndpointReference. ", e);
+ }
+ }
+
+ private static JAXBContext getJaxbContext()
+ {
+ try
+ {
+ return JAXBContext.newInstance(new Class[] { NativeEndpointReference.class });
+ }
+ catch (JAXBException ex)
+ {
+ throw new WebServiceException("Cannot obtain JAXB context", ex);
+ }
+ }
+
+ private static class Address
+ {
+ @XmlValue
+ String uri;
+ @XmlAnyAttribute
+ Map<QName, String> attributes;
+
+ protected Address()
+ {
+ }
+
+ public Address(String uri)
+ {
+ this.uri = uri;
+ }
+
+ @XmlTransient
+ public String getUri()
+ {
+ return uri;
+ }
+
+ public void setUri(String uri)
+ {
+ this.uri = uri;
+ }
+
+ @XmlTransient
+ public Map<QName, String> getAttributes()
+ {
+ return attributes;
+ }
+
+ public void setAttributes(Map<QName, String> attributes)
+ {
+ this.attributes = attributes;
+ }
+ }
+
+ private static class Elements
+ {
+ @XmlAnyElement
+ List<Element> elements;
+ @XmlAnyAttribute
+ Map<QName, String> attributes;
+
+ protected Elements()
+ {
+ }
+
+ public Elements(List<Element> elements)
+ {
+ this.elements = elements;
+ }
+
+ @XmlTransient
+ public List<Element> getElements()
+ {
+ return elements;
+ }
+
+ public void setElements(List<Element> elements)
+ {
+ this.elements = elements;
+ }
+
+ @XmlTransient
+ public Map<QName, String> getAttributes()
+ {
+ return attributes;
+ }
+
+ public void setAttributes(Map<QName, String> attributes)
+ {
+ this.attributes = attributes;
+ }
+ }
+}
Property changes on: stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/jaxws/wsaddressing/NativeEndpointReference.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Modified: stack/native/trunk/modules/core/src/main/java/org/jboss/wsf/stack/jbws/NativeWebServiceContext.java
===================================================================
--- stack/native/trunk/modules/core/src/main/java/org/jboss/wsf/stack/jbws/NativeWebServiceContext.java 2009-02-27 18:24:18 UTC (rev 9447)
+++ stack/native/trunk/modules/core/src/main/java/org/jboss/wsf/stack/jbws/NativeWebServiceContext.java 2009-02-28 14:33:21 UTC (rev 9448)
@@ -29,7 +29,7 @@
import javax.xml.ws.wsaddressing.W3CEndpointReferenceBuilder;
import org.jboss.ws.core.CommonMessageContext;
-import org.jboss.ws.core.jaxws.binding.EndpointReferenceUtil;
+import org.jboss.ws.core.jaxws.wsaddressing.EndpointReferenceUtil;
import org.jboss.ws.metadata.umdm.EndpointMetaData;
import org.jboss.wsf.spi.invocation.ExtensibleWebServiceContext;
import org.w3c.dom.Element;
Modified: stack/native/trunk/modules/jaxws/src/main/java/javax/xml/ws/EndpointReference.java
===================================================================
--- stack/native/trunk/modules/jaxws/src/main/java/javax/xml/ws/EndpointReference.java 2009-02-27 18:24:18 UTC (rev 9447)
+++ stack/native/trunk/modules/jaxws/src/main/java/javax/xml/ws/EndpointReference.java 2009-02-28 14:33:21 UTC (rev 9448)
@@ -23,6 +23,7 @@
import java.io.StringWriter;
+import javax.xml.bind.annotation.XmlTransient;
import javax.xml.transform.Result;
import javax.xml.transform.Source;
import javax.xml.transform.stream.StreamResult;
@@ -79,7 +80,7 @@
* @see Service
* @since JAX-WS 2.1
*/
-//@XmlTransient // to treat this class like Object as far as databinding is concerned (proposed JAXB 2.1 feature)
+@XmlTransient // to treat this class like Object as far as databinding is concerned (proposed JAXB 2.1 feature)
public abstract class EndpointReference
{
//
Modified: stack/native/trunk/modules/jaxws/src/main/java/javax/xml/ws/RespectBindingFeature.java
===================================================================
--- stack/native/trunk/modules/jaxws/src/main/java/javax/xml/ws/RespectBindingFeature.java 2009-02-27 18:24:18 UTC (rev 9447)
+++ stack/native/trunk/modules/jaxws/src/main/java/javax/xml/ws/RespectBindingFeature.java 2009-02-28 14:33:21 UTC (rev 9448)
@@ -94,7 +94,7 @@
*
* Constant value identifying the RespectBindingFeature
*/
- public static final String ID = "javax.xml.ws.InspectBindingFeature";
+ public static final String ID = "javax.xml.ws.RespectBindingFeature";
/**
* Create an <code>RespectBindingFeature</code>.
Modified: stack/native/trunk/modules/jaxws/src/main/java/javax/xml/ws/wsaddressing/W3CEndpointReference.java
===================================================================
--- stack/native/trunk/modules/jaxws/src/main/java/javax/xml/ws/wsaddressing/W3CEndpointReference.java 2009-02-27 18:24:18 UTC (rev 9447)
+++ stack/native/trunk/modules/jaxws/src/main/java/javax/xml/ws/wsaddressing/W3CEndpointReference.java 2009-02-28 14:33:21 UTC (rev 9448)
@@ -21,7 +21,6 @@
*/
package javax.xml.ws.wsaddressing;
-import java.net.MalformedURLException;
import java.net.URL;
import java.util.List;
import java.util.Map;
@@ -82,11 +81,6 @@
Map<QName, String> attributes;
@XmlAnyElement
List<Element> elements;
-
- // not marshalled
- private QName serviceName;
- private QName endpointName;
- private URL wsdlLocation;
protected W3CEndpointReference()
{
@@ -124,79 +118,6 @@
}
}
- @XmlTransient
- public String getAddress()
- {
- return address != null ? address.getUri() : null;
- }
-
- void setAddress(String address)
- {
- this.address = new Address(address);
- }
-
- @XmlTransient
- public QName getServiceName()
- {
- return serviceName;
- }
-
- public void setServiceName(QName serviceName)
- {
- this.serviceName = serviceName;
- }
-
- @XmlTransient
- public QName getEndpointName()
- {
- return endpointName;
- }
-
- public void setEndpointName(QName endpointName)
- {
- this.endpointName = endpointName;
- }
-
- @XmlTransient
- public List<Element> getMetadata()
- {
- return metadata != null ? metadata.getElements() : null;
- }
-
- public void setMetadata(List<Element> metadata)
- {
- this.metadata = new Elements(metadata);
- }
-
- @XmlTransient
- public URL getWsdlLocation()
- {
- return wsdlLocation;
- }
-
- public void setWsdlLocation(String wsdlLocation)
- {
- try
- {
- this.wsdlLocation = wsdlLocation != null ? new URL(wsdlLocation) : null;
- }
- catch (MalformedURLException e)
- {
- throw new IllegalArgumentException("Invalid URL: " + wsdlLocation);
- }
- }
-
- @XmlTransient
- public List<Element> getReferenceParameters()
- {
- return referenceParameters != null ? referenceParameters.getElements() : null;
- }
-
- public void setReferenceParameters(List<Element> metadata)
- {
- this.referenceParameters = new Elements(metadata);
- }
-
/**
* {@inheritDoc}
*/
Modified: stack/native/trunk/modules/jaxws/src/main/java/javax/xml/ws/wsaddressing/W3CEndpointReferenceBuilder.java
===================================================================
--- stack/native/trunk/modules/jaxws/src/main/java/javax/xml/ws/wsaddressing/W3CEndpointReferenceBuilder.java 2009-02-27 18:24:18 UTC (rev 9447)
+++ stack/native/trunk/modules/jaxws/src/main/java/javax/xml/ws/wsaddressing/W3CEndpointReferenceBuilder.java 2009-02-28 14:33:21 UTC (rev 9448)
@@ -26,6 +26,7 @@
import javax.xml.namespace.QName;
import javax.xml.ws.WebServiceException;
+import javax.xml.ws.spi.Provider;
import org.w3c.dom.Element;
@@ -260,13 +261,8 @@
*/
public W3CEndpointReference build()
{
- W3CEndpointReference epr = new W3CEndpointReference();
- epr.setAddress(address);
- epr.setServiceName(serviceName);
- epr.setEndpointName(endpointName);
- epr.setMetadata(metadata);
- epr.setWsdlLocation(wsdlLocation);
- epr.setReferenceParameters(parameters);
- return epr;
+ return Provider.provider().createW3CEndpointReference(address,
+ serviceName, endpointName, metadata, wsdlLocation,
+ parameters);
}
}
Added: stack/native/trunk/modules/jaxws/src/main/java/javax/xml/ws/wsaddressing/package-info.java
===================================================================
--- stack/native/trunk/modules/jaxws/src/main/java/javax/xml/ws/wsaddressing/package-info.java (rev 0)
+++ stack/native/trunk/modules/jaxws/src/main/java/javax/xml/ws/wsaddressing/package-info.java 2009-02-28 14:33:21 UTC (rev 9448)
@@ -0,0 +1,24 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+(a)javax.xml.bind.annotation.XmlSchema(namespace = "http://www.w3.org/2005/08/addressing",
+ location = "http://www.w3.org/2006/03/addressing/ws-addr.xsd")
+package javax.xml.ws.wsaddressing;
\ No newline at end of file
Property changes on: stack/native/trunk/modules/jaxws/src/main/java/javax/xml/ws/wsaddressing/package-info.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
15 years, 9 months
JBossWS SVN: r9447 - stack/native/trunk/modules/core/src/main/java/org/jboss/ws/metadata/umdm.
by jbossws-commits@lists.jboss.org
Author: darran.lofthouse(a)jboss.com
Date: 2009-02-27 13:24:18 -0500 (Fri, 27 Feb 2009)
New Revision: 9447
Modified:
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/metadata/umdm/EndpointMetaData.java
Log:
[JBWS-2559] Correct WeakReference handling in ConfigObservable to remove cleared WeakReferences.
Modified: stack/native/trunk/modules/core/src/main/java/org/jboss/ws/metadata/umdm/EndpointMetaData.java
===================================================================
--- stack/native/trunk/modules/core/src/main/java/org/jboss/ws/metadata/umdm/EndpointMetaData.java 2009-02-27 18:00:26 UTC (rev 9446)
+++ stack/native/trunk/modules/core/src/main/java/org/jboss/ws/metadata/umdm/EndpointMetaData.java 2009-02-27 18:24:18 UTC (rev 9447)
@@ -21,6 +21,8 @@
*/
package org.jboss.ws.metadata.umdm;
+import java.lang.ref.Reference;
+import java.lang.ref.ReferenceQueue;
import java.lang.ref.WeakReference;
import java.lang.reflect.Method;
import java.util.ArrayList;
@@ -675,9 +677,9 @@
if (retParam != null)
createAccessor(retParam, jaxbCtx);
}
-
+
}
-
+
private void eagerInitializeJAXBContextCache()
{
//initialize jaxb context cache
@@ -685,7 +687,7 @@
{
log.debug("Initializing JAXBContext cache...");
BindingCustomization bindingCustomization = null;
- if(this instanceof ServerEndpointMetaData)
+ if (this instanceof ServerEndpointMetaData)
{
bindingCustomization = ((ServerEndpointMetaData)this).getEndpoint().getAttachment(BindingCustomization.class);
}
@@ -928,6 +930,7 @@
class ConfigObservable extends Observable
{
+ private ReferenceQueue<WeakReference<Observer>> queue = new ReferenceQueue<WeakReference<Observer>>();
private List<WeakReference<Observer>> observer = new ArrayList<WeakReference<Observer>>();
public void doNotify(Object object)
@@ -938,15 +941,17 @@
public synchronized void addObserver(Observer o)
{
- observer.add(new WeakReference(o));
+ clearCollected();
+ observer.add(new WeakReference(o, queue));
}
public synchronized void deleteObserver(Observer o)
{
+ clearCollected();
for (WeakReference<Observer> w : observer)
{
Observer tmp = w.get();
- if (tmp.equals(o))
+ if (tmp != null && tmp.equals(o))
{
observer.remove(o);
break;
@@ -962,16 +967,29 @@
public void notifyObservers(Object arg)
{
+ clearCollected();
if (hasChanged())
{
for (WeakReference<Observer> w : observer)
{
Observer tmp = w.get();
- tmp.update(this, arg);
-
+ if (tmp != null)
+ {
+ tmp.update(this, arg);
+ }
}
}
}
+
+ private void clearCollected()
+ {
+ Reference ref;
+ while ((ref = queue.poll()) != null)
+ {
+ observer.remove(ref);
+ }
+
+ }
}
public List<UnifiedPortComponentRefMetaData> getServiceRefContrib()
15 years, 10 months