JBossWS SVN: r19618 - projects/plugins/maven/resource-filter/trunk/src/main/java/org/jboss/ws/plugins/filters.
by jbossws-commits@lists.jboss.org
Author: asoldano
Date: 2015-04-03 16:25:54 -0400 (Fri, 03 Apr 2015)
New Revision: 19618
Modified:
projects/plugins/maven/resource-filter/trunk/src/main/java/org/jboss/ws/plugins/filters/OperationsValueSource.java
Log:
Allow overriding maven project properties with system properties
Modified: projects/plugins/maven/resource-filter/trunk/src/main/java/org/jboss/ws/plugins/filters/OperationsValueSource.java
===================================================================
--- projects/plugins/maven/resource-filter/trunk/src/main/java/org/jboss/ws/plugins/filters/OperationsValueSource.java 2015-04-03 16:12:12 UTC (rev 19617)
+++ projects/plugins/maven/resource-filter/trunk/src/main/java/org/jboss/ws/plugins/filters/OperationsValueSource.java 2015-04-03 20:25:54 UTC (rev 19618)
@@ -46,13 +46,22 @@
int sum = 0;
while (st.hasMoreTokens()) {
final String token = st.nextToken();
- sum = sum + Integer.valueOf(properties.getProperty(token, token));
+ sum = sum + get(token);
}
return sum;
}
return null;
}
+ private int get(String token) {
+ String spv = System.getProperty(token);
+ if (spv != null) {
+ return Integer.valueOf(spv);
+ } else {
+ return Integer.valueOf(properties.getProperty(token, token));
+ }
+ }
+
@Override
public void clearFeedback() {
// NOOP
9 years, 9 months
JBossWS SVN: r19617 - in stack/cxf/trunk/modules/testsuite/cxf-tests: src/test/etc and 1 other directory.
by jbossws-commits@lists.jboss.org
Author: asoldano
Date: 2015-04-03 12:12:12 -0400 (Fri, 03 Apr 2015)
New Revision: 19617
Modified:
stack/cxf/trunk/modules/testsuite/cxf-tests/pom.xml
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/etc/arquillian.xml
Log:
Explicitly set test port.offset even when it's 0
Modified: stack/cxf/trunk/modules/testsuite/cxf-tests/pom.xml
===================================================================
--- stack/cxf/trunk/modules/testsuite/cxf-tests/pom.xml 2015-04-03 16:01:12 UTC (rev 19616)
+++ stack/cxf/trunk/modules/testsuite/cxf-tests/pom.xml 2015-04-03 16:12:12 UTC (rev 19617)
@@ -292,7 +292,7 @@
<goal>start</goal>
</goals>
<configuration>
- <jvmArgs>-server -XX:+UseCompressedOops -Xms64m -Xmx512m -XX:MaxPermSize=256m ${additionalJvmArgs}</jvmArgs>
+ <jvmArgs>-server -XX:+UseCompressedOops -Xms64m -Xmx512m -XX:MaxPermSize=256m -Djboss.socket.binding.port-offset=${port-offset.cxf-tests.jboss} ${additionalJvmArgs}</jvmArgs>
<serverConfig>jbws-testsuite-default.xml</serverConfig>
<jbossHome>${jboss.home}</jbossHome>
<!-- TODO: add serverArgs section to use a custom bind address (requires wildfly-maven-plugin 1.1.0 +)
Modified: stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/etc/arquillian.xml
===================================================================
--- stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/etc/arquillian.xml 2015-04-03 16:01:12 UTC (rev 19616)
+++ stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/etc/arquillian.xml 2015-04-03 16:12:12 UTC (rev 19617)
@@ -6,7 +6,7 @@
<container qualifier="jboss" default="true">
<configuration>
<property name="jbossHome">${jboss.home}</property>
- <property name="javaVmArguments">-server -XX:+UseCompressedOops -Xms64m -Xmx512m -XX:MaxPermSize=256m ${additionalJvmArgs}</property>
+ <property name="javaVmArguments">-server -XX:+UseCompressedOops -Xms64m -Xmx512m -XX:MaxPermSize=256m -Djboss.socket.binding.port-offset=${port-offset.cxf-tests.jboss} ${additionalJvmArgs}</property>
<property name="serverConfig">jbws-testsuite-default.xml</property>
<property name="allowConnectingToRunningServer">true</property>
<property name="managementAddress">${jboss.bind.address:localhost}</property>
9 years, 9 months
JBossWS SVN: r19616 - stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/httpConduit.
by jbossws-commits@lists.jboss.org
Author: asoldano
Date: 2015-04-03 12:01:12 -0400 (Fri, 03 Apr 2015)
New Revision: 19616
Modified:
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/httpConduit/HTTPConduitTestCase.java
Log:
[JBWS-3901] Fix bug in testcase (the new bus has to be set as default thread bus to be picked up ;-) )
Modified: stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/httpConduit/HTTPConduitTestCase.java
===================================================================
--- stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/httpConduit/HTTPConduitTestCase.java 2015-04-03 10:18:27 UTC (rev 19615)
+++ stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/httpConduit/HTTPConduitTestCase.java 2015-04-03 16:01:12 UTC (rev 19616)
@@ -88,6 +88,7 @@
@RunAsClient
public void testWrapperWithMap() throws Exception {
Bus bus = BusFactory.newInstance().createBus();
+ BusFactory.setThreadDefaultBus(bus);
try {
Map<String, Object> map = new HashMap<String, Object>();
map.put(Constants.CXF_CLIENT_ALLOW_CHUNKING, true);
@@ -120,6 +121,7 @@
@RunAsClient
public void testTimeout() throws Exception {
Bus bus = BusFactory.newInstance().createBus();
+ BusFactory.setThreadDefaultBus(bus);
try {
Map<String, Object> map = new HashMap<String, Object>();
map.put(Constants.CXF_CLIENT_CONNECTION_TIMEOUT, 6000L);
9 years, 9 months
JBossWS SVN: r19615 - in stack/cxf/trunk: modules/client and 2 other directories.
by jbossws-commits@lists.jboss.org
Author: asoldano
Date: 2015-04-03 06:18:27 -0400 (Fri, 03 Apr 2015)
New Revision: 19615
Modified:
stack/cxf/trunk/modules/client/pom.xml
stack/cxf/trunk/modules/dist/src/main/scripts/assembly-deploy-artifacts.xml
stack/cxf/trunk/modules/server/pom.xml
stack/cxf/trunk/pom.xml
Log:
[JBWS-3902] Adding missing cxf-xjc-runtime.jar artifact and upgrading xjc plugins version
Modified: stack/cxf/trunk/modules/client/pom.xml
===================================================================
--- stack/cxf/trunk/modules/client/pom.xml 2015-04-03 02:59:33 UTC (rev 19614)
+++ stack/cxf/trunk/modules/client/pom.xml 2015-04-03 10:18:27 UTC (rev 19615)
@@ -134,6 +134,10 @@
<artifactId>cxf-xjc-ts</artifactId>
</dependency>
<dependency>
+ <groupId>org.apache.cxf.xjc-utils</groupId>
+ <artifactId>cxf-xjc-runtime</artifactId>
+ </dependency>
+ <dependency>
<groupId>org.apache.velocity</groupId>
<artifactId>velocity</artifactId>
</dependency>
Modified: stack/cxf/trunk/modules/dist/src/main/scripts/assembly-deploy-artifacts.xml
===================================================================
--- stack/cxf/trunk/modules/dist/src/main/scripts/assembly-deploy-artifacts.xml 2015-04-03 02:59:33 UTC (rev 19614)
+++ stack/cxf/trunk/modules/dist/src/main/scripts/assembly-deploy-artifacts.xml 2015-04-03 10:18:27 UTC (rev 19615)
@@ -50,6 +50,7 @@
<include>org.apache.cxf.services.sts:cxf-services-sts-core:jar</include>
<include>org.apache.cxf.services.ws-discovery:cxf-services-ws-discovery-api:jar</include>
<include>org.apache.cxf.xjcplugins:cxf-*</include>
+ <include>org.apache.cxf.xjc-utils:cxf-*</include>
<include>com.sun.xml.bind:jaxb-core:jar</include>
<include>com.sun.xml.bind:jaxb-impl:jar</include>
<include>com.sun.xml.bind:jaxb-xjc:jar</include>
Modified: stack/cxf/trunk/modules/server/pom.xml
===================================================================
--- stack/cxf/trunk/modules/server/pom.xml 2015-04-03 02:59:33 UTC (rev 19614)
+++ stack/cxf/trunk/modules/server/pom.xml 2015-04-03 10:18:27 UTC (rev 19615)
@@ -134,6 +134,10 @@
<artifactId>cxf-xjc-ts</artifactId>
</dependency>
<dependency>
+ <groupId>org.apache.cxf.xjc-utils</groupId>
+ <artifactId>cxf-xjc-runtime</artifactId>
+ </dependency>
+ <dependency>
<groupId>org.apache.velocity</groupId>
<artifactId>velocity</artifactId>
</dependency>
Modified: stack/cxf/trunk/pom.xml
===================================================================
--- stack/cxf/trunk/pom.xml 2015-04-03 02:59:33 UTC (rev 19614)
+++ stack/cxf/trunk/pom.xml 2015-04-03 10:18:27 UTC (rev 19615)
@@ -75,7 +75,7 @@
<ejb.api.version>1.0.2.Final</ejb.api.version>
<cxf.version>3.0.4</cxf.version>
<cxf.asm.version>3.3.1</cxf.asm.version>
- <cxf.xjcplugins.version>3.0.2</cxf.xjcplugins.version>
+ <cxf.xjcplugins.version>3.0.3</cxf.xjcplugins.version>
<jboss-logging.version>3.1.2.GA</jboss-logging.version>
<jboss-logging-annotations.version>1.2.0.Final</jboss-logging-annotations.version>
<jboss-logging-processor.version>1.0.3.Final</jboss-logging-processor.version>
@@ -771,142 +771,27 @@
<groupId>org.apache.cxf.xjcplugins</groupId>
<artifactId>cxf-xjc-boolean</artifactId>
<version>${cxf.xjcplugins.version}</version>
- <exclusions>
- <exclusion>
- <groupId>org.springframework</groupId>
- <artifactId>spring-aop</artifactId>
- </exclusion>
- <exclusion>
- <groupId>org.springframework</groupId>
- <artifactId>spring-beans</artifactId>
- </exclusion>
- <exclusion>
- <groupId>org.springframework</groupId>
- <artifactId>spring-context</artifactId>
- </exclusion>
- <exclusion>
- <groupId>org.springframework</groupId>
- <artifactId>spring-core</artifactId>
- </exclusion>
- <exclusion>
- <groupId>org.springframework</groupId>
- <artifactId>spring-expression</artifactId>
- </exclusion>
- <exclusion>
- <groupId>org.springframework</groupId>
- <artifactId>spring-tx</artifactId>
- </exclusion>
- <exclusion>
- <groupId>org.springframework</groupId>
- <artifactId>spring-jms</artifactId>
- </exclusion>
- </exclusions>
</dependency>
<dependency>
<groupId>org.apache.cxf.xjcplugins</groupId>
<artifactId>cxf-xjc-bug986</artifactId>
<version>${cxf.xjcplugins.version}</version>
- <exclusions>
- <exclusion>
- <groupId>org.springframework</groupId>
- <artifactId>spring-aop</artifactId>
- </exclusion>
- <exclusion>
- <groupId>org.springframework</groupId>
- <artifactId>spring-beans</artifactId>
- </exclusion>
- <exclusion>
- <groupId>org.springframework</groupId>
- <artifactId>spring-context</artifactId>
- </exclusion>
- <exclusion>
- <groupId>org.springframework</groupId>
- <artifactId>spring-core</artifactId>
- </exclusion>
- <exclusion>
- <groupId>org.springframework</groupId>
- <artifactId>spring-expression</artifactId>
- </exclusion>
- <exclusion>
- <groupId>org.springframework</groupId>
- <artifactId>spring-tx</artifactId>
- </exclusion>
- <exclusion>
- <groupId>org.springframework</groupId>
- <artifactId>spring-jms</artifactId>
- </exclusion>
- </exclusions>
</dependency>
<dependency>
<groupId>org.apache.cxf.xjcplugins</groupId>
<artifactId>cxf-xjc-dv</artifactId>
<version>${cxf.xjcplugins.version}</version>
- <exclusions>
- <exclusion>
- <groupId>org.springframework</groupId>
- <artifactId>spring-aop</artifactId>
- </exclusion>
- <exclusion>
- <groupId>org.springframework</groupId>
- <artifactId>spring-beans</artifactId>
- </exclusion>
- <exclusion>
- <groupId>org.springframework</groupId>
- <artifactId>spring-context</artifactId>
- </exclusion>
- <exclusion>
- <groupId>org.springframework</groupId>
- <artifactId>spring-core</artifactId>
- </exclusion>
- <exclusion>
- <groupId>org.springframework</groupId>
- <artifactId>spring-expression</artifactId>
- </exclusion>
- <exclusion>
- <groupId>org.springframework</groupId>
- <artifactId>spring-tx</artifactId>
- </exclusion>
- <exclusion>
- <groupId>org.springframework</groupId>
- <artifactId>spring-jms</artifactId>
- </exclusion>
- </exclusions>
</dependency>
<dependency>
<groupId>org.apache.cxf.xjcplugins</groupId>
<artifactId>cxf-xjc-ts</artifactId>
<version>${cxf.xjcplugins.version}</version>
- <exclusions>
- <exclusion>
- <groupId>org.springframework</groupId>
- <artifactId>spring-aop</artifactId>
- </exclusion>
- <exclusion>
- <groupId>org.springframework</groupId>
- <artifactId>spring-beans</artifactId>
- </exclusion>
- <exclusion>
- <groupId>org.springframework</groupId>
- <artifactId>spring-context</artifactId>
- </exclusion>
- <exclusion>
- <groupId>org.springframework</groupId>
- <artifactId>spring-core</artifactId>
- </exclusion>
- <exclusion>
- <groupId>org.springframework</groupId>
- <artifactId>spring-expression</artifactId>
- </exclusion>
- <exclusion>
- <groupId>org.springframework</groupId>
- <artifactId>spring-tx</artifactId>
- </exclusion>
- <exclusion>
- <groupId>org.springframework</groupId>
- <artifactId>spring-jms</artifactId>
- </exclusion>
- </exclusions>
</dependency>
+ <dependency>
+ <groupId>org.apache.cxf.xjc-utils</groupId>
+ <artifactId>cxf-xjc-runtime</artifactId>
+ <version>${cxf.xjcplugins.version}</version>
+ </dependency>
<dependency>
<groupId>org.jboss.spec.javax.xml.soap</groupId>
9 years, 9 months
JBossWS SVN: r19614 - stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf.
by jbossws-commits@lists.jboss.org
Author: jim.ma
Date: 2015-04-02 22:59:33 -0400 (Thu, 02 Apr 2015)
New Revision: 19614
Modified:
stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/Messages.java
Log:
Impove error message
Modified: stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/Messages.java
===================================================================
--- stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/Messages.java 2015-04-03 00:30:20 UTC (rev 19613)
+++ stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/Messages.java 2015-04-03 02:59:33 UTC (rev 19614)
@@ -218,6 +218,6 @@
@Message(id = 24104, value = "Service class %s is missing required JAX-WS 2.2 additional constructors")
WSFException missingJAXWS22ServiceConstructor(String className, @Cause Throwable cause);
- @Message(id = 24108, value = "BindingOperation and dispatched method is missing for service implementation invocation")
+ @Message(id = 24108, value = "Invalid request received:bindingOperation and dispatched method are missing for service implementation invocation")
IllegalArgumentException missingBindingOpeartionAndDispatchedMethod();
}
9 years, 9 months
JBossWS SVN: r19613 - in stack/cxf/trunk/modules/testsuite: cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/udp and 1 other directory.
by jbossws-commits@lists.jboss.org
Author: jim.ma
Date: 2015-04-02 20:30:20 -0400 (Thu, 02 Apr 2015)
New Revision: 19613
Modified:
stack/cxf/trunk/modules/testsuite/cxf-spring-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/in_container_client/Helper.java
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/udp/UDPEndpointAPITestCase.java
Log:
Fix NPE on windows
Modified: stack/cxf/trunk/modules/testsuite/cxf-spring-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/in_container_client/Helper.java
===================================================================
--- stack/cxf/trunk/modules/testsuite/cxf-spring-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/in_container_client/Helper.java 2015-04-02 09:00:11 UTC (rev 19612)
+++ stack/cxf/trunk/modules/testsuite/cxf-spring-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/in_container_client/Helper.java 2015-04-03 00:30:20 UTC (rev 19613)
@@ -56,7 +56,7 @@
log.error("Expected instance of " + JBossWSBusFactory.class + " but got: " + factory.getClass());
return false;
}
- Bus bus = ((JBossWSBusFactory)factory).createBus("cxf.xml"); //force Spring bus construction、
+ Bus bus = ((JBossWSBusFactory)factory).createBus("cxf.xml"); //force Spring bus construction
try
{
BusFactory.setThreadDefaultBus(bus);
Modified: stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/udp/UDPEndpointAPITestCase.java
===================================================================
--- stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/udp/UDPEndpointAPITestCase.java 2015-04-02 09:00:11 UTC (rev 19612)
+++ stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/udp/UDPEndpointAPITestCase.java 2015-04-03 00:30:20 UTC (rev 19613)
@@ -133,12 +133,21 @@
}
private boolean isBroadcastAddressAvailable(NetworkInterface networkInterface) {
- for (InterfaceAddress interfaceAddress : networkInterface.getInterfaceAddresses()) {
- InetAddress broadcast = interfaceAddress.getBroadcast();
- if (broadcast != null) {
- return true;
+ try
+ {
+ for (InterfaceAddress interfaceAddress : networkInterface.getInterfaceAddresses())
+ {
+ InetAddress broadcast = interfaceAddress.getBroadcast();
+ if (broadcast != null)
+ {
+ return true;
+ }
}
}
+ catch (Throwable e)
+ {
+ //in case networkInterface.getInterfaceAddresses() throws NPE on windows
+ }
return false;
}
9 years, 9 months
JBossWS SVN: r19612 - in stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf: httpConduit and 1 other directory.
by jbossws-commits@lists.jboss.org
Author: asoldano
Date: 2015-04-02 05:00:11 -0400 (Thu, 02 Apr 2015)
New Revision: 19612
Added:
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/httpConduit/
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/httpConduit/EndpointOne.java
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/httpConduit/EndpointOneImpl.java
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/httpConduit/HTTPConduitTestCase.java
Log:
[JBWS-3901] Adding few tests
Added: stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/httpConduit/EndpointOne.java
===================================================================
--- stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/httpConduit/EndpointOne.java (rev 0)
+++ stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/httpConduit/EndpointOne.java 2015-04-02 09:00:11 UTC (rev 19612)
@@ -0,0 +1,30 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2014, 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.test.ws.jaxws.cxf.httpConduit;
+
+import javax.jws.WebService;
+
+@WebService(name = "EndpointOne", targetNamespace = "http://org.jboss.ws.jaxws.cxf/httpConduit", serviceName = "ServiceOne")
+public interface EndpointOne
+{
+ String echo(String input);
+}
Property changes on: stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/httpConduit/EndpointOne.java
___________________________________________________________________
Added: svn:keywords
+ Rev Date
Added: svn:eol-style
+ native
Added: stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/httpConduit/EndpointOneImpl.java
===================================================================
--- stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/httpConduit/EndpointOneImpl.java (rev 0)
+++ stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/httpConduit/EndpointOneImpl.java 2015-04-02 09:00:11 UTC (rev 19612)
@@ -0,0 +1,46 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2014, 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.test.ws.jaxws.cxf.httpConduit;
+
+import javax.jws.WebService;
+
+import org.jboss.logging.Logger;
+
+@WebService(name = "EndpointOne", targetNamespace = "http://org.jboss.ws.jaxws.cxf/httpConduit", serviceName = "ServiceOne")
+public class EndpointOneImpl
+{
+ public String echo(String input)
+ {
+ Logger.getLogger(this.getClass()).info("echo: " + input);
+ if ("wait".equals(input)) {
+ try
+ {
+ Thread.sleep(3000);
+ }
+ catch (InterruptedException e)
+ {
+ throw new RuntimeException(e);
+ }
+ }
+ return input;
+ }
+}
Property changes on: stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/httpConduit/EndpointOneImpl.java
___________________________________________________________________
Added: svn:keywords
+ Rev Date
Added: svn:eol-style
+ native
Added: stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/httpConduit/HTTPConduitTestCase.java
===================================================================
--- stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/httpConduit/HTTPConduitTestCase.java (rev 0)
+++ stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/httpConduit/HTTPConduitTestCase.java 2015-04-02 09:00:11 UTC (rev 19612)
@@ -0,0 +1,157 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2015, 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.test.ws.jaxws.cxf.httpConduit;
+
+import java.net.URL;
+import java.util.HashMap;
+import java.util.Map;
+
+import javax.xml.namespace.QName;
+import javax.xml.ws.Service;
+
+import org.apache.cxf.Bus;
+import org.apache.cxf.BusFactory;
+import org.apache.cxf.frontend.ClientProxy;
+import org.apache.cxf.transport.http.HTTPConduit;
+import org.apache.cxf.transport.http.HTTPConduitFactory;
+import org.apache.cxf.transports.http.configuration.HTTPClientPolicy;
+import org.jboss.arquillian.container.test.api.Deployment;
+import org.jboss.arquillian.container.test.api.RunAsClient;
+import org.jboss.arquillian.junit.Arquillian;
+import org.jboss.arquillian.test.api.ArquillianResource;
+import org.jboss.shrinkwrap.api.ShrinkWrap;
+import org.jboss.shrinkwrap.api.spec.WebArchive;
+import org.jboss.wsf.stack.cxf.client.Constants;
+import org.jboss.wsf.stack.cxf.client.configuration.AbstractHTTPConduitFactoryWrapper;
+import org.jboss.wsf.stack.cxf.client.configuration.DefaultHTTPConduitFactoryWrapper;
+import org.jboss.wsf.test.JBossWSTest;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
+/**
+ * [JBWS-3901] Testcase for HTTPConduit default value setup
+ *
+ * @author alessio.soldano(a)jboss.com
+ * @since 02-Apr-2015
+ */
+(a)RunWith(Arquillian.class)
+public class HTTPConduitTestCase extends JBossWSTest
+{
+ @ArquillianResource
+ private URL baseURL;
+
+ @Deployment(testable = false)
+ public static WebArchive createDeployment() {
+ WebArchive archive = ShrinkWrap.create(WebArchive.class, "jaxws-cxf-httpConduit.war");
+ archive.addClass(org.jboss.test.ws.jaxws.cxf.httpConduit.EndpointOneImpl.class);
+ return archive;
+ }
+
+ @Test
+ @RunAsClient
+ public void testDefaultWrapperInstalled() throws Exception {
+ Bus bus = BusFactory.newInstance().createBus();
+ try {
+ HTTPConduitFactory hcf = bus.getExtension(HTTPConduitFactory.class);
+ assertNotNull(hcf);
+ assertTrue(hcf instanceof DefaultHTTPConduitFactoryWrapper);
+
+ URL wsdlURL = new URL(baseURL + "/ServiceOne" + "?wsdl");
+ Service service = Service.create(wsdlURL, new QName("http://org.jboss.ws.jaxws.cxf/httpConduit", "ServiceOne"));
+ EndpointOne port = service.getPort(new QName("http://org.jboss.ws.jaxws.cxf/httpConduit", "EndpointOnePort"), EndpointOne.class);
+ assertEquals("Foo", port.echo("Foo"));
+ } finally {
+ bus.shutdown(true);
+ }
+ }
+
+ @Test
+ @RunAsClient
+ public void testWrapperWithMap() throws Exception {
+ Bus bus = BusFactory.newInstance().createBus();
+ try {
+ Map<String, Object> map = new HashMap<String, Object>();
+ map.put(Constants.CXF_CLIENT_ALLOW_CHUNKING, true);
+ map.put(Constants.CXF_CLIENT_CHUNKING_THRESHOLD, 8192);
+ map.put(Constants.CXF_CLIENT_CONNECTION_TIMEOUT, 16384L);
+ map.put(Constants.CXF_CLIENT_RECEIVE_TIMEOUT, 163840L);
+ map.put(Constants.CXF_TLS_CLIENT_DISABLE_CN_CHECK, true);
+ replaceWrapper(map, bus);
+
+ URL wsdlURL = new URL(baseURL + "/ServiceOne" + "?wsdl");
+ Service service = Service.create(wsdlURL, new QName("http://org.jboss.ws.jaxws.cxf/httpConduit", "ServiceOne"));
+ EndpointOne port = service.getPort(new QName("http://org.jboss.ws.jaxws.cxf/httpConduit", "EndpointOnePort"), EndpointOne.class);
+
+ HTTPConduit conduit = (HTTPConduit)ClientProxy.getClient(port).getConduit();
+ HTTPClientPolicy client = conduit.getClient();
+ assertNotNull(client);
+ assertEquals(true, client.isAllowChunking());
+ assertEquals(8192, client.getChunkingThreshold());
+ assertEquals(16384, client.getConnectionTimeout());
+ assertEquals(163840, client.getReceiveTimeout());
+ assertEquals(true, conduit.getTlsClientParameters().isDisableCNCheck());
+
+ assertEquals("Foo", port.echo("Foo"));
+ } finally {
+ bus.shutdown(true);
+ }
+ }
+
+ @Test
+ @RunAsClient
+ public void testTimeout() throws Exception {
+ Bus bus = BusFactory.newInstance().createBus();
+ try {
+ Map<String, Object> map = new HashMap<String, Object>();
+ map.put(Constants.CXF_CLIENT_CONNECTION_TIMEOUT, 6000L);
+ map.put(Constants.CXF_CLIENT_RECEIVE_TIMEOUT, 1000L);
+ replaceWrapper(map, bus);
+
+ URL wsdlURL = new URL(baseURL + "/ServiceOne" + "?wsdl");
+ Service service = Service.create(wsdlURL, new QName("http://org.jboss.ws.jaxws.cxf/httpConduit", "ServiceOne"));
+ EndpointOne port = service.getPort(new QName("http://org.jboss.ws.jaxws.cxf/httpConduit", "EndpointOnePort"), EndpointOne.class);
+
+ try {
+ port.echo("wait");
+ fail("Timeout exeception is expected");
+ } catch (Exception e) {
+ //expected
+ }
+
+ assertEquals("Foo", port.echo("Foo"));
+ } finally {
+ bus.shutdown(true);
+ }
+ }
+
+
+
+ private DefaultHTTPConduitFactoryWrapper replaceWrapper(Map<String, Object> args, Bus bus)
+ {
+ HTTPConduitFactory hcf = bus.getExtension(HTTPConduitFactory.class);
+ //replace wrapper
+ DefaultHTTPConduitFactoryWrapper w = new DefaultHTTPConduitFactoryWrapper(args, false,
+ ((AbstractHTTPConduitFactoryWrapper) hcf).getDelegate());
+ bus.setExtension(w, HTTPConduitFactory.class);
+ return w;
+ }
+}
Property changes on: stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/httpConduit/HTTPConduitTestCase.java
___________________________________________________________________
Added: svn:keywords
+ Rev Date
Added: svn:eol-style
+ native
9 years, 9 months
JBossWS SVN: r19611 - stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/configuration.
by jbossws-commits@lists.jboss.org
Author: asoldano
Date: 2015-04-02 04:59:25 -0400 (Thu, 02 Apr 2015)
New Revision: 19611
Modified:
stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/configuration/AbstractHTTPConduitFactoryWrapper.java
stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/configuration/DefaultHTTPConduitFactoryWrapper.java
stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/configuration/JBossWSNonSpringBusFactory.java
stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/configuration/JBossWSSpringBusFactory.java
Log:
[JBWS-3901] Refactoring
Modified: stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/configuration/AbstractHTTPConduitFactoryWrapper.java
===================================================================
--- stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/configuration/AbstractHTTPConduitFactoryWrapper.java 2015-04-01 20:33:19 UTC (rev 19610)
+++ stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/configuration/AbstractHTTPConduitFactoryWrapper.java 2015-04-02 08:59:25 UTC (rev 19611)
@@ -40,19 +40,13 @@
*/
public abstract class AbstractHTTPConduitFactoryWrapper implements HTTPConduitFactory
{
- private HTTPConduitFactory delegate;
+ private final HTTPConduitFactory delegate;
- /**
- * Installs the current wrapper in the specified Bus instance.
- *
- * @param bus The Bus instance to install the wrapper in
- */
- public void install(Bus bus)
+ public AbstractHTTPConduitFactoryWrapper(HTTPConduitFactory delegate)
{
- delegate = bus.getExtension(HTTPConduitFactory.class);
- bus.setExtension(this, HTTPConduitFactory.class);
+ this.delegate = delegate;
}
-
+
@Override
public HTTPConduit createConduit(HTTPTransportFactory f, Bus b, EndpointInfo localInfo, EndpointReferenceType target)
throws IOException
Modified: stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/configuration/DefaultHTTPConduitFactoryWrapper.java
===================================================================
--- stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/configuration/DefaultHTTPConduitFactoryWrapper.java 2015-04-01 20:33:19 UTC (rev 19610)
+++ stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/configuration/DefaultHTTPConduitFactoryWrapper.java 2015-04-02 08:59:25 UTC (rev 19611)
@@ -31,6 +31,7 @@
import org.apache.cxf.configuration.jsse.TLSClientParameters;
import org.apache.cxf.service.model.EndpointInfo;
import org.apache.cxf.transport.http.HTTPConduit;
+import org.apache.cxf.transport.http.HTTPConduitFactory;
import org.apache.cxf.transport.http.HTTPTransportFactory;
import org.apache.cxf.transport.http.URLConnectionHTTPConduit;
import org.apache.cxf.transports.http.configuration.ConnectionType;
@@ -61,13 +62,15 @@
private final Map<String, Object> configuration;
- public DefaultHTTPConduitFactoryWrapper()
+ public DefaultHTTPConduitFactoryWrapper(HTTPConduitFactory delegate)
{
+ super(delegate);
this.configuration = defaultConfiguration;
}
- public DefaultHTTPConduitFactoryWrapper(Map<String, Object> configuration, boolean useSystemDefault)
+ public DefaultHTTPConduitFactoryWrapper(Map<String, Object> configuration, boolean useSystemDefault, HTTPConduitFactory delegate)
{
+ super(delegate);
if (configuration == null) {
throw new IllegalArgumentException();
}
@@ -157,4 +160,10 @@
}
}
}
+
+ public static void install(Bus bus)
+ {
+ HTTPConduitFactory delegate = bus.getExtension(HTTPConduitFactory.class);
+ bus.setExtension(new DefaultHTTPConduitFactoryWrapper(delegate), HTTPConduitFactory.class);
+ }
}
Modified: stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/configuration/JBossWSNonSpringBusFactory.java
===================================================================
--- stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/configuration/JBossWSNonSpringBusFactory.java 2015-04-01 20:33:19 UTC (rev 19610)
+++ stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/configuration/JBossWSNonSpringBusFactory.java 2015-04-02 08:59:25 UTC (rev 19611)
@@ -60,7 +60,7 @@
initializeBus(bus);
bus.initialize();
- new DefaultHTTPConduitFactoryWrapper().install(bus);
+ DefaultHTTPConduitFactoryWrapper.install(bus);
return bus;
}
Modified: stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/configuration/JBossWSSpringBusFactory.java
===================================================================
--- stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/configuration/JBossWSSpringBusFactory.java 2015-04-01 20:33:19 UTC (rev 19610)
+++ stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/configuration/JBossWSSpringBusFactory.java 2015-04-02 08:59:25 UTC (rev 19611)
@@ -113,7 +113,7 @@
registerAppContextLifeCycleListener(bus, bac);
- new DefaultHTTPConduitFactoryWrapper().install(bus);
+ DefaultHTTPConduitFactoryWrapper.install(bus);
return bus;
}
9 years, 9 months
JBossWS SVN: r19610 - in stack/cxf/trunk/modules: client/src/main/java/org/jboss/wsf/stack/cxf/client/configuration and 1 other directories.
by jbossws-commits@lists.jboss.org
Author: asoldano
Date: 2015-04-01 16:33:19 -0400 (Wed, 01 Apr 2015)
New Revision: 19610
Added:
stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/configuration/AbstractHTTPConduitFactoryWrapper.java
stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/configuration/DefaultHTTPConduitFactoryWrapper.java
Modified:
stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/Constants.java
stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/configuration/BeanCustomizer.java
stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/configuration/JBossWSNonSpringBusFactory.java
stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/configuration/JBossWSSpringBusFactory.java
stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/configuration/SecurityActions.java
stack/cxf/trunk/modules/testsuite/pom.xml
Log:
[JBWS-3901] Install a HTTPConduitFactory wrapper that sets few default HTTPConduit values obtained from system properties
Modified: stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/Constants.java
===================================================================
--- stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/Constants.java 2015-03-30 15:11:57 UTC (rev 19609)
+++ stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/Constants.java 2015-04-01 20:33:19 UTC (rev 19610)
@@ -48,6 +48,12 @@
public static final String CXF_WS_DISCOVERY_ENABLED = "cxf.ws-discovery.enabled";
public static final String JBWS_CXF_DISABLE_HANDLER_AUTH_CHECKS = "org.jboss.ws.cxf.disableHandlerAuthChecks";
public static final String JBWS_CXF_NO_LOCAL_BC = "org.jboss.ws.cxf.noLocalBC";
+ public static final String CXF_CLIENT_ALLOW_CHUNKING = "cxf.client.allowChunking";
+ public static final String CXF_CLIENT_CHUNKING_THRESHOLD = "cxf.client.chunkingThreshold";
+ public static final String CXF_CLIENT_CONNECTION_TIMEOUT = "cxf.client.connectionTimeout";
+ public static final String CXF_CLIENT_RECEIVE_TIMEOUT = "cxf.client.receiveTimeout";
+ public static final String CXF_CLIENT_CONNECTION = "cxf.client.connection";
+ public static final String CXF_TLS_CLIENT_DISABLE_CN_CHECK = "cxf.tls-client.disableCNCheck";
public static final String JBWS_CXF_JAXWS_CLIENT_BUS_STRATEGY = "org.jboss.ws.cxf.jaxws-client.bus.strategy";
public static final String THREAD_BUS_STRATEGY = "THREAD_BUS";
Added: stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/configuration/AbstractHTTPConduitFactoryWrapper.java
===================================================================
--- stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/configuration/AbstractHTTPConduitFactoryWrapper.java (rev 0)
+++ stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/configuration/AbstractHTTPConduitFactoryWrapper.java 2015-04-01 20:33:19 UTC (rev 19610)
@@ -0,0 +1,105 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2015, 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.wsf.stack.cxf.client.configuration;
+
+import java.io.IOException;
+
+import org.apache.cxf.Bus;
+import org.apache.cxf.service.model.EndpointInfo;
+import org.apache.cxf.transport.http.HTTPConduit;
+import org.apache.cxf.transport.http.HTTPConduitFactory;
+import org.apache.cxf.transport.http.HTTPTransportFactory;
+import org.apache.cxf.ws.addressing.EndpointReferenceType;
+
+/**
+ * Abstract wrapper over HTTPConduitFactory for configuring HTTPConduit instances with default
+ * values just after they've been created.
+ * This class can be extended to establish and set default HTTPConduit values in different ways.
+ *
+ * @author alessio.soldano(a)jboss.com
+ * @since 1-Apr-2015
+ */
+public abstract class AbstractHTTPConduitFactoryWrapper implements HTTPConduitFactory
+{
+ private HTTPConduitFactory delegate;
+
+ /**
+ * Installs the current wrapper in the specified Bus instance.
+ *
+ * @param bus The Bus instance to install the wrapper in
+ */
+ public void install(Bus bus)
+ {
+ delegate = bus.getExtension(HTTPConduitFactory.class);
+ bus.setExtension(this, HTTPConduitFactory.class);
+ }
+
+ @Override
+ public HTTPConduit createConduit(HTTPTransportFactory f, Bus b, EndpointInfo localInfo, EndpointReferenceType target)
+ throws IOException
+ {
+ HTTPConduit conduit = null;
+ if (delegate != null)
+ {
+ conduit = delegate.createConduit(f, b, localInfo, target);
+ }
+ else
+ {
+ conduit = createNewConduit(f, b, localInfo, target);
+ }
+ if (conduit != null)
+ {
+ configureConduit(conduit);
+ }
+ return conduit;
+ }
+
+ /**
+ * Returns the HTTPConduitFactory instance that this wrapper delegates to
+ *
+ * @return The wrapper's delegate
+ */
+ public HTTPConduitFactory getDelegate()
+ {
+ return delegate;
+ }
+
+ /**
+ * Creates a new HTTPConduit instance; this is used internally when no delegate is available for getting a HTTPConduit instance to configure
+ *
+ * @param f The current HTTPTransportFactory
+ * @param b The current Bus
+ * @param localInfo The current EndpointInfo
+ * @param target The EndpointReferenceType
+ * @return A new HTTPConduit instance
+ * @throws IOException
+ */
+ protected abstract HTTPConduit createNewConduit(HTTPTransportFactory f, Bus b, EndpointInfo localInfo,
+ EndpointReferenceType target) throws IOException;
+
+ /**
+ * Configures the specified HTTPConduit instance with default values
+ *
+ * @param conduit The HTTPConduit instance to be configured
+ */
+ protected abstract void configureConduit(HTTPConduit conduit);
+}
Property changes on: stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/configuration/AbstractHTTPConduitFactoryWrapper.java
___________________________________________________________________
Added: svn:keywords
+ Rev Date
Added: svn:eol-style
+ native
Modified: stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/configuration/BeanCustomizer.java
===================================================================
--- stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/configuration/BeanCustomizer.java 2015-03-30 15:11:57 UTC (rev 19609)
+++ stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/configuration/BeanCustomizer.java 2015-04-01 20:33:19 UTC (rev 19610)
@@ -21,13 +21,11 @@
*/
package org.jboss.wsf.stack.cxf.client.configuration;
-import org.apache.cxf.configuration.jsse.TLSClientParameters;
import org.apache.cxf.databinding.DataBinding;
import org.apache.cxf.frontend.AbstractWSDLBasedEndpointFactory;
import org.apache.cxf.frontend.ClientProxyFactoryBean;
import org.apache.cxf.jaxb.JAXBDataBinding;
import org.apache.cxf.wsdl.service.factory.ReflectionServiceFactoryBean;
-import org.apache.cxf.transport.http.HTTPConduit;
import org.jboss.ws.api.binding.BindingCustomization;
import org.jboss.ws.api.binding.JAXBBindingCustomization;
@@ -50,10 +48,6 @@
{
configureClientProxyFactoryBean((ClientProxyFactoryBean)beanInstance);
}
- else if (beanInstance instanceof HTTPConduit)
- {
- configureHTTPConduit((HTTPConduit)beanInstance);
- }
//add other beans configuration here below
}
@@ -117,27 +111,6 @@
//add other configurations here below
}
- /**
- * Configure the HTTPConduit; currently allows for setting disableCNcheck in TLS client parameters according
- * to the JBoss' org.jboss.security.ignoreHttpsHost system property.
- *
- * @param conduit
- */
- protected void configureHTTPConduit(HTTPConduit conduit)
- {
- TLSClientParameters parameters = conduit.getTlsClientParameters();
- if (parameters == null) //don't do anything when user already provided a configuration
- {
- parameters = new TLSClientParameters();
- parameters.setUseHttpsURLConnectionDefaultSslSocketFactory(true);
- if (SecurityActions.getBoolean("org.jboss.security.ignoreHttpsHost"))
- {
- parameters.setDisableCNCheck(true);
- }
- conduit.setTlsClientParameters(parameters);
- }
- }
-
@SuppressWarnings("unchecked")
protected static void configureBindingCustomization(DataBinding db, BindingCustomization customization)
{
Added: stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/configuration/DefaultHTTPConduitFactoryWrapper.java
===================================================================
--- stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/configuration/DefaultHTTPConduitFactoryWrapper.java (rev 0)
+++ stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/configuration/DefaultHTTPConduitFactoryWrapper.java 2015-04-01 20:33:19 UTC (rev 19610)
@@ -0,0 +1,160 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2015, 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.wsf.stack.cxf.client.configuration;
+
+import java.io.IOException;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Map.Entry;
+
+import org.apache.cxf.Bus;
+import org.apache.cxf.configuration.jsse.TLSClientParameters;
+import org.apache.cxf.service.model.EndpointInfo;
+import org.apache.cxf.transport.http.HTTPConduit;
+import org.apache.cxf.transport.http.HTTPTransportFactory;
+import org.apache.cxf.transport.http.URLConnectionHTTPConduit;
+import org.apache.cxf.transports.http.configuration.ConnectionType;
+import org.apache.cxf.transports.http.configuration.HTTPClientPolicy;
+import org.apache.cxf.ws.addressing.EndpointReferenceType;
+import org.jboss.wsf.stack.cxf.client.Constants;
+
+/**
+ * The default wrapper of HTTPConduitFactory, which gets default configuration values from a
+ * map. The configuration map can also be populated by system properties.
+ *
+ * @author alessio.soldano(a)jboss.com
+ * @since 1-Apr-2015
+ */
+public final class DefaultHTTPConduitFactoryWrapper extends AbstractHTTPConduitFactoryWrapper
+{
+ private static final Map<String, Object> defaultConfiguration;
+ static {
+ Map<String, Object> map = new HashMap<String, Object>();
+ map.put(Constants.CXF_CLIENT_ALLOW_CHUNKING, SecurityActions.getBoolean(Constants.CXF_CLIENT_ALLOW_CHUNKING, null));
+ map.put(Constants.CXF_CLIENT_CHUNKING_THRESHOLD, SecurityActions.getInteger(Constants.CXF_CLIENT_CHUNKING_THRESHOLD, null));
+ map.put(Constants.CXF_TLS_CLIENT_DISABLE_CN_CHECK, SecurityActions.getBoolean(Constants.CXF_TLS_CLIENT_DISABLE_CN_CHECK));
+ map.put(Constants.CXF_CLIENT_CONNECTION_TIMEOUT, SecurityActions.getLong(Constants.CXF_CLIENT_CONNECTION_TIMEOUT, null));
+ map.put(Constants.CXF_CLIENT_RECEIVE_TIMEOUT, SecurityActions.getLong(Constants.CXF_CLIENT_RECEIVE_TIMEOUT, null));
+ map.put(Constants.CXF_CLIENT_CONNECTION, SecurityActions.getSystemProperty(Constants.CXF_CLIENT_CONNECTION, null));
+ defaultConfiguration = Collections.unmodifiableMap(map);
+ }
+
+ private final Map<String, Object> configuration;
+
+ public DefaultHTTPConduitFactoryWrapper()
+ {
+ this.configuration = defaultConfiguration;
+ }
+
+ public DefaultHTTPConduitFactoryWrapper(Map<String, Object> configuration, boolean useSystemDefault)
+ {
+ if (configuration == null) {
+ throw new IllegalArgumentException();
+ }
+ if (useSystemDefault) {
+ this.configuration = new HashMap<String, Object>();
+ for (Entry<String, Object> e : defaultConfiguration.entrySet()) {
+ final String key = e.getKey();
+ this.configuration.put(key, e.getValue());
+ final Object providedValue = configuration.get(key);
+ if (providedValue != null) {
+ this.configuration.put(key, providedValue);
+ }
+ }
+ } else {
+ this.configuration = configuration;
+ }
+ }
+
+ protected HTTPConduit createNewConduit(HTTPTransportFactory f, Bus b, EndpointInfo localInfo,
+ EndpointReferenceType target) throws IOException
+ {
+ return new URLConnectionHTTPConduit(b, localInfo, target);
+ }
+
+ protected void configureConduit(HTTPConduit conduit)
+ {
+ configureTLSClient(conduit);
+ configureHTTPClientPolicy(conduit);
+ }
+
+ private void configureTLSClient(HTTPConduit conduit)
+ {
+ TLSClientParameters parameters = conduit.getTlsClientParameters();
+ if (parameters == null) //don't do anything when user already provided a configuration
+ {
+ parameters = new TLSClientParameters();
+ parameters.setUseHttpsURLConnectionDefaultSslSocketFactory(true);
+ if (Boolean.TRUE.equals((Boolean)configuration.get(Constants.CXF_TLS_CLIENT_DISABLE_CN_CHECK))) {
+ parameters.setDisableCNCheck(true);
+ }
+ conduit.setTlsClientParameters(parameters);
+ }
+ }
+
+ private void configureHTTPClientPolicy(HTTPConduit conduit)
+ {
+ boolean set = false;
+
+ final Boolean allowChunking = (Boolean)configuration.get(Constants.CXF_CLIENT_ALLOW_CHUNKING);
+ set = set || (allowChunking != null);
+ final Integer chunkingThreshold = (Integer)configuration.get(Constants.CXF_CLIENT_CHUNKING_THRESHOLD);
+ set = set || (chunkingThreshold != null);
+ final Long connectionTimeout = (Long)configuration.get(Constants.CXF_CLIENT_CONNECTION_TIMEOUT);
+ set = set || (connectionTimeout != null);
+ final Long receiveTimeout = (Long)configuration.get(Constants.CXF_CLIENT_RECEIVE_TIMEOUT);
+ set = set || (receiveTimeout != null);
+ final String connection = (String)configuration.get(Constants.CXF_CLIENT_CONNECTION);
+ set = set || (connection != null);
+
+ if (set)
+ {
+ HTTPClientPolicy httpClientPolicy = conduit.getClient();
+ if (httpClientPolicy == null)
+ {
+ httpClientPolicy = new HTTPClientPolicy();
+ conduit.setClient(httpClientPolicy);
+ }
+ if (allowChunking != null)
+ {
+ httpClientPolicy.setAllowChunking(allowChunking);
+ }
+ if (chunkingThreshold != null)
+ {
+ httpClientPolicy.setChunkingThreshold(chunkingThreshold);
+ }
+ if (connectionTimeout != null)
+ {
+ httpClientPolicy.setConnectionTimeout(connectionTimeout);
+ }
+ if (receiveTimeout != null)
+ {
+ httpClientPolicy.setReceiveTimeout(receiveTimeout);
+ }
+ if (connection != null)
+ {
+ httpClientPolicy.setConnection(ConnectionType.fromValue(connection));
+ }
+ }
+ }
+}
Property changes on: stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/configuration/DefaultHTTPConduitFactoryWrapper.java
___________________________________________________________________
Added: svn:keywords
+ Rev Date
Added: svn:eol-style
+ native
Modified: stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/configuration/JBossWSNonSpringBusFactory.java
===================================================================
--- stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/configuration/JBossWSNonSpringBusFactory.java 2015-03-30 15:11:57 UTC (rev 19609)
+++ stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/configuration/JBossWSNonSpringBusFactory.java 2015-04-01 20:33:19 UTC (rev 19610)
@@ -59,6 +59,8 @@
possiblySetDefaultBus(bus);
initializeBus(bus);
bus.initialize();
+
+ new DefaultHTTPConduitFactoryWrapper().install(bus);
return bus;
}
Modified: stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/configuration/JBossWSSpringBusFactory.java
===================================================================
--- stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/configuration/JBossWSSpringBusFactory.java 2015-03-30 15:11:57 UTC (rev 19609)
+++ stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/configuration/JBossWSSpringBusFactory.java 2015-04-01 20:33:19 UTC (rev 19610)
@@ -112,6 +112,8 @@
initializeBus(bus);
registerAppContextLifeCycleListener(bus, bac);
+
+ new DefaultHTTPConduitFactoryWrapper().install(bus);
return bus;
}
Modified: stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/configuration/SecurityActions.java
===================================================================
--- stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/configuration/SecurityActions.java 2015-03-30 15:11:57 UTC (rev 19609)
+++ stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/configuration/SecurityActions.java 2015-04-01 20:33:19 UTC (rev 19610)
@@ -81,6 +81,27 @@
}
}
+ static Boolean getBoolean(final String propName, final Boolean defaultValue)
+ {
+ SecurityManager sm = System.getSecurityManager();
+ if (sm == null)
+ {
+ String s = System.getProperty(propName);
+ return (s != null) ? Boolean.valueOf(s) : defaultValue;
+ }
+ else
+ {
+ return AccessController.doPrivileged(new PrivilegedAction<Boolean>()
+ {
+ public Boolean run()
+ {
+ String s = getSystemProperty(propName, null);
+ return (s != null) ? Boolean.valueOf(s) : defaultValue;
+ }
+ });
+ }
+ }
+
static boolean getBoolean(final String propName)
{
SecurityManager sm = System.getSecurityManager();
@@ -100,6 +121,63 @@
}
}
+ static Long getLong(final String propName, final Long defaultValue)
+ {
+ SecurityManager sm = System.getSecurityManager();
+ if (sm == null)
+ {
+ return Long.getLong(propName, defaultValue);
+ }
+ else
+ {
+ return AccessController.doPrivileged(new PrivilegedAction<Long>()
+ {
+ public Long run()
+ {
+ return Long.getLong(propName, defaultValue);
+ }
+ });
+ }
+ }
+
+ static Integer getInteger(final String propName, final Integer defaultValue)
+ {
+ SecurityManager sm = System.getSecurityManager();
+ if (sm == null)
+ {
+ return Integer.getInteger(propName, defaultValue);
+ }
+ else
+ {
+ return AccessController.doPrivileged(new PrivilegedAction<Integer>()
+ {
+ public Integer run()
+ {
+ return Integer.getInteger(propName, defaultValue);
+ }
+ });
+ }
+ }
+
+ static Integer getInteger(final String propName)
+ {
+ SecurityManager sm = System.getSecurityManager();
+ if (sm == null)
+ {
+ return Integer.getInteger(propName);
+ }
+ else
+ {
+ return AccessController.doPrivileged(new PrivilegedAction<Integer>()
+ {
+ public Integer run()
+ {
+ return Integer.getInteger(propName);
+ }
+ });
+ }
+ }
+
/**
* Load a class using the provided classloader
*
Modified: stack/cxf/trunk/modules/testsuite/pom.xml
===================================================================
--- stack/cxf/trunk/modules/testsuite/pom.xml 2015-03-30 15:11:57 UTC (rev 19609)
+++ stack/cxf/trunk/modules/testsuite/pom.xml 2015-04-01 20:33:19 UTC (rev 19610)
@@ -314,7 +314,7 @@
<javax.net.ssl.keyStore>${project.build.directory}/test-classes/client.keystore</javax.net.ssl.keyStore>
<javax.net.ssl.keyStorePassword>changeit</javax.net.ssl.keyStorePassword>
<javax.net.ssl.keyStoreType>jks</javax.net.ssl.keyStoreType>
- <org.jboss.security.ignoreHttpsHost>true</org.jboss.security.ignoreHttpsHost>
+ <cxf.tls-client.disableCNCheck>true</cxf.tls-client.disableCNCheck>
<jboss.home>${jboss.home}</jboss.home>
<jbossws.integration.target>${jbossws.integration.target}</jbossws.integration.target>
<log4j.output.dir>${log4j.output.dir}</log4j.output.dir>
@@ -355,7 +355,7 @@
<javax.net.ssl.keyStore>${project.build.directory}/test-classes/client.keystore</javax.net.ssl.keyStore>
<javax.net.ssl.keyStorePassword>changeit</javax.net.ssl.keyStorePassword>
<javax.net.ssl.keyStoreType>jks</javax.net.ssl.keyStoreType>
- <org.jboss.security.ignoreHttpsHost>true</org.jboss.security.ignoreHttpsHost>
+ <cxf.tls-client.disableCNCheck>true</cxf.tls-client.disableCNCheck>
<jboss.home>${jboss.home}</jboss.home>
<jbossws.integration.target>${jbossws.integration.target}</jbossws.integration.target>
<log4j.output.dir>${log4j.output.dir}</log4j.output.dir>
9 years, 9 months