Author: alessio.soldano(a)jboss.com
Date: 2012-07-26 10:04:23 -0400 (Thu, 26 Jul 2012)
New Revision: 16549
Added:
stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/configuration/CXFClientConfigurer.java
stack/cxf/trunk/modules/client/src/main/resources/META-INF/services/org.jboss.ws.api.configuration.ClientConfigurer
Modified:
stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/ProviderImpl.java
stack/cxf/trunk/modules/resources/src/main/resources/modules/jboss710/org/jboss/ws/api/main/module.xml
stack/cxf/trunk/modules/resources/src/main/resources/modules/jboss720/org/jboss/ws/api/main/module.xml
Log:
[JBWS-3529] Adding jbossws-cxf implementation of ClientConfigurer
Modified:
stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/ProviderImpl.java
===================================================================
---
stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/ProviderImpl.java 2012-07-26
14:03:29 UTC (rev 16548)
+++
stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/ProviderImpl.java 2012-07-26
14:04:23 UTC (rev 16549)
@@ -42,6 +42,7 @@
import org.apache.cxf.Bus;
import org.apache.cxf.BusFactory;
+import org.apache.cxf.endpoint.Client;
import org.apache.cxf.frontend.ClientProxy;
import org.apache.cxf.jaxws.ServiceImpl;
import org.apache.cxf.ws.addressing.EndpointReferenceType;
@@ -54,6 +55,7 @@
import org.jboss.wsf.spi.management.ServerConfig;
import org.jboss.wsf.spi.management.ServerConfigFactory;
import org.jboss.wsf.spi.metadata.config.ClientConfig;
+import org.jboss.wsf.stack.cxf.client.configuration.CXFClientConfigurer;
import org.jboss.wsf.stack.cxf.client.configuration.HandlerChainSortInterceptor;
import org.jboss.wsf.stack.cxf.client.configuration.JBossWSBusFactory;
import org.w3c.dom.Element;
@@ -462,14 +464,16 @@
WebServiceFeature... features) {
T port = super.createPort(portName, epr, serviceEndpointInterface, features);
Binding binding = ((BindingProvider)port).getBinding();
- ClientProxy.getClient(port).getOutInterceptors().add(new
HandlerChainSortInterceptor(binding));
+ Client client = ClientProxy.getClient(port);
+ client.getOutInterceptors().add(new HandlerChainSortInterceptor(binding));
if (inContainer) {
ServerConfig sc = getServerConfig();
if (sc != null) {
for (ClientConfig config : sc.getClientConfigs()) {
if (config.getConfigName().equals(ClientConfig.STANDARD_CLIENT_CONFIG))
{
- ConfigHelper helper = new ConfigHelper();
+ CXFClientConfigurer helper = new CXFClientConfigurer();
helper.setupConfigHandlers(binding, config);
+ helper.setConfigProperties(client, config.getProperties());
}
}
}
Added:
stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/configuration/CXFClientConfigurer.java
===================================================================
---
stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/configuration/CXFClientConfigurer.java
(rev 0)
+++
stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/configuration/CXFClientConfigurer.java 2012-07-26
14:04:23 UTC (rev 16549)
@@ -0,0 +1,49 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2012, 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.util.Map;
+
+import org.apache.cxf.endpoint.Client;
+import org.apache.cxf.frontend.ClientProxy;
+import org.jboss.ws.common.configuration.ConfigHelper;
+import org.jboss.wsf.spi.metadata.config.ClientConfig;
+
+/**
+ * CXF extension of common ClientConfigurer
+ *
+ * @author alessio.soldano(a)jboss.com
+ * @since 25-Jul-2012
+ *
+ */
+public class CXFClientConfigurer extends ConfigHelper
+{
+ @Override
+ public void setConfigProperties(Object proxy, String configFile, String configName) {
+ ClientConfig config = readConfig(configFile, configName);
+ setConfigProperties(ClientProxy.getClient(proxy), config.getProperties());
+ }
+
+ public void setConfigProperties(Client client, Map<String, String> properties)
{
+ client.getEndpoint().putAll(properties);
+ }
+}
Added:
stack/cxf/trunk/modules/client/src/main/resources/META-INF/services/org.jboss.ws.api.configuration.ClientConfigurer
===================================================================
---
stack/cxf/trunk/modules/client/src/main/resources/META-INF/services/org.jboss.ws.api.configuration.ClientConfigurer
(rev 0)
+++
stack/cxf/trunk/modules/client/src/main/resources/META-INF/services/org.jboss.ws.api.configuration.ClientConfigurer 2012-07-26
14:04:23 UTC (rev 16549)
@@ -0,0 +1 @@
+org.jboss.wsf.stack.cxf.client.configuration.CXFClientConfigurer
\ No newline at end of file
Modified:
stack/cxf/trunk/modules/resources/src/main/resources/modules/jboss710/org/jboss/ws/api/main/module.xml
===================================================================
---
stack/cxf/trunk/modules/resources/src/main/resources/modules/jboss710/org/jboss/ws/api/main/module.xml 2012-07-26
14:03:29 UTC (rev 16548)
+++
stack/cxf/trunk/modules/resources/src/main/resources/modules/jboss710/org/jboss/ws/api/main/module.xml 2012-07-26
14:04:23 UTC (rev 16549)
@@ -34,7 +34,7 @@
<module name="javax.xml.ws.api"/>
<module name="org.jboss.logging"/>
<module name="org.jboss.modules"/>
- <module name="org.jboss.ws.common" services="import"/>
+ <module name="org.jboss.ws.jaxws-client"
services="import"/>
</dependencies>
</module>
Modified:
stack/cxf/trunk/modules/resources/src/main/resources/modules/jboss720/org/jboss/ws/api/main/module.xml
===================================================================
---
stack/cxf/trunk/modules/resources/src/main/resources/modules/jboss720/org/jboss/ws/api/main/module.xml 2012-07-26
14:03:29 UTC (rev 16548)
+++
stack/cxf/trunk/modules/resources/src/main/resources/modules/jboss720/org/jboss/ws/api/main/module.xml 2012-07-26
14:04:23 UTC (rev 16549)
@@ -34,7 +34,7 @@
<module name="javax.xml.ws.api"/>
<module name="org.jboss.logging"/>
<module name="org.jboss.modules"/>
- <module name="org.jboss.ws.common" services="import"/>
+ <module name="org.jboss.ws.jaxws-client"
services="import"/>
</dependencies>
</module>