JBossWS SVN: r13020 - container/jboss60/branches.
by jbossws-commits@lists.jboss.org
Author: richard.opalka(a)jboss.com
Date: 2010-09-24 07:03:11 -0400 (Fri, 24 Sep 2010)
New Revision: 13020
Added:
container/jboss60/branches/jbossws-jboss600M5/
Removed:
container/jboss60/branches/jbossws-jboss600M4/
Log:
renaming branch
Copied: container/jboss60/branches/jbossws-jboss600M5 (from rev 13019, container/jboss60/branches/jbossws-jboss600M4)
14 years, 3 months
JBossWS SVN: r13019 - container/jboss60/branches/jbossws-jboss600M4.
by jbossws-commits@lists.jboss.org
Author: richard.opalka(a)jboss.com
Date: 2010-09-24 07:01:12 -0400 (Fri, 24 Sep 2010)
New Revision: 13019
Modified:
container/jboss60/branches/jbossws-jboss600M4/pom.xml
Log:
switch from AS 600M4 to 600M5
Modified: container/jboss60/branches/jbossws-jboss600M4/pom.xml
===================================================================
--- container/jboss60/branches/jbossws-jboss600M4/pom.xml 2010-09-24 10:55:06 UTC (rev 13018)
+++ container/jboss60/branches/jbossws-jboss600M4/pom.xml 2010-09-24 11:01:12 UTC (rev 13019)
@@ -4,7 +4,7 @@
<name>JBoss Web Services - Container JBoss-6.0.0.M4</name>
<groupId>org.jboss.ws</groupId>
- <artifactId>jbossws-jboss600M4</artifactId>
+ <artifactId>jbossws-jboss600M5</artifactId>
<description>JBossWS Container integration for JBoss AS 6.0.0.M4</description>
<version>3.4.0-SNAPSHOT</version>
@@ -18,9 +18,9 @@
<!-- Source Control Management -->
<scm>
- <connection>scm:svn:http://anonsvn.jboss.org/repos/jbossws/container/jboss60/branches...</connection>
- <developerConnection>scm:svn:https://svn.jboss.org/repos/jbossws/container/jboss60/branches/jb...</developerConnection>
- <url>http://fisheye.jboss.com/viewrep/JBossWS/container/jboss60/branches/jboss...</url>
+ <connection>scm:svn:http://anonsvn.jboss.org/repos/jbossws/container/jboss60/branches...</connection>
+ <developerConnection>scm:svn:https://svn.jboss.org/repos/jbossws/container/jboss60/branches/jb...</developerConnection>
+ <url>http://fisheye.jboss.com/viewrep/JBossWS/container/jboss60/branches/jboss...</url>
</scm>
<!-- Properties -->
@@ -28,15 +28,15 @@
<jbossws.framework.version>3.4.0-SNAPSHOT</jbossws.framework.version>
<jbossws.common.version>1.4.0-SNAPSHOT</jbossws.common.version>
<jbossws.spi.version>1.4.0-SNAPSHOT</jbossws.spi.version>
- <jboss.version>6.0.0.20100721-M4</jboss.version>
- <jboss.deployers.version>2.2.0.Alpha6</jboss.deployers.version>
+ <jboss.version>6.0.0.20100911-M5</jboss.version>
+ <jboss.deployers.version>2.2.0.Alpha7</jboss.deployers.version>
<jboss.jbossxb.version>2.0.2.Beta7</jboss.jbossxb.version>
<jboss.metadata.version>2.0.0.Alpha16</jboss.metadata.version>
<jboss.reflect.version>2.2.0.Alpha9</jboss.reflect.version>
<jboss.security.version>3.0.0.Beta4</jboss.security.version>
<jboss.vfs.version>3.0.0.CR5</jboss.vfs.version>
- <jboss.cl.version>2.2.0.Alpha7</jboss.cl.version>
- <jboss.hornetq.version>2.1.1.Final</jboss.hornetq.version>
+ <jboss.cl.version>2.2.0.Alpha8</jboss.cl.version>
+ <jboss.hornetq.version>2.1.2.Final</jboss.hornetq.version>
</properties>
<!-- DependencyManagement -->
14 years, 3 months
JBossWS SVN: r13018 - in stack/cxf/trunk: modules/management and 3 other directories.
by jbossws-commits@lists.jboss.org
Author: richard.opalka(a)jboss.com
Date: 2010-09-24 06:55:06 -0400 (Fri, 24 Sep 2010)
New Revision: 13018
Modified:
stack/cxf/trunk/modules/management/pom.xml
stack/cxf/trunk/modules/server/pom.xml
stack/cxf/trunk/modules/testsuite/pom.xml
stack/cxf/trunk/modules/testsuite/test-excludes-jboss600.txt
stack/cxf/trunk/pom.xml
stack/cxf/trunk/profiles.xml.example
stack/cxf/trunk/src/main/scripts/assembly-deploy-artifacts.xml
Log:
switch from AS 600M4 to 600M5
Modified: stack/cxf/trunk/modules/management/pom.xml
===================================================================
--- stack/cxf/trunk/modules/management/pom.xml 2010-09-23 12:00:05 UTC (rev 13017)
+++ stack/cxf/trunk/modules/management/pom.xml 2010-09-24 10:55:06 UTC (rev 13018)
@@ -61,7 +61,7 @@
</dependency>
<dependency>
<groupId>org.jboss.ws</groupId>
- <artifactId>jbossws-jboss600M4</artifactId>
+ <artifactId>jbossws-jboss600M5</artifactId>
<scope>provided</scope>
<exclusions>
<exclusion>
Modified: stack/cxf/trunk/modules/server/pom.xml
===================================================================
--- stack/cxf/trunk/modules/server/pom.xml 2010-09-23 12:00:05 UTC (rev 13017)
+++ stack/cxf/trunk/modules/server/pom.xml 2010-09-24 10:55:06 UTC (rev 13018)
@@ -298,8 +298,8 @@
</artifactItem>
<artifactItem>
<groupId>org.jboss.ws</groupId>
- <artifactId>jbossws-jboss600M4</artifactId>
- <version>${jbossws.jboss600M4.version}</version>
+ <artifactId>jbossws-jboss600M5</artifactId>
+ <version>${jbossws.jboss600M5.version}</version>
<classifier>resources</classifier>
<type>zip</type>
<outputDirectory>${project.build.directory}/resources/jbossws-jboss600</outputDirectory>
Modified: stack/cxf/trunk/modules/testsuite/pom.xml
===================================================================
--- stack/cxf/trunk/modules/testsuite/pom.xml 2010-09-23 12:00:05 UTC (rev 13017)
+++ stack/cxf/trunk/modules/testsuite/pom.xml 2010-09-24 10:55:06 UTC (rev 13018)
@@ -516,7 +516,7 @@
<profile>
<id>jboss600</id>
<properties>
- <jboss.version>6.0.0.20100721-M4</jboss.version>
+ <jboss.version>6.0.0.20100911-M5</jboss.version>
<jbossws.integration.target>jboss600</jbossws.integration.target>
</properties>
<dependencies>
Modified: stack/cxf/trunk/modules/testsuite/test-excludes-jboss600.txt
===================================================================
--- stack/cxf/trunk/modules/testsuite/test-excludes-jboss600.txt 2010-09-23 12:00:05 UTC (rev 13017)
+++ stack/cxf/trunk/modules/testsuite/test-excludes-jboss600.txt 2010-09-24 10:55:06 UTC (rev 13018)
@@ -22,5 +22,8 @@
# [JBWS-2987] Review JMS integration
org/jboss/test/ws/jaxws/samples/jmstransport/**
-# [JBAS-8403] excluding test until jboss-web.xml override is fixed
+# [JBAS-8363] Virtual host issue in JBossWeb
+org/jboss/test/ws/jaxws/jbws981/JBWS981TestCase.*
+
+# [JBAS-8403] jboss-web.xml override have been fixed since AS 600 CR1
org/jboss/test/ws/jaxws/jbws3123/JBWS3123TestCase.*
Modified: stack/cxf/trunk/pom.xml
===================================================================
--- stack/cxf/trunk/pom.xml 2010-09-23 12:00:05 UTC (rev 13017)
+++ stack/cxf/trunk/pom.xml 2010-09-24 10:55:06 UTC (rev 13018)
@@ -51,7 +51,7 @@
<jbossws.framework.version>3.4.0-SNAPSHOT</jbossws.framework.version>
<jbossws.jboss501.version>3.4.0-SNAPSHOT</jbossws.jboss501.version>
<jbossws.jboss510.version>3.4.0-SNAPSHOT</jbossws.jboss510.version>
- <jbossws.jboss600M4.version>3.4.0-SNAPSHOT</jbossws.jboss600M4.version>
+ <jbossws.jboss600M5.version>3.4.0-SNAPSHOT</jbossws.jboss600M5.version>
<!-- JBWS-2505 -->
<!-- START -->
<!--
@@ -145,13 +145,13 @@
</dependency>
<dependency>
<groupId>org.jboss.ws</groupId>
- <artifactId>jbossws-jboss600M4</artifactId>
- <version>${jbossws.jboss600M4.version}</version>
+ <artifactId>jbossws-jboss600M5</artifactId>
+ <version>${jbossws.jboss600M5.version}</version>
</dependency>
<dependency>
<groupId>org.jboss.ws</groupId>
- <artifactId>jbossws-jboss600M4</artifactId>
- <version>${jbossws.jboss600M4.version}</version>
+ <artifactId>jbossws-jboss600M5</artifactId>
+ <version>${jbossws.jboss600M5.version}</version>
<classifier>resources</classifier>
<type>zip</type>
</dependency>
Modified: stack/cxf/trunk/profiles.xml.example
===================================================================
--- stack/cxf/trunk/profiles.xml.example 2010-09-23 12:00:05 UTC (rev 13017)
+++ stack/cxf/trunk/profiles.xml.example 2010-09-24 10:55:06 UTC (rev 13018)
@@ -13,7 +13,7 @@
<properties>
<jboss501.home>/home/opalka/svn/jbossas/tags/JBoss_5_0_1_GA/build/output/jboss-5.0.1.GA</jboss501.home>
<jboss510.home>/home/opalka/svn/jbossas/tags/JBoss_5_1_0_GA/build/output/jboss-5.1.0.GA</jboss510.home>
- <jboss600.home>/home/opalka/svn/jbossas/tags/6.0.0.20100721-M4/build/target/6.0.0.20100721-M4</jboss600.home>
+ <jboss600.home>/home/opalka/svn/jbossas/tags/6.0.0.20100911-M5/build/target/jboss-6.0.0.20100911-M5</jboss600.home>
<jboss601.home>/home/opalka/svn/jbossas/trunk/build/output/jboss-6.0.0-SNAPSHOT</jboss601.home>
</properties>
</profile>
Modified: stack/cxf/trunk/src/main/scripts/assembly-deploy-artifacts.xml
===================================================================
--- stack/cxf/trunk/src/main/scripts/assembly-deploy-artifacts.xml 2010-09-23 12:00:05 UTC (rev 13017)
+++ stack/cxf/trunk/src/main/scripts/assembly-deploy-artifacts.xml 2010-09-24 10:55:06 UTC (rev 13018)
@@ -157,7 +157,7 @@
<scope>provided</scope>
<unpack>false</unpack>
<includes>
- <include>org.jboss.ws:jbossws-jboss600M4:jar</include>
+ <include>org.jboss.ws:jbossws-jboss600M5:jar</include>
</includes>
</dependencySet>
<!-- [JBWS-2505] -->
14 years, 3 months
JBossWS SVN: r13016 - spi/tags.
by jbossws-commits@lists.jboss.org
Author: richard.opalka(a)jboss.com
Date: 2010-09-23 07:56:28 -0400 (Thu, 23 Sep 2010)
New Revision: 13016
Added:
spi/tags/jbossws-spi-1.4.0.Beta3/
Log:
creating JBossWS SPI 1.4.0.Beta3 tag
Copied: spi/tags/jbossws-spi-1.4.0.Beta3 (from rev 13015, spi/trunk)
14 years, 3 months
JBossWS SVN: r13015 - in stack/native/trunk/modules/core/src/main/java/org/jboss/ws: extensions/wsrm/transport/backchannel and 1 other directory.
by jbossws-commits@lists.jboss.org
Author: sergeyb
Date: 2010-09-23 07:07:03 -0400 (Thu, 23 Sep 2010)
New Revision: 13015
Modified:
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/client/transport/NettyClient.java
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/extensions/wsrm/transport/backchannel/RMRequestHandlerImpl.java
Log:
[JBWS-3116] : Fixing WSRM test regressions and updating NettyClient to have Host header including the port if specified
Modified: stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/client/transport/NettyClient.java
===================================================================
--- stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/client/transport/NettyClient.java 2010-09-23 10:37:46 UTC (rev 13014)
+++ stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/client/transport/NettyClient.java 2010-09-23 11:07:03 UTC (rev 13015)
@@ -177,7 +177,7 @@
String targetRequestUri = isProxyRequest(additionalHeaders) ? targetAddress : getRelativeRequestUri(target);
HttpRequest request = new DefaultHttpRequest(HttpVersion.HTTP_1_1, reqMessage != null ? HttpMethod.POST : HttpMethod.GET, targetRequestUri);
- request.addHeader(HttpHeaders.Names.HOST, target.getHost());
+ request.addHeader(HttpHeaders.Names.HOST, target.getAuthority());
request.addHeader(HttpHeaders.Names.CONNECTION, HttpHeaders.Values.KEEP_ALIVE);
setAdditionalHeaders(request, additionalHeaders);
setActualChunkedLength(request, callProps);
Modified: stack/native/trunk/modules/core/src/main/java/org/jboss/ws/extensions/wsrm/transport/backchannel/RMRequestHandlerImpl.java
===================================================================
--- stack/native/trunk/modules/core/src/main/java/org/jboss/ws/extensions/wsrm/transport/backchannel/RMRequestHandlerImpl.java 2010-09-23 10:37:46 UTC (rev 13014)
+++ stack/native/trunk/modules/core/src/main/java/org/jboss/ws/extensions/wsrm/transport/backchannel/RMRequestHandlerImpl.java 2010-09-23 11:07:03 UTC (rev 13015)
@@ -21,7 +21,7 @@
*/
package org.jboss.ws.extensions.wsrm.transport.backchannel;
-import java.net.URL;
+import java.net.URI;
import java.util.HashMap;
import java.util.Map;
import java.util.Set;
@@ -77,7 +77,8 @@
boolean error = false;
try
{
- String requestPath = new URL(request.getUri()).getPath();
+ URI requestURI = URI.create(request.getUri());
+ String requestPath = requestURI.getRawPath();
RMMessage message = (RMMessage)RMUnMarshaller.getInstance().read(content.readable() ? new ChannelBufferInputStream(content) : null, null, requestHeaders);
handle(requestPath, message);
}
14 years, 3 months
JBossWS SVN: r13014 - stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/jaxws/client.
by jbossws-commits@lists.jboss.org
Author: richard.opalka(a)jboss.com
Date: 2010-09-23 06:37:46 -0400 (Thu, 23 Sep 2010)
New Revision: 13014
Modified:
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/jaxws/client/NativeServiceRefBinderJAXWS.java
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/jaxws/client/ServiceObjectFactoryJAXWS.java
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/jaxws/client/ServiceReferenceable.java
Log:
[JBWS-3133] ServiceRef & PortComponentRef UMDM now respects @Addressing, @MTOM and @RespectBinding MDs
Modified: stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/jaxws/client/NativeServiceRefBinderJAXWS.java
===================================================================
--- stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/jaxws/client/NativeServiceRefBinderJAXWS.java 2010-09-23 10:37:04 UTC (rev 13013)
+++ stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/jaxws/client/NativeServiceRefBinderJAXWS.java 2010-09-23 10:37:46 UTC (rev 13014)
@@ -106,32 +106,7 @@
}
}
}
-
- if (addressingAnnotation != null)
- {
- if (addressingAnnotation.enabled())
- serviceRef.setAddressingEnabled();
-
- if (addressingAnnotation.required())
- serviceRef.setAddressingRequired();
-
- if (addressingAnnotation.responses() == AddressingFeature.Responses.ANONYMOUS)
- serviceRef.setAddressingResponses("ANONYMOUS");
- else if (addressingAnnotation.responses() == AddressingFeature.Responses.NON_ANONYMOUS)
- serviceRef.setAddressingResponses("NON_ANONYMOUS");
- else
- serviceRef.setAddressingResponses("ALL");
- }
-
- if ((mtomAnnotation != null) && mtomAnnotation.enabled()) {
- serviceRef.setMtomEnabled();
- serviceRef.setMtomThreshold(mtomAnnotation.threshold());
- }
- if ((respectBindingAnnotation != null) && respectBindingAnnotation.enabled()) {
- serviceRef.setRespectBindingEnabled();
- }
-
// Use the single @WebServiceRef
if (wsrefList.size() == 1)
{
@@ -254,6 +229,22 @@
}
}
+ if (addressingAnnotation != null)
+ {
+ serviceRef.setAddressingEnabled(addressingAnnotation.enabled());
+ serviceRef.setAddressingRequired(addressingAnnotation.required());
+ serviceRef.setAddressingResponses(addressingAnnotation.responses().toString());
+ }
+
+ if (mtomAnnotation != null) {
+ serviceRef.setMtomEnabled(mtomAnnotation.enabled());
+ serviceRef.setMtomThreshold(mtomAnnotation.threshold());
+ }
+
+ if (respectBindingAnnotation != null) {
+ serviceRef.setRespectBindingEnabled(respectBindingAnnotation.enabled());
+ }
+
// Do not use rebind, the binding should be unique
// [JBWS-1499] - Revisit WebServiceRefHandler JNDI rebind
Referenceable serviceReferenceable = buildServiceReferenceable(serviceImplClass, targetClassName, serviceRef);
Modified: stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/jaxws/client/ServiceObjectFactoryJAXWS.java
===================================================================
--- stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/jaxws/client/ServiceObjectFactoryJAXWS.java 2010-09-23 10:37:04 UTC (rev 13013)
+++ stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/jaxws/client/ServiceObjectFactoryJAXWS.java 2010-09-23 10:37:46 UTC (rev 13014)
@@ -21,20 +21,6 @@
*/
package org.jboss.ws.core.jaxws.client;
-import org.jboss.logging.Logger;
-import org.jboss.ws.WSException;
-import org.jboss.ws.core.ConfigProvider;
-import org.jboss.ws.core.client.ServiceObjectFactory;
-import org.jboss.wsf.spi.metadata.j2ee.serviceref.UnifiedServiceRefMetaData;
-
-import javax.naming.*;
-import javax.xml.namespace.QName;
-import javax.xml.ws.RespectBindingFeature;
-import javax.xml.ws.Service;
-import javax.xml.ws.WebServiceFeature;
-import javax.xml.ws.soap.AddressingFeature;
-import javax.xml.ws.soap.MTOMFeature;
-
import java.io.ByteArrayInputStream;
import java.io.IOException;
import java.io.ObjectInputStream;
@@ -42,15 +28,36 @@
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.net.URL;
+import java.util.Collection;
import java.util.Hashtable;
import java.util.LinkedList;
import java.util.List;
+import javax.naming.Context;
+import javax.naming.Name;
+import javax.naming.NamingException;
+import javax.naming.RefAddr;
+import javax.naming.Reference;
+import javax.xml.namespace.QName;
+import javax.xml.ws.RespectBindingFeature;
+import javax.xml.ws.Service;
+import javax.xml.ws.WebServiceFeature;
+import javax.xml.ws.soap.AddressingFeature;
+import javax.xml.ws.soap.MTOMFeature;
+
+import org.jboss.logging.Logger;
+import org.jboss.ws.core.ConfigProvider;
+import org.jboss.ws.core.client.ServiceObjectFactory;
+import org.jboss.wsf.spi.WSFException;
+import org.jboss.wsf.spi.metadata.j2ee.serviceref.UnifiedPortComponentRefMetaData;
+import org.jboss.wsf.spi.metadata.j2ee.serviceref.UnifiedServiceRefMetaData;
+
/**
* This ServiceObjectFactory reconstructs a javax.xml.ws.Service
- * for a given WSDL when the webservice client does a JNDI lookup
+ * for a given WSDL when the webservice client does a JNDI lookup.
*
* @author Thomas.Diesler(a)jboss.org
+ * @author Richard.Opalka(a)jboss.org
* @since 24-Oct-2004
*/
public class ServiceObjectFactoryJAXWS extends ServiceObjectFactory
@@ -81,201 +88,367 @@
* @see javax.naming.spi.NamingManager#getObjectInstance
* @see javax.naming.spi.NamingManager#getURLContext
*/
- public Object getObjectInstance(Object obj, Name name, Context nameCtx, Hashtable environment) throws Exception
+ @SuppressWarnings(value = "unchecked")
+ public Object getObjectInstance(final Object obj, final Name name, final Context nameCtx, final Hashtable environment)
+ throws Exception
{
try
{
- Reference ref = (Reference)obj;
+ // references
+ final Reference ref = (Reference) obj;
+ final UnifiedServiceRefMetaData serviceRef = unmarshallServiceRef(ref);
+ // class names
+ final String serviceImplClass = this.getServiceClassName(ref, serviceRef);
+ final String targetClassName = this.getTargetClassName(ref, serviceRef, serviceImplClass);
+ // class instances
+ final Class<?> serviceClass = this.getClass(serviceImplClass);
+ final Class<?> targetClass = this.getClass(targetClassName);
+ final Service serviceInstance;
+ try
+ {
+ // Associate the ServiceRefMetaData with this thread
+ serviceRefAssociation.set(serviceRef);
+ // construct service
+ serviceInstance = this.instantiateService(serviceRef, serviceClass);
+ }
+ finally
+ {
+ serviceRefAssociation.set(null);
+ }
+ // Configure the service
+ configureService(serviceInstance, serviceRef);
+ // construct port
+ final boolean instantiatePort = targetClassName != null && !targetClassName.equals(serviceImplClass);
+ if (instantiatePort)
+ {
+ final QName portQName = this.getPortQName(targetClassName, serviceImplClass, serviceRef);
+ final WebServiceFeature[] portFeatures = this.getFeatures(targetClassName, serviceImplClass, serviceRef);
- // Get the target class name
- String targetClassName = (String)ref.get(ServiceReferenceable.TARGET_CLASS_NAME).getContent();
+ return instantiatePort(serviceClass, targetClass, serviceInstance, portQName, portFeatures);
+ }
- // Unmarshall the UnifiedServiceRef
- UnifiedServiceRefMetaData serviceRef = unmarshallServiceRef(ref);
- String serviceRefName = serviceRef.getServiceRefName();
- QName serviceQName = serviceRef.getServiceQName();
+ return serviceInstance;
+ }
+ catch (Exception ex)
+ {
+ WSFException.rethrow("Cannot create service", ex);
+ }
- String serviceImplClass = serviceRef.getServiceImplClass();
- if (serviceImplClass == null)
- serviceImplClass = (String)ref.get(ServiceReferenceable.SERVICE_IMPL_CLASS).getContent();
+ return null;
+ }
- // If the target defaults to javax.xml.ws.Service, use the service as the target
- if (Service.class.getName().equals(targetClassName))
- targetClassName = serviceImplClass;
-
- if (log.isDebugEnabled())
- log.debug("[name=" + serviceRefName + ",service=" + serviceImplClass + ",target=" + targetClassName + "]");
+ public static UnifiedServiceRefMetaData getServiceRefAssociation()
+ {
+ return serviceRefAssociation.get();
+ }
- // Load the service class
- ClassLoader ctxLoader = SecurityActions.getContextClassLoader();
- Class serviceClass = SecurityActions.loadClass(ctxLoader, serviceImplClass);
- Class targetClass = (targetClassName != null ? ctxLoader.loadClass(targetClassName) : null);
+ private void configureService(final Service service, final UnifiedServiceRefMetaData serviceRef)
+ {
+ final String configFile = serviceRef.getConfigFile();
+ final String configName = serviceRef.getConfigName();
+ if (service instanceof ConfigProvider)
+ {
+ if(log.isDebugEnabled()) log.debug("Configure Service: [configName=" + configName + ",configFile=" + configFile + "]");
- if (Service.class.isAssignableFrom(serviceClass) == false)
- throw new IllegalArgumentException("WebServiceRef type '" + serviceClass + "' is not assignable to javax.xml.ws.Service");
-
- if (log.isDebugEnabled())
- log.debug("Loaded Service '" + serviceClass.getName() + "' from: " + serviceClass.getProtectionDomain().getCodeSource());
-
- List<WebServiceFeature> features = new LinkedList<WebServiceFeature>();
-
- // configure addressing feature
- if (serviceRef.isAddressingEnabled()) {
- final boolean required = serviceRef.isAddressingRequired();
- final String refResponses = serviceRef.getAddressingResponses();
- AddressingFeature.Responses responses = AddressingFeature.Responses.ALL;
- if ("ANONYMOUS".equals(refResponses))
- responses = AddressingFeature.Responses.ANONYMOUS;
- if ("NON_ANONYMOUS".equals(refResponses))
- responses = AddressingFeature.Responses.NON_ANONYMOUS;
-
- features.add(new AddressingFeature(true, required, responses));
+ final ConfigProvider cp = (ConfigProvider)service;
+ if (configName != null || configFile != null)
+ {
+ cp.setConfigName(configName, configFile);
}
+ }
+ }
- // configure MTOM feature
- if (serviceRef.isMtomEnabled()) {
- features.add(new MTOMFeature(true, serviceRef.getMtomThreshold()));
- }
+ private Class<?> getClass(final String className) throws ClassNotFoundException
+ {
+ if (className != null)
+ {
+ return SecurityActions.getContextClassLoader().loadClass(className);
+ }
- // configure respect binding feature
- if (serviceRef.isRespectBindingEnabled()) {
- features.add(new RespectBindingFeature(true));
+ return null;
+ }
+
+ private String getServiceClassName(final Reference ref, final UnifiedServiceRefMetaData serviceRefMD)
+ {
+ String serviceClassName = serviceRefMD.getServiceImplClass();
+ if (serviceClassName == null)
+ serviceClassName = (String) ref.get(ServiceReferenceable.SERVICE_IMPL_CLASS).getContent();
+
+ return serviceClassName;
+ }
+
+ private String getTargetClassName(final Reference ref, final UnifiedServiceRefMetaData serviceRefMD,
+ final String serviceImplClass)
+ {
+ String targetClassName = serviceRefMD.getServiceRefType();
+ if (targetClassName == null)
+ targetClassName = (String) ref.get(ServiceReferenceable.TARGET_CLASS_NAME).getContent();
+
+ if (Service.class.getName().equals(targetClassName))
+ targetClassName = serviceImplClass;
+
+ return targetClassName;
+ }
+
+ private Object instantiatePort(final Class<?> serviceClass, final Class<?> targetClass, final Service target,
+ final QName portQName, final WebServiceFeature[] features) throws NoSuchMethodException,
+ InstantiationException, IllegalAccessException, InvocationTargetException
+ {
+ Object retVal = null;
+
+ Object port = null;
+ if (serviceClass != Service.class)
+ {
+ for (Method method : serviceClass.getDeclaredMethods())
+ {
+ String methodName = method.getName();
+ Class<?> retType = method.getReturnType();
+ if (methodName.startsWith("get") && targetClass.isAssignableFrom(retType))
+ {
+ port = method.invoke(target, new Object[0]);
+ retVal = port;
+ break;
+ }
}
+ }
- // Receives either a javax.xml.ws.Service or a dynamic proxy
- Object target;
- URL wsdlURL = serviceRef.getWsdlLocation();
- WebServiceFeature[] wsFeatures = features.size() == 0 ? null : features.toArray(new WebServiceFeature[] {});
- try
+ if (port == null)
+ {
+ Method method = getMethodFor(portQName, features, serviceClass);
+ Object[] args = getArgumentsFor(portQName, features, targetClass);
+ port = method.invoke(target, args);
+ retVal = port;
+ }
+
+ return retVal;
+ }
+
+ private Service instantiateService(final UnifiedServiceRefMetaData serviceRefMD, final Class<?> serviceClass)
+ throws NoSuchMethodException, InstantiationException, IllegalAccessException, InvocationTargetException
+ {
+ final WebServiceFeature[] features = getFeatures(serviceRefMD);
+ final URL wsdlURL = serviceRefMD.getWsdlLocation();
+ final QName serviceQName = serviceRefMD.getServiceQName();
+
+ Service target = null;
+ if (serviceClass == Service.class)
+ {
+ // Generic javax.xml.ws.Service
+ if (wsdlURL != null)
{
- // Associate the ServiceRefMetaData with this thread
- serviceRefAssociation.set(serviceRef);
-
- // Generic javax.xml.ws.Service
- if (serviceClass == Service.class)
+ if (features != null)
{
- if (wsdlURL != null)
- {
- if (wsFeatures != null) {
- target = Service.create(wsdlURL, serviceQName, wsFeatures);
- } else {
- target = Service.create(wsdlURL, serviceQName);
- }
- }
- else
- {
- throw new IllegalArgumentException("Cannot create generic javax.xml.ws.Service without wsdlLocation: " + serviceRefName);
- }
+ target = Service.create(wsdlURL, serviceQName, features);
}
- // Generated javax.xml.ws.Service subclass
else
{
- if (wsdlURL != null)
- {
- if (wsFeatures != null) {
- Constructor ctor = serviceClass.getConstructor(new Class[] { URL.class, QName.class, WebServiceFeature[].class });
- target = ctor.newInstance(new Object[] { wsdlURL, serviceQName, wsFeatures });
- } else {
- Constructor ctor = serviceClass.getConstructor(new Class[] { URL.class, QName.class });
- target = ctor.newInstance(new Object[] { wsdlURL, serviceQName });
- }
- }
- else
- {
- if (wsFeatures != null) {
- Constructor ctor = serviceClass.getConstructor(new Class[] { WebServiceFeature[].class });
- target = ctor.newInstance(new Object[] { wsFeatures });
- } else {
- target = (Service)serviceClass.newInstance();
- }
- }
+ target = Service.create(wsdlURL, serviceQName);
}
}
- finally
+ else
{
- serviceRefAssociation.set(null);
+ throw new IllegalArgumentException("Cannot create generic javax.xml.ws.Service without wsdlLocation: "
+ + serviceRefMD);
}
-
- // Configure the service
- configureService((Service)target, serviceRef);
-
- if (targetClassName != null && targetClassName.equals(serviceImplClass) == false)
+ }
+ else
+ {
+ // Generated javax.xml.ws.Service subclass
+ if (wsdlURL != null)
{
- try
+ if (features != null)
{
- Object port = null;
- if (serviceClass != Service.class)
- {
- for (Method method : serviceClass.getDeclaredMethods())
- {
- String methodName = method.getName();
- Class retType = method.getReturnType();
- if (methodName.startsWith("get") && targetClass.isAssignableFrom(retType))
- {
- port = method.invoke(target, new Object[0]);
- target = port;
- break;
- }
- }
- }
-
- if (port == null)
- {
- Method method = serviceClass.getMethod("getPort", new Class[] { Class.class });
- port = method.invoke(target, new Object[] { targetClass });
- target = port;
- }
+ Constructor<?> ctor = serviceClass.getConstructor(new Class[]
+ {URL.class, QName.class, WebServiceFeature[].class});
+ target = (Service) ctor.newInstance(new Object[]
+ {wsdlURL, serviceQName, features});
}
- catch (InvocationTargetException ex)
+ else
{
- throw ex.getTargetException();
+ Constructor<?> ctor = serviceClass.getConstructor(new Class[]
+ {URL.class, QName.class});
+ target = (Service) ctor.newInstance(new Object[]
+ {wsdlURL, serviceQName});
}
}
+ else
+ {
+ if (features != null)
+ {
+ Constructor<?> ctor = serviceClass.getConstructor(new Class[]
+ {WebServiceFeature[].class});
+ target = (Service) ctor.newInstance(new Object[]
+ {features});
+ }
+ else
+ {
+ target = (Service) serviceClass.newInstance();
+ }
+ }
+ }
- return target;
+ return target;
+ }
+
+ private WebServiceFeature[] getFeatures(final String targetClassName, final String serviceClassName,
+ final UnifiedServiceRefMetaData serviceRefMD)
+ {
+ if (targetClassName != null && !targetClassName.equals(serviceClassName))
+ {
+ final Collection<UnifiedPortComponentRefMetaData> portComponentRefs = serviceRefMD.getPortComponentRefs();
+ for (final UnifiedPortComponentRefMetaData portComponentRefMD : portComponentRefs)
+ {
+ if (targetClassName.equals(portComponentRefMD.getServiceEndpointInterface()))
+ {
+ return getFeatures(portComponentRefMD);
+ }
+ }
}
- catch (Throwable ex)
+
+ return null;
+ }
+
+ private QName getPortQName(final String targetClassName, final String serviceClassName,
+ final UnifiedServiceRefMetaData serviceRefMD)
+ {
+ if (targetClassName != null && !targetClassName.equals(serviceClassName))
{
- WSException.rethrow("Cannot create service", ex);
- return null;
+ final Collection<UnifiedPortComponentRefMetaData> portComponentRefs = serviceRefMD.getPortComponentRefs();
+ for (final UnifiedPortComponentRefMetaData portComponentRefMD : portComponentRefs)
+ {
+ if (targetClassName.equals(portComponentRefMD.getServiceEndpointInterface()))
+ {
+ return portComponentRefMD.getPortQName();
+ }
+ }
}
+
+ return null;
}
- public static UnifiedServiceRefMetaData getServiceRefAssociation()
+ private Method getMethodFor(final QName portQName, final WebServiceFeature[] features, final Class<?> serviceClass)
+ throws NoSuchMethodException
{
- // The ServiceDelegateImpl get the usRef at ctor time
- return (UnifiedServiceRefMetaData)serviceRefAssociation.get();
+ if ((portQName == null) && (features == null))
+ return serviceClass.getMethod("getPort", new Class[]
+ {Class.class});
+ if ((portQName != null) && (features == null))
+ return serviceClass.getMethod("getPort", new Class[]
+ {QName.class, Class.class});
+ if ((portQName == null) && (features != null))
+ return serviceClass.getMethod("getPort", new Class[]
+ {Class.class, WebServiceFeature[].class});
+ if ((portQName != null) && (features != null))
+ return serviceClass.getMethod("getPort", new Class[]
+ {QName.class, Class.class, WebServiceFeature[].class});
+
+ throw new IllegalStateException();
}
- private void configureService(Service service, UnifiedServiceRefMetaData serviceRef)
+ private Object[] getArgumentsFor(final QName portQName, final WebServiceFeature[] features,
+ final Class<?> targetClass) throws NoSuchMethodException
{
- String configFile = serviceRef.getConfigFile();
- String configName = serviceRef.getConfigName();
- if (service instanceof ConfigProvider)
+ if ((portQName == null) && (features == null))
+ return new Object[]
+ {targetClass};
+ if ((portQName != null) && (features == null))
+ return new Object[]
+ {portQName, targetClass};
+ if ((portQName == null) && (features != null))
+ return new Object[]
+ {targetClass, features};
+ if ((portQName != null) && (features != null))
+ return new Object[]
+ {portQName, targetClass, features};
+
+ throw new IllegalStateException();
+ }
+
+ private WebServiceFeature[] getFeatures(final UnifiedServiceRefMetaData serviceRef)
+ {
+ List<WebServiceFeature> features = new LinkedList<WebServiceFeature>();
+
+ // configure @Addressing feature
+ if (serviceRef.isAddressingEnabled())
{
- if(log.isDebugEnabled()) log.debug("Configure Service: [configName=" + configName + ",configFile=" + configFile + "]");
+ final boolean required = serviceRef.isAddressingRequired();
+ final String refResponses = serviceRef.getAddressingResponses();
+ AddressingFeature.Responses responses = AddressingFeature.Responses.ALL;
+ if ("ANONYMOUS".equals(refResponses))
+ responses = AddressingFeature.Responses.ANONYMOUS;
+ if ("NON_ANONYMOUS".equals(refResponses))
+ responses = AddressingFeature.Responses.NON_ANONYMOUS;
- ConfigProvider cp = (ConfigProvider)service;
- if (configName != null || configFile != null)
- cp.setConfigName(configName, configFile);
+ features.add(new AddressingFeature(true, required, responses));
}
+
+ // configure @MTOM feature
+ if (serviceRef.isMtomEnabled())
+ {
+ features.add(new MTOMFeature(true, serviceRef.getMtomThreshold()));
+ }
+
+ // configure @RespectBinding feature
+ if (serviceRef.isRespectBindingEnabled())
+ {
+ features.add(new RespectBindingFeature(true));
+ }
+
+ WebServiceFeature[] wsFeatures = features.size() == 0 ? null : features.toArray(new WebServiceFeature[]
+ {});
+ return wsFeatures;
}
- private UnifiedServiceRefMetaData unmarshallServiceRef(Reference ref) throws ClassNotFoundException, NamingException
+ private WebServiceFeature[] getFeatures(final UnifiedPortComponentRefMetaData portComponentRefMD)
{
- UnifiedServiceRefMetaData sref;
- RefAddr refAddr = ref.get(ServiceReferenceable.SERVICE_REF_META_DATA);
- ByteArrayInputStream bais = new ByteArrayInputStream((byte[])refAddr.getContent());
+ List<WebServiceFeature> features = new LinkedList<WebServiceFeature>();
+ // configure @Addressing feature
+ if (portComponentRefMD.isAddressingEnabled())
+ {
+ final boolean required = portComponentRefMD.isAddressingRequired();
+ final String refResponses = portComponentRefMD.getAddressingResponses();
+ AddressingFeature.Responses responses = AddressingFeature.Responses.ALL;
+ if ("ANONYMOUS".equals(refResponses))
+ responses = AddressingFeature.Responses.ANONYMOUS;
+ if ("NON_ANONYMOUS".equals(refResponses))
+ responses = AddressingFeature.Responses.NON_ANONYMOUS;
+
+ features.add(new AddressingFeature(true, required, responses));
+ }
+
+ // configure @MTOM feature
+ if (portComponentRefMD.isMtomEnabled())
+ {
+ features.add(new MTOMFeature(true, portComponentRefMD.getMtomThreshold()));
+ }
+
+ // configure @RespectBinding feature
+ if (portComponentRefMD.isRespectBindingEnabled())
+ {
+ features.add(new RespectBindingFeature(true));
+ }
+
+ return features.size() == 0 ? null : features.toArray(new WebServiceFeature[]
+ {});
+ }
+
+ private UnifiedServiceRefMetaData unmarshallServiceRef(final Reference ref) throws ClassNotFoundException,
+ NamingException
+ {
+ final UnifiedServiceRefMetaData sref;
+ final RefAddr refAddr = ref.get(ServiceReferenceable.SERVICE_REF_META_DATA);
+ final ByteArrayInputStream bais = new ByteArrayInputStream((byte[]) refAddr.getContent());
try
{
ObjectInputStream ois = new ObjectInputStream(bais);
- sref = (UnifiedServiceRefMetaData)ois.readObject();
+ sref = (UnifiedServiceRefMetaData) ois.readObject();
ois.close();
}
catch (IOException e)
{
throw new NamingException("Cannot unmarshall service ref meta data, cause: " + e.toString());
}
+
return sref;
}
}
Modified: stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/jaxws/client/ServiceReferenceable.java
===================================================================
--- stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/jaxws/client/ServiceReferenceable.java 2010-09-23 10:37:04 UTC (rev 13013)
+++ stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/jaxws/client/ServiceReferenceable.java 2010-09-23 10:37:46 UTC (rev 13014)
@@ -52,7 +52,7 @@
private String serviceImplClass;
private String targetClassName;
private UnifiedServiceRefMetaData serviceRef;
-
+
public ServiceReferenceable(String serviceImplClass, String targetClassName, UnifiedServiceRefMetaData serviceRef)
{
this.serviceImplClass = serviceImplClass;
@@ -76,7 +76,7 @@
return myRef;
}
-
+
private byte[] marshall(Object obj) throws NamingException
{
ByteArrayOutputStream baos = new ByteArrayOutputStream(512);
@@ -92,4 +92,13 @@
}
return baos.toByteArray();
}
+
+ public String toString() {
+ final StringBuilder sb = new StringBuilder();
+ sb.append("\n").append(getClass().getName());
+ sb.append("\n serviceImplClass=" + serviceImplClass);
+ sb.append("\n targetClassName=" + targetClassName);
+ sb.append("\n serviceRef=" + this.serviceRef);
+ return sb.toString();
+ }
}
14 years, 3 months
JBossWS SVN: r13013 - stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/webserviceref.
by jbossws-commits@lists.jboss.org
Author: richard.opalka(a)jboss.com
Date: 2010-09-23 06:37:04 -0400 (Thu, 23 Sep 2010)
New Revision: 13013
Modified:
stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/webserviceref/TestEndpointClientTwo.java
Log:
[JBMETA-298] repairing test case to be in sync with JavaDoc requirements
Modified: stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/webserviceref/TestEndpointClientTwo.java
===================================================================
--- stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/webserviceref/TestEndpointClientTwo.java 2010-09-23 08:35:22 UTC (rev 13012)
+++ stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/webserviceref/TestEndpointClientTwo.java 2010-09-23 10:37:04 UTC (rev 13013)
@@ -38,9 +38,15 @@
import java.util.Hashtable;
import java.util.Map;
-@WebServiceRef(name = "Service1")
+@WebServiceRef(name = "Service1", type=TestEndpointService.class)
// Test multiple on type
-@WebServiceRefs( { @WebServiceRef(name = "Service2"), @WebServiceRef(name = "Port1", type = TestEndpoint.class) })
+@WebServiceRefs
+(
+ {
+ @WebServiceRef(name = "Service2", type=TestEndpointService.class),
+ @WebServiceRef(name = "Port1", type = TestEndpoint.class)
+ }
+)
public class TestEndpointClientTwo
{
// provide logging
14 years, 3 months
JBossWS SVN: r13012 - stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client.
by jbossws-commits@lists.jboss.org
Author: richard.opalka(a)jboss.com
Date: 2010-09-23 04:35:22 -0400 (Thu, 23 Sep 2010)
New Revision: 13012
Modified:
stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/ServiceObjectFactory.java
stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/ServiceRefBinderJAXWS.java
stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/ServiceReferenceable.java
Log:
[JBWS-3133] ServiceRef & PortComponentRef UMDM now respects @Addressing, @MTOM and @RespectBinding MDs
Modified: stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/ServiceObjectFactory.java
===================================================================
--- stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/ServiceObjectFactory.java 2010-09-23 08:31:11 UTC (rev 13011)
+++ stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/ServiceObjectFactory.java 2010-09-23 08:35:22 UTC (rev 13012)
@@ -28,6 +28,7 @@
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.net.URL;
+import java.util.Collection;
import java.util.Hashtable;
import java.util.LinkedList;
import java.util.List;
@@ -52,12 +53,13 @@
import org.jboss.logging.Logger;
import org.jboss.wsf.spi.WSFException;
import org.jboss.wsf.spi.deployment.UnifiedVirtualFile;
+import org.jboss.wsf.spi.metadata.j2ee.serviceref.UnifiedPortComponentRefMetaData;
import org.jboss.wsf.spi.metadata.j2ee.serviceref.UnifiedServiceRefMetaData;
import org.jboss.wsf.stack.cxf.client.configuration.JBossWSSpringBusFactory;
/**
* This ServiceObjectFactory reconstructs a javax.xml.ws.Service
- * for a given WSDL when the webservice client does a JNDI lookup
+ * for a given WSDL when the webservice client does a JNDI lookup.
*
* @see ServiceReferenceable
*
@@ -89,185 +91,358 @@
* @see javax.naming.spi.NamingManager#getObjectInstance
* @see javax.naming.spi.NamingManager#getURLContext
*/
- @SuppressWarnings(value="unchecked")
- public Object getObjectInstance(Object obj, Name name, Context nameCtx, Hashtable environment) throws Exception
+ @SuppressWarnings(value = "unchecked")
+ public Object getObjectInstance(final Object obj, final Name name, final Context nameCtx, final Hashtable environment)
+ throws Exception
{
try
{
- Reference ref = (Reference)obj;
-
- // Get the target class name
- String targetClassName = (String)ref.get(ServiceReferenceable.TARGET_CLASS_NAME).getContent();
-
- // Unmarshall the UnifiedServiceRef
- UnifiedServiceRefMetaData serviceRef = unmarshallServiceRef(ref);
-
- Bus bus;
- //Reset bus before constructing Service
- BusFactory.setDefaultBus(null);
- URL cxfConfig = getCXFConfiguration(serviceRef.getVfsRoot());
- if (cxfConfig != null)
+ // references
+ final Reference ref = (Reference) obj;
+ final UnifiedServiceRefMetaData serviceRef = unmarshallServiceRef(ref);
+ // class names
+ final String serviceImplClass = this.getServiceClassName(ref, serviceRef);
+ final String targetClassName = this.getTargetClassName(ref, serviceRef, serviceImplClass);
+ // class instances
+ final Class<?> serviceClass = this.getClass(serviceImplClass);
+ final Class<?> targetClass = this.getClass(targetClassName);
+ // construct service
+ final Bus bus = this.getBus(serviceRef);
+ final Service serviceInstance = this.instantiateService(serviceRef, serviceClass);
+ if (serviceRef.getHandlerChain() != null)
{
- SpringBusFactory busFactory = new JBossWSSpringBusFactory();
- bus = busFactory.createBus(cxfConfig);
- BusFactory.setThreadDefaultBus(bus);
+ serviceInstance.setHandlerResolver(new HandlerResolverImpl(bus, serviceRef.getHandlerChain(),
+ serviceInstance.getClass()));
}
- else
+ // construct port
+ final boolean instantiatePort = targetClassName != null && !targetClassName.equals(serviceImplClass);
+ if (instantiatePort)
{
- bus = BusFactory.getThreadDefaultBus();
+ final QName portQName = this.getPortQName(targetClassName, serviceImplClass, serviceRef);
+ final WebServiceFeature[] portFeatures = this.getFeatures(targetClassName, serviceImplClass, serviceRef);
+
+ return instantiatePort(serviceClass, targetClass, serviceInstance, portQName, portFeatures);
}
- //Add extension to configure stub properties using the UnifiedServiceRefMetaData
- Configurer configurer = bus.getExtension(Configurer.class);
- bus.setExtension(new ServiceRefStubPropertyConfigurer(serviceRef, configurer), Configurer.class);
-
- String serviceRefName = serviceRef.getServiceRefName();
- QName serviceQName = serviceRef.getServiceQName();
+ return serviceInstance;
+ }
+ catch (Exception ex)
+ {
+ WSFException.rethrow("Cannot create service", ex);
+ }
- String serviceImplClass = serviceRef.getServiceImplClass();
- if (serviceImplClass == null)
- serviceImplClass = (String)ref.get(ServiceReferenceable.SERVICE_IMPL_CLASS).getContent();
+ return null;
+ }
- // If the target defaults to javax.xml.ws.Service, use the service as the target
- if (Service.class.getName().equals(targetClassName))
- targetClassName = serviceImplClass;
+ private Class<?> getClass(final String className) throws ClassNotFoundException
+ {
+ if (className != null)
+ {
+ return Thread.currentThread().getContextClassLoader().loadClass(className);
+ }
- log.debug("getObjectInstance [name=" + serviceRefName + ",service=" + serviceImplClass + ",target=" + targetClassName + "]");
+ return null;
+ }
- // Load the service class
- ClassLoader ctxLoader = Thread.currentThread().getContextClassLoader();
- Class serviceClass = ctxLoader.loadClass(serviceImplClass);
- Class targetClass = (targetClassName != null ? ctxLoader.loadClass(targetClassName) : null);
+ private Bus getBus(final UnifiedServiceRefMetaData serviceRefMD)
+ {
+ final Bus bus;
+ // Always reset bus before constructing Service
+ BusFactory.setDefaultBus(null);
- if (Service.class.isAssignableFrom(serviceClass) == false)
- throw new IllegalArgumentException("WebServiceRef type '" + serviceClass + "' is not assignable to javax.xml.ws.Service");
+ final URL cxfConfig = this.getCXFConfiguration(serviceRefMD.getVfsRoot());
+ if (cxfConfig != null)
+ {
+ final SpringBusFactory busFactory = new JBossWSSpringBusFactory();
+ bus = busFactory.createBus(cxfConfig);
+ BusFactory.setThreadDefaultBus(bus);
+ }
+ else
+ {
+ bus = BusFactory.getThreadDefaultBus();
+ }
- List<WebServiceFeature> features = new LinkedList<WebServiceFeature>();
-
- // configure @Addressing feature
- if (serviceRef.isAddressingEnabled()) {
- final boolean required = serviceRef.isAddressingRequired();
- final String refResponses = serviceRef.getAddressingResponses();
- AddressingFeature.Responses responses = AddressingFeature.Responses.ALL;
- if ("ANONYMOUS".equals(refResponses))
- responses = AddressingFeature.Responses.ANONYMOUS;
- if ("NON_ANONYMOUS".equals(refResponses))
- responses = AddressingFeature.Responses.NON_ANONYMOUS;
-
- features.add(new AddressingFeature(true, required, responses));
- }
+ //Add extension to configure stub properties using the UnifiedServiceRefMetaData
+ Configurer configurer = bus.getExtension(Configurer.class);
+ bus.setExtension(new ServiceRefStubPropertyConfigurer(serviceRefMD, configurer), Configurer.class);
- // configure @MTOM feature
- if (serviceRef.isMtomEnabled()) {
- features.add(new MTOMFeature(true, serviceRef.getMtomThreshold()));
- }
+ return bus;
+ }
- // configure @RespectBinding feature
- if (serviceRef.isRespectBindingEnabled()) {
- features.add(new RespectBindingFeature(true));
+ private String getServiceClassName(final Reference ref, final UnifiedServiceRefMetaData serviceRefMD)
+ {
+ String serviceClassName = serviceRefMD.getServiceImplClass();
+ if (serviceClassName == null)
+ serviceClassName = (String) ref.get(ServiceReferenceable.SERVICE_IMPL_CLASS).getContent();
+
+ return serviceClassName;
+ }
+
+ private String getTargetClassName(final Reference ref, final UnifiedServiceRefMetaData serviceRefMD,
+ final String serviceImplClass)
+ {
+ String targetClassName = serviceRefMD.getServiceRefType();
+ if (targetClassName == null)
+ targetClassName = (String) ref.get(ServiceReferenceable.TARGET_CLASS_NAME).getContent();
+
+ if (Service.class.getName().equals(targetClassName))
+ targetClassName = serviceImplClass;
+
+ return targetClassName;
+ }
+
+ private Object instantiatePort(final Class<?> serviceClass, final Class<?> targetClass, final Service target,
+ final QName portQName, final WebServiceFeature[] features) throws NoSuchMethodException,
+ InstantiationException, IllegalAccessException, InvocationTargetException
+ {
+ Object retVal = null;
+
+ Object port = null;
+ if (serviceClass != Service.class)
+ {
+ for (Method method : serviceClass.getDeclaredMethods())
+ {
+ String methodName = method.getName();
+ Class<?> retType = method.getReturnType();
+ if (methodName.startsWith("get") && targetClass.isAssignableFrom(retType))
+ {
+ port = method.invoke(target, new Object[0]);
+ retVal = port;
+ break;
+ }
}
+ }
- // Receives either a javax.xml.ws.Service or a dynamic proxy
- Object target;
- URL wsdlURL = serviceRef.getWsdlLocation();
- WebServiceFeature[] wsFeatures = features.size() == 0 ? null : features.toArray(new WebServiceFeature[] {});
+ if (port == null)
+ {
+ Method method = getMethodFor(portQName, features, serviceClass);
+ Object[] args = getArgumentsFor(portQName, features, targetClass);
+ port = method.invoke(target, args);
+ retVal = port;
+ }
+
+ return retVal;
+ }
+
+ private Service instantiateService(final UnifiedServiceRefMetaData serviceRefMD, final Class<?> serviceClass)
+ throws NoSuchMethodException, InstantiationException, IllegalAccessException, InvocationTargetException
+ {
+ final WebServiceFeature[] features = getFeatures(serviceRefMD);
+ final URL wsdlURL = serviceRefMD.getWsdlLocation();
+ final QName serviceQName = serviceRefMD.getServiceQName();
+
+ Service target = null;
+ if (serviceClass == Service.class)
+ {
// Generic javax.xml.ws.Service
- if (serviceClass == Service.class)
+ if (wsdlURL != null)
{
- if (wsdlURL != null)
+ if (features != null)
{
- if (wsFeatures != null) {
- target = Service.create(wsdlURL, serviceQName, wsFeatures);
- } else {
- target = Service.create(wsdlURL, serviceQName);
- }
+ target = Service.create(wsdlURL, serviceQName, features);
}
else
{
- throw new IllegalArgumentException("Cannot create generic javax.xml.ws.Service without wsdlLocation: " + serviceRefName);
+ target = Service.create(wsdlURL, serviceQName);
}
}
- // Generated javax.xml.ws.Service subclass
else
{
- if (wsdlURL != null)
+ throw new IllegalArgumentException("Cannot create generic javax.xml.ws.Service without wsdlLocation: "
+ + serviceRefMD);
+ }
+ }
+ else
+ {
+ // Generated javax.xml.ws.Service subclass
+ if (wsdlURL != null)
+ {
+ if (features != null)
{
- if (wsFeatures != null) {
- Constructor ctor = serviceClass.getConstructor(new Class[] { URL.class, QName.class, WebServiceFeature[].class });
- target = ctor.newInstance(new Object[] { wsdlURL, serviceQName, wsFeatures });
- } else {
- Constructor ctor = serviceClass.getConstructor(new Class[] { URL.class, QName.class });
- target = ctor.newInstance(new Object[] { wsdlURL, serviceQName });
- }
+ Constructor<?> ctor = serviceClass.getConstructor(new Class[]
+ {URL.class, QName.class, WebServiceFeature[].class});
+ target = (Service) ctor.newInstance(new Object[]
+ {wsdlURL, serviceQName, features});
}
else
{
- if (wsFeatures != null) {
- Constructor ctor = serviceClass.getConstructor(new Class[] { WebServiceFeature[].class });
- target = ctor.newInstance(new Object[] { wsFeatures });
- } else {
- target = (Service)serviceClass.newInstance();
- }
+ Constructor<?> ctor = serviceClass.getConstructor(new Class[]
+ {URL.class, QName.class});
+ target = (Service) ctor.newInstance(new Object[]
+ {wsdlURL, serviceQName});
}
}
-
- if (targetClassName != null && targetClassName.equals(serviceImplClass) == false)
+ else
{
- try
+ if (features != null)
{
- Object port = null;
- if (serviceClass != Service.class)
- {
- for (Method method : serviceClass.getDeclaredMethods())
- {
- String methodName = method.getName();
- Class retType = method.getReturnType();
- if (methodName.startsWith("get") && targetClass.isAssignableFrom(retType))
- {
- port = method.invoke(target, new Object[0]);
- target = port;
- break;
- }
- }
- }
-
- if (port == null)
- {
- Method method = serviceClass.getMethod("getPort", new Class[] { Class.class });
- port = method.invoke(target, new Object[] { targetClass });
- target = port;
- }
+ Constructor<?> ctor = serviceClass.getConstructor(new Class[]
+ {WebServiceFeature[].class});
+ target = (Service) ctor.newInstance(new Object[]
+ {features});
}
- catch (InvocationTargetException ex)
+ else
{
- throw ex.getTargetException();
+ target = (Service) serviceClass.newInstance();
}
}
+ }
- if ((serviceRef.getHandlerChain() != null) && (target instanceof Service))
+ return target;
+ }
+
+ private WebServiceFeature[] getFeatures(final String targetClassName, final String serviceClassName,
+ final UnifiedServiceRefMetaData serviceRefMD)
+ {
+ if (targetClassName != null && !targetClassName.equals(serviceClassName))
+ {
+ final Collection<UnifiedPortComponentRefMetaData> portComponentRefs = serviceRefMD.getPortComponentRefs();
+ for (final UnifiedPortComponentRefMetaData portComponentRefMD : portComponentRefs)
{
- ((Service)target).setHandlerResolver(new HandlerResolverImpl(bus, serviceRef.getHandlerChain(), target.getClass()));
+ if (targetClassName.equals(portComponentRefMD.getServiceEndpointInterface()))
+ {
+ return getFeatures(portComponentRefMD);
+ }
}
-
-
- return target;
}
- catch (Throwable ex)
+
+ return null;
+ }
+
+ private QName getPortQName(final String targetClassName, final String serviceClassName,
+ final UnifiedServiceRefMetaData serviceRefMD)
+ {
+ if (targetClassName != null && !targetClassName.equals(serviceClassName))
{
- WSFException.rethrow("Cannot create service", ex);
- return null;
+ final Collection<UnifiedPortComponentRefMetaData> portComponentRefs = serviceRefMD.getPortComponentRefs();
+ for (final UnifiedPortComponentRefMetaData portComponentRefMD : portComponentRefs)
+ {
+ if (targetClassName.equals(portComponentRefMD.getServiceEndpointInterface()))
+ {
+ return portComponentRefMD.getPortQName();
+ }
+ }
}
+
+ return null;
}
-
- private UnifiedServiceRefMetaData unmarshallServiceRef(Reference ref) throws ClassNotFoundException, NamingException
+
+ private Method getMethodFor(final QName portQName, final WebServiceFeature[] features, final Class<?> serviceClass)
+ throws NoSuchMethodException
{
- UnifiedServiceRefMetaData sref;
- RefAddr refAddr = ref.get(ServiceReferenceable.SERVICE_REF_META_DATA);
- ByteArrayInputStream bais = new ByteArrayInputStream((byte[])refAddr.getContent());
+ if ((portQName == null) && (features == null))
+ return serviceClass.getMethod("getPort", new Class[]
+ {Class.class});
+ if ((portQName != null) && (features == null))
+ return serviceClass.getMethod("getPort", new Class[]
+ {QName.class, Class.class});
+ if ((portQName == null) && (features != null))
+ return serviceClass.getMethod("getPort", new Class[]
+ {Class.class, WebServiceFeature[].class});
+ if ((portQName != null) && (features != null))
+ return serviceClass.getMethod("getPort", new Class[]
+ {QName.class, Class.class, WebServiceFeature[].class});
+
+ throw new IllegalStateException();
+ }
+
+ private Object[] getArgumentsFor(final QName portQName, final WebServiceFeature[] features,
+ final Class<?> targetClass) throws NoSuchMethodException
+ {
+ if ((portQName == null) && (features == null))
+ return new Object[]
+ {targetClass};
+ if ((portQName != null) && (features == null))
+ return new Object[]
+ {portQName, targetClass};
+ if ((portQName == null) && (features != null))
+ return new Object[]
+ {targetClass, features};
+ if ((portQName != null) && (features != null))
+ return new Object[]
+ {portQName, targetClass, features};
+
+ throw new IllegalStateException();
+ }
+
+ private WebServiceFeature[] getFeatures(final UnifiedServiceRefMetaData serviceRef)
+ {
+ List<WebServiceFeature> features = new LinkedList<WebServiceFeature>();
+
+ // configure @Addressing feature
+ if (serviceRef.isAddressingEnabled())
+ {
+ final boolean required = serviceRef.isAddressingRequired();
+ final String refResponses = serviceRef.getAddressingResponses();
+ AddressingFeature.Responses responses = AddressingFeature.Responses.ALL;
+ if ("ANONYMOUS".equals(refResponses))
+ responses = AddressingFeature.Responses.ANONYMOUS;
+ if ("NON_ANONYMOUS".equals(refResponses))
+ responses = AddressingFeature.Responses.NON_ANONYMOUS;
+
+ features.add(new AddressingFeature(true, required, responses));
+ }
+
+ // configure @MTOM feature
+ if (serviceRef.isMtomEnabled())
+ {
+ features.add(new MTOMFeature(true, serviceRef.getMtomThreshold()));
+ }
+
+ // configure @RespectBinding feature
+ if (serviceRef.isRespectBindingEnabled())
+ {
+ features.add(new RespectBindingFeature(true));
+ }
+
+ WebServiceFeature[] wsFeatures = features.size() == 0 ? null : features.toArray(new WebServiceFeature[]
+ {});
+ return wsFeatures;
+ }
+
+ private WebServiceFeature[] getFeatures(final UnifiedPortComponentRefMetaData portComponentRefMD)
+ {
+ List<WebServiceFeature> features = new LinkedList<WebServiceFeature>();
+ // configure @Addressing feature
+ if (portComponentRefMD.isAddressingEnabled())
+ {
+ final boolean required = portComponentRefMD.isAddressingRequired();
+ final String refResponses = portComponentRefMD.getAddressingResponses();
+ AddressingFeature.Responses responses = AddressingFeature.Responses.ALL;
+ if ("ANONYMOUS".equals(refResponses))
+ responses = AddressingFeature.Responses.ANONYMOUS;
+ if ("NON_ANONYMOUS".equals(refResponses))
+ responses = AddressingFeature.Responses.NON_ANONYMOUS;
+
+ features.add(new AddressingFeature(true, required, responses));
+ }
+
+ // configure @MTOM feature
+ if (portComponentRefMD.isMtomEnabled())
+ {
+ features.add(new MTOMFeature(true, portComponentRefMD.getMtomThreshold()));
+ }
+
+ // configure @RespectBinding feature
+ if (portComponentRefMD.isRespectBindingEnabled())
+ {
+ features.add(new RespectBindingFeature(true));
+ }
+
+ return features.size() == 0 ? null : features.toArray(new WebServiceFeature[]
+ {});
+ }
+
+ private UnifiedServiceRefMetaData unmarshallServiceRef(final Reference ref) throws ClassNotFoundException,
+ NamingException
+ {
+ final UnifiedServiceRefMetaData sref;
+ final RefAddr refAddr = ref.get(ServiceReferenceable.SERVICE_REF_META_DATA);
+ final ByteArrayInputStream bais = new ByteArrayInputStream((byte[]) refAddr.getContent());
try
{
ObjectInputStream ois = new ObjectInputStream(bais);
- sref = (UnifiedServiceRefMetaData)ois.readObject();
+ sref = (UnifiedServiceRefMetaData) ois.readObject();
ois.close();
}
catch (IOException e)
@@ -275,33 +450,30 @@
throw new NamingException("Cannot unmarshall service ref meta data, cause: " + e.toString());
}
- /* Verify it. There is some know coinstraints
- if(sref.getServiceQName() == null)
- throw new IllegalArgumentException("ServiceQName may not be null. " +
- "Specify a service QName in the <service-ref> declaration, or thorugh the @WebServiceClient annotation.");
- */
-
return sref;
}
-
- public URL getCXFConfiguration(UnifiedVirtualFile vfsRoot)
+
+ private URL getCXFConfiguration(final UnifiedVirtualFile vfsRoot)
{
URL url = null;
try
{
url = vfsRoot.findChild("WEB-INF/jbossws-cxf.xml").toURL();
}
- catch (Exception e) {}
-
+ catch (Exception e)
+ {
+ }
+
if (url == null)
{
try
{
url = vfsRoot.findChild("META-INF/jbossws-cxf.xml").toURL();
}
- catch (Exception e) {}
+ catch (Exception e)
+ {
+ }
}
return url;
}
}
-
Modified: stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/ServiceRefBinderJAXWS.java
===================================================================
--- stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/ServiceRefBinderJAXWS.java 2010-09-23 08:31:11 UTC (rev 13011)
+++ stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/ServiceRefBinderJAXWS.java 2010-09-23 08:35:22 UTC (rev 13012)
@@ -106,31 +106,6 @@
}
}
- if (addressingAnnotation != null)
- {
- if (addressingAnnotation.enabled())
- serviceRef.setAddressingEnabled();
-
- if (addressingAnnotation.required())
- serviceRef.setAddressingRequired();
-
- if (addressingAnnotation.responses() == AddressingFeature.Responses.ANONYMOUS)
- serviceRef.setAddressingResponses("ANONYMOUS");
- else if (addressingAnnotation.responses() == AddressingFeature.Responses.NON_ANONYMOUS)
- serviceRef.setAddressingResponses("NON_ANONYMOUS");
- else
- serviceRef.setAddressingResponses("ALL");
- }
-
- if ((mtomAnnotation != null) && mtomAnnotation.enabled()) {
- serviceRef.setMtomEnabled();
- serviceRef.setMtomThreshold(mtomAnnotation.threshold());
- }
-
- if ((respectBindingAnnotation != null) && respectBindingAnnotation.enabled()) {
- serviceRef.setRespectBindingEnabled();
- }
-
// Use the single @WebServiceRef
if (wsrefList.size() == 1)
{
@@ -252,6 +227,22 @@
}
}
+ if (addressingAnnotation != null)
+ {
+ serviceRef.setAddressingEnabled(addressingAnnotation.enabled());
+ serviceRef.setAddressingRequired(addressingAnnotation.required());
+ serviceRef.setAddressingResponses(addressingAnnotation.responses().toString());
+ }
+
+ if (mtomAnnotation != null) {
+ serviceRef.setMtomEnabled(mtomAnnotation.enabled());
+ serviceRef.setMtomThreshold(mtomAnnotation.threshold());
+ }
+
+ if (respectBindingAnnotation != null) {
+ serviceRef.setRespectBindingEnabled(respectBindingAnnotation.enabled());
+ }
+
// Do not use rebind, the binding should be unique
// [JBWS-1499] - Revisit WebServiceRefHandler JNDI rebind
Referenceable serviceReferenceable = buildServiceReferenceable(serviceImplClass, targetClassName, serviceRef);
Modified: stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/ServiceReferenceable.java
===================================================================
--- stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/ServiceReferenceable.java 2010-09-23 08:31:11 UTC (rev 13011)
+++ stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/ServiceReferenceable.java 2010-09-23 08:35:22 UTC (rev 13012)
@@ -86,4 +86,13 @@
}
return baos.toByteArray();
}
+
+ public String toString() {
+ final StringBuilder sb = new StringBuilder();
+ sb.append("\n").append(getClass().getName());
+ sb.append("\n serviceImplClass=" + serviceImplClass);
+ sb.append("\n targetClassName=" + targetClassName);
+ sb.append("\n serviceRef=" + this.serviceRef);
+ return sb.toString();
+ }
}
14 years, 3 months
JBossWS SVN: r13011 - spi/trunk/src/main/java/org/jboss/wsf/spi/metadata/j2ee/serviceref.
by jbossws-commits@lists.jboss.org
Author: richard.opalka(a)jboss.com
Date: 2010-09-23 04:31:11 -0400 (Thu, 23 Sep 2010)
New Revision: 13011
Modified:
spi/trunk/src/main/java/org/jboss/wsf/spi/metadata/j2ee/serviceref/UnifiedPortComponentRefMetaData.java
spi/trunk/src/main/java/org/jboss/wsf/spi/metadata/j2ee/serviceref/UnifiedServiceRefMetaData.java
Log:
[JBWS-3133] ServiceRef & PortComponentRef UMDM now respects @Addressing, @MTOM and @RespectBinding MDs
Modified: spi/trunk/src/main/java/org/jboss/wsf/spi/metadata/j2ee/serviceref/UnifiedPortComponentRefMetaData.java
===================================================================
--- spi/trunk/src/main/java/org/jboss/wsf/spi/metadata/j2ee/serviceref/UnifiedPortComponentRefMetaData.java 2010-09-23 08:07:06 UTC (rev 13010)
+++ spi/trunk/src/main/java/org/jboss/wsf/spi/metadata/j2ee/serviceref/UnifiedPortComponentRefMetaData.java 2010-09-23 08:31:11 UTC (rev 13011)
@@ -37,13 +37,13 @@
*/
public class UnifiedPortComponentRefMetaData extends ServiceRefElement
{
+ private static final long serialVersionUID = 8622309745808960649L;
+
// The parent service-ref
private UnifiedServiceRefMetaData serviceRefMetaData;
// The required <service-endpoint-interface> element
private String serviceEndpointInterface;
- // The optional <enable-mtom> element
- private Boolean enableMTOM = Boolean.FALSE;
// The optional <port-component-link> element
private String portComponentLink;
// The optional <port-qname> element
@@ -56,6 +56,16 @@
private String configName;
// The optional JBossWS config-file
private String configFile;
+ // The optional <adressing> element
+ private boolean addressingEnabled;
+ private boolean addressingRequired;
+ private String addressingResponses = "ALL";
+ // The optional <enable-mtom> element
+ private boolean mtomEnabled;
+ // The optional <mtom-threshold> element
+ private int mtomThreshold;
+ // @RespectBinding annotation metadata
+ private boolean respectBindingEnabled;
public UnifiedPortComponentRefMetaData(UnifiedServiceRefMetaData serviceRefMetaData)
{
@@ -69,6 +79,12 @@
configFile = pcref.configFile;
callProperties = pcref.callProperties;
stubProperties = pcref.stubProperties;
+ addressingEnabled = pcref.addressingEnabled;
+ addressingRequired = pcref.addressingRequired;
+ addressingResponses = pcref.addressingResponses;
+ mtomEnabled = pcref.mtomEnabled;
+ mtomThreshold = pcref.mtomThreshold;
+ respectBindingEnabled = pcref.respectBindingEnabled;
}
public UnifiedServiceRefMetaData getServiceRefMetaData()
@@ -76,16 +92,77 @@
return serviceRefMetaData;
}
+ /**
+ * @deprecated Use {@link #isMtomEnabled()} instead.
+ */
+ @Deprecated
public Boolean getEnableMTOM()
{
- return enableMTOM;
+ return mtomEnabled;
}
+ /**
+ * @deprecated Use {@link #setMtomEnabled(boolean)} instead.
+ */
+ @Deprecated
public void setEnableMTOM(Boolean enableMTOM)
{
- this.enableMTOM = enableMTOM;
+ this.mtomEnabled = enableMTOM;
}
+ public void setAddressingEnabled(final boolean addressingEnabled) {
+ this.addressingEnabled = addressingEnabled;
+ }
+
+ public boolean isAddressingEnabled() {
+ return this.addressingEnabled;
+ }
+
+ public void setAddressingRequired(final boolean addressingRequired) {
+ this.addressingRequired = addressingRequired;
+ }
+
+ public boolean isAddressingRequired() {
+ return this.addressingRequired;
+ }
+
+ public void setAddressingResponses(final String responsesTypes)
+ {
+ if (!"ANONYMOUS".equals(responsesTypes) && !"NON_ANONYMOUS".equals(responsesTypes) && !"ALL".equals(responsesTypes))
+ throw new IllegalArgumentException("Only ALL, ANONYMOUS or NON_ANONYMOUS strings are allowed");
+
+ this.addressingResponses = responsesTypes;
+ }
+
+ public String getAddressingResponses() {
+ return this.addressingResponses;
+ }
+
+ public void setMtomEnabled(final boolean mtomEnabled) {
+ this.mtomEnabled = mtomEnabled;
+ }
+
+ public boolean isMtomEnabled() {
+ return this.mtomEnabled;
+ }
+
+ public void setMtomThreshold(final int mtomThreshold)
+ {
+ this.mtomThreshold = mtomThreshold;
+ }
+
+ public int getMtomThreshold() {
+ return this.mtomThreshold;
+ }
+
+ public void setRespectBindingEnabled(final boolean respectBindingEnabled) {
+ this.respectBindingEnabled = respectBindingEnabled;
+ }
+
+ public boolean isRespectBindingEnabled() {
+ return this.respectBindingEnabled;
+ }
+
/**
* The port-component-link element links a port-component-ref
* to a specific port-component required to be made available
@@ -215,7 +292,12 @@
str.append("\nUnifiedPortComponentRef");
str.append("\n serviceEndpointInterface=" + serviceEndpointInterface);
str.append("\n portQName=" + portQName);
- str.append("\n enableMTOM=" + enableMTOM);
+ str.append("\n addressingEnabled=" + addressingEnabled);
+ str.append("\n addressingRequired=" + addressingRequired);
+ str.append("\n addressingResponses=" + addressingResponses);
+ str.append("\n mtomEnabled=" + mtomEnabled);
+ str.append("\n mtomThreshold=" + mtomThreshold);
+ str.append("\n respectBindingEnabled=" + respectBindingEnabled);
str.append("\n portComponentLink=" + portComponentLink);
str.append("\n callProperties=" + callProperties);
str.append("\n stubProperties=" + stubProperties);
Modified: spi/trunk/src/main/java/org/jboss/wsf/spi/metadata/j2ee/serviceref/UnifiedServiceRefMetaData.java
===================================================================
--- spi/trunk/src/main/java/org/jboss/wsf/spi/metadata/j2ee/serviceref/UnifiedServiceRefMetaData.java 2010-09-23 08:07:06 UTC (rev 13010)
+++ spi/trunk/src/main/java/org/jboss/wsf/spi/metadata/j2ee/serviceref/UnifiedServiceRefMetaData.java 2010-09-23 08:31:11 UTC (rev 13011)
@@ -127,16 +127,16 @@
{
}
- public void setAddressingEnabled() {
- this.addressingEnabled = true;
+ public void setAddressingEnabled(final boolean addressingEnabled) {
+ this.addressingEnabled = addressingEnabled;
}
public boolean isAddressingEnabled() {
return this.addressingEnabled;
}
- public void setAddressingRequired() {
- this.addressingRequired = true;
+ public void setAddressingRequired(final boolean addressingRequired) {
+ this.addressingRequired = addressingRequired;
}
public boolean isAddressingRequired() {
@@ -146,7 +146,7 @@
public void setAddressingResponses(final String responsesTypes)
{
if (!"ANONYMOUS".equals(responsesTypes) && !"NON_ANONYMOUS".equals(responsesTypes) && !"ALL".equals(responsesTypes))
- throw new IllegalArgumentException("Only ALL, ANONYMOUS or NON_ANONYMOUS strings allowed");
+ throw new IllegalArgumentException("Only ALL, ANONYMOUS or NON_ANONYMOUS strings are allowed");
this.addressingResponses = responsesTypes;
}
@@ -155,25 +155,25 @@
return this.addressingResponses;
}
- public void setMtomEnabled() {
- this.mtomEnabled = true;
+ public void setMtomEnabled(final boolean mtomEnabled) {
+ this.mtomEnabled = mtomEnabled;
}
public boolean isMtomEnabled() {
return this.mtomEnabled;
}
- public void setMtomThreshold(final int threshold)
+ public void setMtomThreshold(final int mtomThreshold)
{
- this.mtomThreshold = threshold;
+ this.mtomThreshold = mtomThreshold;
}
public int getMtomThreshold() {
return this.mtomThreshold;
}
- public void setRespectBindingEnabled() {
- this.respectBindingEnabled = true;
+ public void setRespectBindingEnabled(final boolean respectBindingEnabled) {
+ this.respectBindingEnabled = respectBindingEnabled;
}
public boolean isRespectBindingEnabled() {
@@ -188,7 +188,13 @@
configFile = sourceRef.configFile;
wsdlOverride = sourceRef.wsdlOverride;
handlerChain = sourceRef.handlerChain;
- callProperties = sourceRef.callProperties;
+ callProperties = sourceRef.callProperties;
+ addressingEnabled = sourceRef.addressingEnabled;
+ addressingRequired = sourceRef.addressingRequired;
+ addressingResponses = sourceRef.addressingResponses;
+ mtomEnabled = sourceRef.mtomEnabled;
+ mtomThreshold = sourceRef.mtomThreshold;
+ respectBindingEnabled = sourceRef.respectBindingEnabled;
if (serviceQName == null && sourceRef.serviceQName != null)
serviceQName = sourceRef.serviceQName;
@@ -590,6 +596,12 @@
str.append("\n configName=" + configName);
str.append("\n configFile=" + configFile);
str.append("\n callProperties=" + callProperties);
+ str.append("\n addressingEnabled=" + addressingEnabled);
+ str.append("\n addressingRequired=" + addressingRequired);
+ str.append("\n addressingResponses=" + addressingResponses);
+ str.append("\n mtomEnabled=" + mtomEnabled);
+ str.append("\n mtomThreshold=" + mtomThreshold);
+ str.append("\n respectBindingEnabled=" + respectBindingEnabled);
str.append("\n processed=" + processed);
str.append("\n handlerChains=" + handlerChains);
str.append("\n handlerChain=" + handlerChain);
14 years, 3 months