JBossWS SVN: r18287 - spi/tags.
by jbossws-commits@lists.jboss.org
Author: asoldano
Date: 2014-01-29 03:52:18 -0500 (Wed, 29 Jan 2014)
New Revision: 18287
Added:
spi/tags/jbossws-spi-2.3.0.Beta2/
Log:
Tagging jbossws-spi 2.3.0.Beta2
10 years, 11 months
JBossWS SVN: r18286 - in stack/cxf/trunk/modules/testsuite/cxf-tests/src/test: resources/jaxws/samples/wsse/policy/trust/META-INF and 2 other directories.
by jbossws-commits@lists.jboss.org
Author: rsearls
Date: 2014-01-28 16:25:10 -0500 (Tue, 28 Jan 2014)
New Revision: 18286
Modified:
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/trust/ActAsCallbackHandler.java
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/trust/ActAsServiceImpl.java
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/trust/ClientCallbackHandler.java
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/trust/SampleSTS.java
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/trust/WSTrustActAsTestCase.java
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/trust/WSTrustTestUtils.java
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/resources/jaxws/samples/wsse/policy/trust/META-INF/clientstore.jks
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/resources/jaxws/samples/wsse/policy/trust/WEB-INF/actasKeystore.properties
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/resources/jaxws/samples/wsse/policy/trust/WEB-INF/actasstore.jks
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/resources/jaxws/samples/wsse/policy/trust/WEB-INF/wsdl/ActAsService.wsdl
Log:
[JBWS-3738] incremental update; base components working.
Modified: stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/trust/ActAsCallbackHandler.java
===================================================================
--- stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/trust/ActAsCallbackHandler.java 2014-01-28 20:05:05 UTC (rev 18285)
+++ stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/trust/ActAsCallbackHandler.java 2014-01-28 21:25:10 UTC (rev 18286)
@@ -18,38 +18,27 @@
*/
package org.jboss.test.ws.jaxws.samples.wsse.policy.trust;
-import org.apache.ws.security.WSPasswordCallback;
+import org.jboss.wsf.stack.cxf.extensions.security.PasswordCallbackHandler;
+import java.util.HashMap;
+import java.util.Map;
-import javax.security.auth.callback.Callback;
-import javax.security.auth.callback.CallbackHandler;
-import javax.security.auth.callback.UnsupportedCallbackException;
-import java.io.IOException;
-
/**
* User: rsearls(a)redhat.com
* Date: 1/26/14
*/
-public class ActAsCallbackHandler implements CallbackHandler {
+public class ActAsCallbackHandler extends PasswordCallbackHandler {
- public void handle(Callback[] callbacks) throws IOException,
- UnsupportedCallbackException {
- for (int i = 0; i < callbacks.length; i++) {
- if (callbacks[i] instanceof WSPasswordCallback) {
- WSPasswordCallback pc = (WSPasswordCallback) callbacks[i];
- if ("myclientkey".equals(pc.getIdentifier())) {
- pc.setPassword("ckpass");
- break;
- } else if ("alice".equals(pc.getIdentifier())) {
- pc.setPassword("clarinet");
- break;
- } else if ("bob".equals(pc.getIdentifier())) {
- pc.setPassword("trombone");
- break;
- } else if ("eve".equals(pc.getIdentifier())) {
- pc.setPassword("evekpass");
- break;
- }
- }
- }
- }
+ public ActAsCallbackHandler()
+ {
+ super(getInitMap());
+ }
+
+ private static Map<String, String> getInitMap()
+ {
+ Map<String, String> passwords = new HashMap<String, String>();
+ passwords.put("myactaskey", "aspass");
+ passwords.put("alice", "aspass");
+ return passwords;
+ }
+
}
Modified: stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/trust/ActAsServiceImpl.java
===================================================================
--- stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/trust/ActAsServiceImpl.java 2014-01-28 20:05:05 UTC (rev 18285)
+++ stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/trust/ActAsServiceImpl.java 2014-01-28 21:25:10 UTC (rev 18286)
@@ -40,14 +40,14 @@
targetNamespace = "http://www.jboss.org/jbossws/ws-extensions/actaswssecuritypolicy",
endpointInterface = "org.jboss.test.ws.jaxws.samples.wsse.policy.trust.ActAsServiceIface"
)
-//TODO: fix endpointProperties
+
@EndpointProperties(value = {
- @EndpointProperty(key = "ws-security.signature.username", value = "myservicekey"),
- @EndpointProperty(key = "ws-security.signature.properties", value = "serviceKeystore.properties"),
- @EndpointProperty(key = "ws-security.encryption.properties", value = "serviceKeystore.properties"),
+ @EndpointProperty(key = "ws-security.signature.username", value = "myactaskey"),
+ @EndpointProperty(key = "ws-security.signature.properties", value = "actasKeystore.properties"),
+ @EndpointProperty(key = "ws-security.encryption.properties", value = "actasKeystore.properties"),
@EndpointProperty(key = "ws-security.callback-handler", value = "org.jboss.test.ws.jaxws.samples.wsse.policy.trust.ActAsCallbackHandler")
})
-@InInterceptors(interceptors = {"org.jboss.test.ws.jaxws.samples.wsse.policy.trust.ActAsOutInterceptor"})
+//---@InInterceptors(interceptors = {"org.jboss.test.ws.jaxws.samples.wsse.policy.trust.ActAsOutInterceptor"})
public class ActAsServiceImpl implements ActAsServiceIface
{
public String sayHello()
Modified: stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/trust/ClientCallbackHandler.java
===================================================================
--- stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/trust/ClientCallbackHandler.java 2014-01-28 20:05:05 UTC (rev 18285)
+++ stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/trust/ClientCallbackHandler.java 2014-01-28 21:25:10 UTC (rev 18286)
@@ -40,9 +40,6 @@
} else if ("bob".equals(pc.getIdentifier())) {
pc.setPassword("trombone");
break;
- } else if ("eve".equals(pc.getIdentifier())) {
- pc.setPassword("evekpass");
- break;
}
}
}
Modified: stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/trust/SampleSTS.java
===================================================================
--- stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/trust/SampleSTS.java 2014-01-28 20:05:05 UTC (rev 18285)
+++ stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/trust/SampleSTS.java 2014-01-28 21:25:10 UTC (rev 18286)
@@ -65,9 +65,14 @@
List<ServiceMBean> services = new LinkedList<ServiceMBean>();
StaticService service = new StaticService();
- service.setEndpoints(Arrays.asList("http://localhost:(\\d)*/jaxws-samples-wsse-policy-trust/SecurityService",
- "http://\\[::1\\]:(\\d)*/jaxws-samples-wsse-policy-trust/SecurityService",
- "http://\\[0:0:0:0:0:0:0:1\\]:(\\d)*/jaxws-samples-wsse-policy-trust/SecurityService"));
+ service.setEndpoints(Arrays.asList(
+ "http://localhost:(\\d)*/jaxws-samples-wsse-policy-trust/SecurityService",
+ "http://\\[::1\\]:(\\d)*/jaxws-samples-wsse-policy-trust/SecurityService",
+ "http://\\[0:0:0:0:0:0:0:1\\]:(\\d)*/jaxws-samples-wsse-policy-trust/SecurityService",
+ "http://localhost:(\\d)*/jaxws-samples-wsse-policy-trust-actas/ActAsService",
+ "http://\\[::1\\]:(\\d)*/jaxws-samples-wsse-policy-trust-actas/ActAsService",
+ "http://\\[0:0:0:0:0:0:0:1\\]:(\\d)*/jaxws-samples-wsse-policy-trust-actas/ActAsService"
+ ));
services.add(service);
TokenIssueOperation issueOperation = new TokenIssueOperation();
Modified: stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/trust/WSTrustActAsTestCase.java
===================================================================
--- stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/trust/WSTrustActAsTestCase.java 2014-01-28 20:05:05 UTC (rev 18285)
+++ stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/trust/WSTrustActAsTestCase.java 2014-01-28 21:25:10 UTC (rev 18286)
@@ -24,9 +24,11 @@
import junit.framework.Test;
import org.apache.cxf.Bus;
import org.apache.cxf.BusFactory;
+import org.jboss.wsf.test.CryptoHelper;
import org.jboss.wsf.test.JBossWSTest;
import javax.xml.namespace.QName;
+import javax.xml.ws.BindingProvider;
import javax.xml.ws.Service;
import java.net.URL;
@@ -38,7 +40,7 @@
*/
public class WSTrustActAsTestCase extends JBossWSTest
{
- private final String serviceURL = "http://" + getServerHost() + ":8080/jaxws-samples-wsse-policy-trust/SecurityService";
+ private final String serviceURL = "http://" + getServerHost() + ":8080/jaxws-samples-wsse-policy-trust-actas/ActAsService";
private final String stsURL = "http://" + getServerHost() + ":8080/jaxws-samples-wsse-policy-trust-sts/SecurityTokenService";
public static Test suite()
@@ -60,16 +62,19 @@
{
BusFactory.setThreadDefaultBus(bus);
- final QName serviceName = new QName("http://www.jboss.org/jbossws/ws-extensions/wssecuritypolicy", "SecurityService");
+ final QName serviceName = new QName("http://www.jboss.org/jbossws/ws-extensions/actaswssecuritypolicy", "ActAsService");
final URL wsdlURL = new URL(serviceURL + "?wsdl");
Service service = Service.create(wsdlURL, serviceName);
- ServiceIface proxy = (ServiceIface) service.getPort(ServiceIface.class);
+ ActAsServiceIface proxy = (ActAsServiceIface) service.getPort(ActAsServiceIface.class);
+ /* TODO explain why this is not needed for setup and then remove
final QName stsServiceName = new QName("http://docs.oasis-open.org/ws-sx/ws-trust/200512/", "SecurityTokenService");
final QName stsPortName = new QName("http://docs.oasis-open.org/ws-sx/ws-trust/200512/", "UT_Port");
- WSTrustTestUtils.setupWsseAndSTSClientActAs(proxy, bus, stsURL + "?wsdl", stsServiceName, stsPortName);
+ */
+ WSTrustTestUtils.setupWsseAndSTSClientActAs((BindingProvider) proxy, bus);
- assertEquals("WS-Trust Hello World!", proxy.sayHello());
+ assertEquals("ActAs WS-Trust Hello World!", proxy.sayHello());
+
}
finally
{
Modified: stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/trust/WSTrustTestUtils.java
===================================================================
--- stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/trust/WSTrustTestUtils.java 2014-01-28 20:05:05 UTC (rev 18285)
+++ stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/trust/WSTrustTestUtils.java 2014-01-28 21:25:10 UTC (rev 18286)
@@ -132,17 +132,14 @@
*
* @param proxy
* @param bus
- * @param stsWsdlLocation
- * @param stsService
- * @param stsPort
*/
- public static void setupWsseAndSTSClientActAs(ServiceIface proxy, Bus bus, String stsWsdlLocation, QName stsService, QName stsPort) {
- Map<String, Object> ctx = ((BindingProvider) proxy).getRequestContext();
+ public static void setupWsseAndSTSClientActAs(BindingProvider proxy, Bus bus) {
+ Map<String, Object> ctx = proxy.getRequestContext();
+
ctx.put(SecurityConstants.CALLBACK_HANDLER, new ClientCallbackHandler());
ctx.put(SecurityConstants.ENCRYPT_PROPERTIES, Thread.currentThread().getContextClassLoader().getResource("META-INF/clientKeystore.properties"));
- ctx.put(SecurityConstants.ENCRYPT_USERNAME, "myservicekey");
- // the 2 following are required here.
+ ctx.put(SecurityConstants.ENCRYPT_USERNAME, "myactaskey");
ctx.put(SecurityConstants.SIGNATURE_PROPERTIES, Thread.currentThread().getContextClassLoader().getResource("META-INF/clientKeystore.properties"));
ctx.put(SecurityConstants.SIGNATURE_USERNAME, "myclientkey");
@@ -150,10 +147,8 @@
Map<String, Object> props = stsClient.getProperties();
props.put(SecurityConstants.USERNAME, "alice");
props.put(SecurityConstants.CALLBACK_HANDLER, new ClientCallbackHandler());
-
props.put(SecurityConstants.ENCRYPT_PROPERTIES, Thread.currentThread().getContextClassLoader().getResource("META-INF/clientKeystore.properties"));
props.put(SecurityConstants.ENCRYPT_USERNAME, "mystskey");
-
props.put(SecurityConstants.STS_TOKEN_USERNAME, "myclientkey");
props.put(SecurityConstants.STS_TOKEN_PROPERTIES, Thread.currentThread().getContextClassLoader().getResource("META-INF/clientKeystore.properties"));
props.put(SecurityConstants.STS_TOKEN_USE_CERT_FOR_KEYINFO, "true");
Modified: stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/resources/jaxws/samples/wsse/policy/trust/META-INF/clientstore.jks
===================================================================
(Binary files differ)
Modified: stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/resources/jaxws/samples/wsse/policy/trust/WEB-INF/actasKeystore.properties
===================================================================
--- stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/resources/jaxws/samples/wsse/policy/trust/WEB-INF/actasKeystore.properties 2014-01-28 20:05:05 UTC (rev 18285)
+++ stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/resources/jaxws/samples/wsse/policy/trust/WEB-INF/actasKeystore.properties 2014-01-28 21:25:10 UTC (rev 18286)
@@ -0,0 +1,23 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+org.apache.ws.security.crypto.provider=org.apache.ws.security.components.crypto.Merlin
+org.apache.ws.security.crypto.merlin.keystore.type=jks
+org.apache.ws.security.crypto.merlin.keystore.password=aapass
+org.apache.ws.security.crypto.merlin.keystore.alias=myactaskey
+org.apache.ws.security.crypto.merlin.keystore.file=actasstore.jks
Modified: stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/resources/jaxws/samples/wsse/policy/trust/WEB-INF/actasstore.jks
===================================================================
--- stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/resources/jaxws/samples/wsse/policy/trust/WEB-INF/actasstore.jks 2014-01-28 20:05:05 UTC (rev 18285)
+++ stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/resources/jaxws/samples/wsse/policy/trust/WEB-INF/actasstore.jks 2014-01-28 21:25:10 UTC (rev 18286)
@@ -0,0 +1,49 @@
+����
+myactaskey
++*
+Y�*���Lɧ^طf��$�}r��?�/��DE�ʒ�3C��@f�C�;����]<'B2g9Q'X:�8v.LbT{o�9
+.Sample ActAs Web Service -- NOT FOR PRODUCTION10U
+IT Department10U
+www.actas.com0
+140127183414Z
+231206183414Z0��10 UUS1
+0UOhio10
+UDayton1705U
+.Sample ActAs Web Service -- NOT FOR PRODUCTION10U
+IT Department10U
+www.actas.com0�"0
+ *�H��
+
+�
+�̑�����G/�R�������v;+7���9��3-�7
+¦
+��M��i�&��#���I�iꝟ��}�\����;��~MO��R��k{�@[��r6��m�}�kd
+\����:�>���a�f3a\��ہ[�?Ab�� ��8����e��9����_
+ Sample STS -- NOT FOR PRODUCTION10U
+IT Department10Uwww.sts.com10 *�H��
+ sts(a)sts.com0
+110209183813Z
+210206183813Z0��10 UUS10UMaryland10U Baltimore1)0'U
+ Sample STS -- NOT FOR PRODUCTION10U
+IT Department10Uwww.sts.com10 *�H��
+ sts@sts.com0��0
+ *�H��
+
+ Sample STS -- NOT FOR PRODUCTION10U
+IT Department10Uwww.sts.com10 *�H��
+ sts@sts.com�
+���k�㕱:��z�}Rd�g�k�q���o�X�m���m�Avls�\Y��3
\ No newline at end of file
Modified: stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/resources/jaxws/samples/wsse/policy/trust/WEB-INF/wsdl/ActAsService.wsdl
===================================================================
--- stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/resources/jaxws/samples/wsse/policy/trust/WEB-INF/wsdl/ActAsService.wsdl 2014-01-28 20:05:05 UTC (rev 18285)
+++ stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/resources/jaxws/samples/wsse/policy/trust/WEB-INF/wsdl/ActAsService.wsdl 2014-01-28 21:25:10 UTC (rev 18286)
@@ -12,7 +12,8 @@
xmlns:t="http://docs.oasis-open.org/ws-sx/ws-trust/200512">
<types>
<xsd:schema>
- <xsd:import namespace="http://www.jboss.org/jbossws/ws-extensions/actaswssecuritypolicy" schemaLocation="ActAsService_schema1.xsd"/>
+ <xsd:import namespace="http://www.jboss.org/jbossws/ws-extensions/actaswssecuritypolicy"
+ schemaLocation="ActAsService_schema1.xsd"/>
</xsd:schema>
</types>
<message name="sayHello">
@@ -44,7 +45,7 @@
</binding>
<service name="ActAsService">
<port name="ActAsServicePort" binding="tns:ActAsServicePortBinding">
- <soap:address location="http://@jboss.bind.address@:8080/jaxws-samples-wsse-policy-trust/ActAsService"/>
+ <soap:address location="http://@jboss.bind.address@:8080/jaxws-samples-wsse-policy-trust-actas/ActAsService"/>
</port>
</service>
10 years, 11 months
JBossWS SVN: r18285 - in stack/cxf/trunk/modules: server/src/main/java/org/jboss/wsf/stack/cxf/deployment/aspect and 2 other directories.
by jbossws-commits@lists.jboss.org
Author: asoldano
Date: 2014-01-28 15:05:05 -0500 (Tue, 28 Jan 2014)
New Revision: 18285
Modified:
stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/configuration/BusHolder.java
stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/configuration/NonSpringBusHolder.java
stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/configuration/SpringBusHolder.java
stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/deployment/aspect/BusDeploymentAspect.java
stack/cxf/trunk/modules/server/src/test/java/org/jboss/wsf/stack/cxf/configuration/BusHolderTest.java
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/jbws3098/BusHolderLifeCycleTestCase.java
Log:
[JBWS-3737] Do not try building PolicyAttachmentStore when there's no @PolicySets annotated class in the deployment
Modified: stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/configuration/BusHolder.java
===================================================================
--- stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/configuration/BusHolder.java 2014-01-28 19:58:30 UTC (rev 18284)
+++ stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/configuration/BusHolder.java 2014-01-28 20:05:05 UTC (rev 18285)
@@ -48,7 +48,10 @@
import org.apache.cxf.ws.policy.AlternativeSelector;
import org.apache.cxf.ws.policy.PolicyEngine;
import org.apache.cxf.ws.policy.selector.MaximalAlternativeSelector;
+import org.jboss.ws.api.annotation.PolicySets;
import org.jboss.ws.api.binding.BindingCustomization;
+import org.jboss.wsf.spi.deployment.AnnotationsInfo;
+import org.jboss.wsf.spi.deployment.Deployment;
import org.jboss.wsf.spi.deployment.Endpoint;
import org.jboss.wsf.spi.deployment.UnifiedVirtualFile;
import org.jboss.wsf.spi.metadata.webservices.JBossWebservicesMetaData;
@@ -95,9 +98,9 @@
* @param resolver The ResourceResolver to configure, if any
* @param configurer The JBossWSCXFConfigurer to install in the bus, if any
* @param wsmd The current JBossWebservicesMetaData, if any
- * @param depRuntimeClassLoader The current deployment classloader
+ * @param dep The current deployment
*/
- public void configure(ResourceResolver resolver, Configurer configurer, JBossWebservicesMetaData wsmd, ClassLoader depRuntimeClassLoader)
+ public void configure(ResourceResolver resolver, Configurer configurer, JBossWebservicesMetaData wsmd, Deployment dep)
{
bus.setProperty(org.jboss.wsf.stack.cxf.client.Constants.DEPLOYMENT_BUS, true);
busHolderListener = new BusHolderLifeCycleListener();
@@ -124,8 +127,11 @@
setAdditionalWorkQueues(bus, props);
setWSDiscovery(bus, props);
- policySetsListener = new PolicySetsAnnotationListener(depRuntimeClassLoader);
- bus.getExtension(FactoryBeanListenerManager.class).addListener(policySetsListener);
+ AnnotationsInfo ai = dep.getAttachment(AnnotationsInfo.class);
+ if (ai == null || ai.hasAnnotatedClasses(PolicySets.class.getName())) {
+ policySetsListener = new PolicySetsAnnotationListener(dep.getRuntimeClassLoader());
+ bus.getExtension(FactoryBeanListenerManager.class).addListener(policySetsListener);
+ }
}
Modified: stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/configuration/NonSpringBusHolder.java
===================================================================
--- stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/configuration/NonSpringBusHolder.java 2014-01-28 19:58:30 UTC (rev 18284)
+++ stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/configuration/NonSpringBusHolder.java 2014-01-28 20:05:05 UTC (rev 18285)
@@ -37,6 +37,7 @@
import org.apache.cxf.ws.addressing.WSAddressingFeature;
import org.apache.cxf.ws.rm.RMManager;
import org.jboss.ws.api.binding.BindingCustomization;
+import org.jboss.wsf.spi.deployment.Deployment;
import org.jboss.wsf.spi.deployment.Endpoint;
import org.jboss.wsf.spi.deployment.UnifiedVirtualFile;
import org.jboss.wsf.spi.metadata.webservices.JBossWebservicesMetaData;
@@ -79,16 +80,16 @@
* @param resolver The ResourceResolver to configure, if any
* @param configurer The JBossWSCXFConfigurer to install in the bus, if any
* @param wsmd The current JBossWebservicesMetaData, if any
- * @param depRuntimeClassLoader The current deployment classloader
+ * @param dep The current deployment
*/
@Override
- public void configure(ResourceResolver resolver, Configurer configurer, JBossWebservicesMetaData wsmd, ClassLoader depRuntimeClassLoader)
+ public void configure(ResourceResolver resolver, Configurer configurer, JBossWebservicesMetaData wsmd, Deployment dep)
{
if (configured)
{
throw Messages.MESSAGES.busAlreadyConfigured(bus);
}
- super.configure(resolver, configurer, wsmd, depRuntimeClassLoader);
+ super.configure(resolver, configurer, wsmd, dep);
for (DDEndpoint dde : metadata.getEndpoints())
{
Modified: stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/configuration/SpringBusHolder.java
===================================================================
--- stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/configuration/SpringBusHolder.java 2014-01-28 19:58:30 UTC (rev 18284)
+++ stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/configuration/SpringBusHolder.java 2014-01-28 20:05:05 UTC (rev 18285)
@@ -39,6 +39,7 @@
import org.apache.cxf.transport.http.HttpDestinationFactory;
import org.apache.cxf.transport.servlet.ServletDestinationFactory;
import org.jboss.ws.api.binding.BindingCustomization;
+import org.jboss.wsf.spi.deployment.Deployment;
import org.jboss.wsf.spi.deployment.Endpoint;
import org.jboss.wsf.spi.deployment.UnifiedVirtualFile;
import org.jboss.wsf.spi.metadata.webservices.JBossWebservicesMetaData;
@@ -121,16 +122,16 @@
* @param configurer The JBossWSCXFConfigurer to install in the bus, if any
* @param dep The current JBossWS-SPI Deployment
* @param wsmd The current JBossWebservicesMetaData, if any
- * @param depRuntimeClassLoader The current deployment classloader
+ * @param dep The current deployment
*/
@Override
- public void configure(ResourceResolver resolver, Configurer configurer, JBossWebservicesMetaData wsmd, ClassLoader depRuntimeClassLoader)
+ public void configure(ResourceResolver resolver, Configurer configurer, JBossWebservicesMetaData wsmd, Deployment dep)
{
if (configured)
{
throw MESSAGES.busAlreadyConfigured(ctx);
}
- super.configure(resolver, configurer, wsmd, depRuntimeClassLoader);
+ super.configure(resolver, configurer, wsmd, dep);
GenericApplicationContext jbosswsCxfContext = null;
//load stuff from provided jbossws-cxf.xml DD
Modified: stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/deployment/aspect/BusDeploymentAspect.java
===================================================================
--- stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/deployment/aspect/BusDeploymentAspect.java 2014-01-28 19:58:30 UTC (rev 18284)
+++ stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/deployment/aspect/BusDeploymentAspect.java 2014-01-28 20:05:05 UTC (rev 18285)
@@ -132,7 +132,7 @@
Configurer configurer = holder.createServerConfigurer(dep.getAttachment(BindingCustomization.class),
new WSDLFilePublisher(aDep), dep.getService().getEndpoints(), aDep.getRootFile(), epConfigName, epConfigFile);
- holder.configure(resolver, configurer, wsmd, dep.getRuntimeClassLoader());
+ holder.configure(resolver, configurer, wsmd, dep);
dep.addAttachment(BusHolder.class, holder);
}
finally
Modified: stack/cxf/trunk/modules/server/src/test/java/org/jboss/wsf/stack/cxf/configuration/BusHolderTest.java
===================================================================
--- stack/cxf/trunk/modules/server/src/test/java/org/jboss/wsf/stack/cxf/configuration/BusHolderTest.java 2014-01-28 19:58:30 UTC (rev 18284)
+++ stack/cxf/trunk/modules/server/src/test/java/org/jboss/wsf/stack/cxf/configuration/BusHolderTest.java 2014-01-28 20:05:05 UTC (rev 18285)
@@ -29,6 +29,7 @@
import org.apache.cxf.ws.policy.PolicyEngine;
import org.apache.cxf.ws.policy.selector.FirstAlternativeSelector;
import org.apache.cxf.ws.policy.selector.MaximalAlternativeSelector;
+import org.jboss.ws.common.deployment.DefaultDeploymentModelFactory;
import org.jboss.wsf.spi.metadata.webservices.JBossWebservicesMetaData;
import org.jboss.wsf.stack.cxf.client.Constants;
import org.jboss.wsf.stack.cxf.metadata.services.DDBeans;
@@ -68,7 +69,7 @@
}
BusHolder holder = new NonSpringBusHolder(new DDBeans());
try {
- holder.configure(null, null, wsmd, null);
+ holder.configure(null, null, wsmd, new DefaultDeploymentModelFactory().newDeployment("testDeployment", null));
return holder.getBus().getExtension(PolicyEngine.class).getAlternativeSelector().getClass().getName();
} finally {
holder.close();
Modified: stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/jbws3098/BusHolderLifeCycleTestCase.java
===================================================================
--- stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/jbws3098/BusHolderLifeCycleTestCase.java 2014-01-28 19:58:30 UTC (rev 18284)
+++ stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/jbws3098/BusHolderLifeCycleTestCase.java 2014-01-28 20:05:05 UTC (rev 18285)
@@ -26,6 +26,7 @@
import org.apache.cxf.Bus;
import org.apache.cxf.buslifecycle.BusLifeCycleListener;
import org.apache.cxf.buslifecycle.BusLifeCycleManager;
+import org.jboss.ws.common.deployment.DefaultDeploymentModelFactory;
import org.jboss.wsf.stack.cxf.client.util.SpringUtils;
import org.jboss.wsf.stack.cxf.configuration.BusHolder;
import org.jboss.wsf.stack.cxf.configuration.NonSpringBusHolder;
@@ -63,7 +64,7 @@
Bus bus = holder.getBus();
TestLifeCycleListener listener = new TestLifeCycleListener();
bus.getExtension(BusLifeCycleManager.class).registerLifeCycleListener(listener);
- holder.configure(null, null, null, null);
+ holder.configure(null, null, null, new DefaultDeploymentModelFactory().newDeployment("testDeployment", null));
holder.close();
assertEquals("preShutdown method on listener should be called exactly once; number of actual calls: "
+ listener.getCount(), 1, listener.getCount());
@@ -74,7 +75,7 @@
Bus bus = holder.getBus();
TestLifeCycleListener listener = new TestLifeCycleListener();
bus.getExtension(BusLifeCycleManager.class).registerLifeCycleListener(listener);
- holder.configure(null, null, null, null);
+ holder.configure(null, null, null, new DefaultDeploymentModelFactory().newDeployment("testDeployment", null));
bus.shutdown(true);
holder.close();
assertEquals("preShutdown method on listener should be called exactly once; number of actual calls: "
@@ -86,7 +87,7 @@
Bus bus = holder.getBus();
TestLifeCycleListener listener = new TestLifeCycleListener();
bus.getExtension(BusLifeCycleManager.class).registerLifeCycleListener(listener);
- holder.configure(null, null, null, null);
+ holder.configure(null, null, null, new DefaultDeploymentModelFactory().newDeployment("testDeployment", null));
assertEquals("preShutdown method on listener shouldn't be called before holder is closed: number of actual calls: "
+ listener.getCount(), 0, listener.getCount());
holder.close();
10 years, 11 months
JBossWS SVN: r18284 - in container/jboss72/branches/jbossws-jboss720/server-integration/src/main/java/org/jboss/as/webservices: injection and 1 other directories.
by jbossws-commits@lists.jboss.org
Author: asoldano
Date: 2014-01-28 14:58:30 -0500 (Tue, 28 Jan 2014)
New Revision: 18284
Added:
container/jboss72/branches/jbossws-jboss720/server-integration/src/main/java/org/jboss/as/webservices/deployers/deployment/JandexAnnotationsInfo.java
Modified:
container/jboss72/branches/jbossws-jboss720/server-integration/src/main/java/org/jboss/as/webservices/deployers/deployment/AbstractDeploymentModelBuilder.java
container/jboss72/branches/jbossws-jboss720/server-integration/src/main/java/org/jboss/as/webservices/injection/WSHandlerChainAnnotationProcessor.java
container/jboss72/branches/jbossws-jboss720/server-integration/src/main/java/org/jboss/as/webservices/util/ASHelper.java
Log:
[JBWS-3737] Add an instance of AnnotationsInfo into deployment
Modified: container/jboss72/branches/jbossws-jboss720/server-integration/src/main/java/org/jboss/as/webservices/deployers/deployment/AbstractDeploymentModelBuilder.java
===================================================================
--- container/jboss72/branches/jbossws-jboss720/server-integration/src/main/java/org/jboss/as/webservices/deployers/deployment/AbstractDeploymentModelBuilder.java 2014-01-28 19:57:42 UTC (rev 18283)
+++ container/jboss72/branches/jbossws-jboss720/server-integration/src/main/java/org/jboss/as/webservices/deployers/deployment/AbstractDeploymentModelBuilder.java 2014-01-28 19:58:30 UTC (rev 18284)
@@ -46,6 +46,7 @@
import org.jboss.ws.common.ResourceLoaderAdapter;
import org.jboss.wsf.spi.SPIProvider;
import org.jboss.wsf.spi.SPIProviderResolver;
+import org.jboss.wsf.spi.deployment.AnnotationsInfo;
import org.jboss.wsf.spi.deployment.ArchiveDeployment;
import org.jboss.wsf.spi.deployment.Deployment;
import org.jboss.wsf.spi.deployment.DeploymentModelFactory;
@@ -214,6 +215,8 @@
}
dep.setRuntimeClassLoader(classLoader);
dep.setType(deploymentType);
+ //add an AnnotationInfo attachment that uses composite jandex index
+ dep.addAttachment(AnnotationsInfo.class, new JandexAnnotationsInfo(unit));
return dep;
}
Added: container/jboss72/branches/jbossws-jboss720/server-integration/src/main/java/org/jboss/as/webservices/deployers/deployment/JandexAnnotationsInfo.java
===================================================================
--- container/jboss72/branches/jbossws-jboss720/server-integration/src/main/java/org/jboss/as/webservices/deployers/deployment/JandexAnnotationsInfo.java (rev 0)
+++ container/jboss72/branches/jbossws-jboss720/server-integration/src/main/java/org/jboss/as/webservices/deployers/deployment/JandexAnnotationsInfo.java 2014-01-28 19:58:30 UTC (rev 18284)
@@ -0,0 +1,70 @@
+/*
+ * 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.as.webservices.deployers.deployment;
+
+import static org.jboss.as.server.deployment.Attachments.ANNOTATION_INDEX;
+
+import java.util.List;
+
+import org.jboss.as.server.deployment.DeploymentUnit;
+import org.jboss.as.server.deployment.module.ResourceRoot;
+import org.jboss.as.webservices.util.ASHelper;
+import org.jboss.jandex.AnnotationInstance;
+import org.jboss.jandex.DotName;
+import org.jboss.jandex.Index;
+import org.jboss.wsf.spi.deployment.AnnotationsInfo;
+
+/**
+ * A Jandex based implementation of org.jboss.wsf.spi.deployment.AnnotationsInfo
+ *
+ * @author <a href="mailto:alessio.soldano@jboss.com">Alessio Soldano</a>
+ */
+public final class JandexAnnotationsInfo implements AnnotationsInfo {
+
+ private final List<ResourceRoot> resourceRoots;
+
+ public JandexAnnotationsInfo(DeploymentUnit unit) {
+ resourceRoots = ASHelper.getResourceRoots(unit);
+ }
+
+ @Override
+ public boolean hasAnnotatedClasses(String... annotation) {
+ if (annotation == null) {
+ throw new IllegalArgumentException();
+ }
+ if (resourceRoots != null) {
+ Index index = null;
+ for (ResourceRoot resourceRoot : resourceRoots) {
+ index = resourceRoot.getAttachment(ANNOTATION_INDEX);
+ if (index != null) {
+ for (String ann : annotation) {
+ List<AnnotationInstance> list = index.getAnnotations(DotName.createSimple(ann));
+ if (list != null && !list.isEmpty()) {
+ return true;
+ }
+ }
+ }
+ }
+ }
+ return false;
+ }
+}
Property changes on: container/jboss72/branches/jbossws-jboss720/server-integration/src/main/java/org/jboss/as/webservices/deployers/deployment/JandexAnnotationsInfo.java
___________________________________________________________________
Added: svn:keywords
+ Rev Date
Added: svn:eol-style
+ native
Modified: container/jboss72/branches/jbossws-jboss720/server-integration/src/main/java/org/jboss/as/webservices/injection/WSHandlerChainAnnotationProcessor.java
===================================================================
--- container/jboss72/branches/jbossws-jboss720/server-integration/src/main/java/org/jboss/as/webservices/injection/WSHandlerChainAnnotationProcessor.java 2014-01-28 19:57:42 UTC (rev 18283)
+++ container/jboss72/branches/jbossws-jboss720/server-integration/src/main/java/org/jboss/as/webservices/injection/WSHandlerChainAnnotationProcessor.java 2014-01-28 19:58:30 UTC (rev 18284)
@@ -23,8 +23,6 @@
package org.jboss.as.webservices.injection;
import static org.jboss.as.server.deployment.Attachments.ANNOTATION_INDEX;
-import static org.jboss.as.server.deployment.Attachments.DEPLOYMENT_ROOT;
-import static org.jboss.as.server.deployment.Attachments.RESOURCE_ROOTS;
import static org.jboss.as.webservices.WSMessages.MESSAGES;
import static org.jboss.as.webservices.util.ASHelper.isJaxwsService;
import static org.jboss.as.webservices.util.DotNames.HANDLER_CHAIN_ANNOTATION;
@@ -44,13 +42,12 @@
import org.jboss.as.ee.structure.DeploymentType;
import org.jboss.as.ee.structure.DeploymentTypeMarker;
-import org.jboss.as.server.deployment.AttachmentList;
import org.jboss.as.server.deployment.DeploymentPhaseContext;
import org.jboss.as.server.deployment.DeploymentUnit;
import org.jboss.as.server.deployment.DeploymentUnitProcessingException;
import org.jboss.as.server.deployment.DeploymentUnitProcessor;
-import org.jboss.as.server.deployment.EjbDeploymentMarker;
import org.jboss.as.server.deployment.module.ResourceRoot;
+import org.jboss.as.webservices.util.ASHelper;
import org.jboss.jandex.AnnotationInstance;
import org.jboss.jandex.AnnotationTarget;
import org.jboss.jandex.ClassInfo;
@@ -72,14 +69,7 @@
if (DeploymentTypeMarker.isType(DeploymentType.EAR, unit)) {
return;
}
- // wars define resource roots
- AttachmentList<ResourceRoot> resourceRoots = unit.getAttachment(RESOURCE_ROOTS);
- if (!unit.getName().endsWith(".war") && EjbDeploymentMarker.isEjbDeployment(unit)) {
- // ejb archives don't define resource roots, using root resource
- resourceRoots = new AttachmentList<ResourceRoot>(ResourceRoot.class);
- final ResourceRoot root = unit.getAttachment(DEPLOYMENT_ROOT);
- resourceRoots.add(root);
- }
+ List<ResourceRoot> resourceRoots = ASHelper.getResourceRoots(unit);
if (resourceRoots == null) {
return;
}
Modified: container/jboss72/branches/jbossws-jboss720/server-integration/src/main/java/org/jboss/as/webservices/util/ASHelper.java
===================================================================
--- container/jboss72/branches/jbossws-jboss720/server-integration/src/main/java/org/jboss/as/webservices/util/ASHelper.java 2014-01-28 19:57:42 UTC (rev 18283)
+++ container/jboss72/branches/jbossws-jboss720/server-integration/src/main/java/org/jboss/as/webservices/util/ASHelper.java 2014-01-28 19:58:30 UTC (rev 18284)
@@ -21,6 +21,8 @@
*/
package org.jboss.as.webservices.util;
+import static org.jboss.as.server.deployment.Attachments.DEPLOYMENT_ROOT;
+import static org.jboss.as.server.deployment.Attachments.RESOURCE_ROOTS;
import static org.jboss.as.webservices.util.DotNames.JAXWS_SERVICE_CLASS;
import static org.jboss.as.webservices.util.WSAttachmentKeys.JAXRPC_ENDPOINTS_KEY;
import static org.jboss.as.webservices.util.WSAttachmentKeys.JAXWS_ENDPOINTS_KEY;
@@ -30,9 +32,12 @@
import org.jboss.as.controller.OperationContext;
import org.jboss.as.server.deployment.AttachmentKey;
+import org.jboss.as.server.deployment.AttachmentList;
import org.jboss.as.server.deployment.Attachments;
import org.jboss.as.server.deployment.DeploymentUnit;
+import org.jboss.as.server.deployment.EjbDeploymentMarker;
import org.jboss.as.server.deployment.annotation.CompositeIndex;
+import org.jboss.as.server.deployment.module.ResourceRoot;
import org.jboss.as.web.deployment.WarMetaData;
import org.jboss.as.webservices.metadata.model.EJBEndpoint;
import org.jboss.as.webservices.metadata.model.JAXRPCDeployment;
@@ -299,4 +304,15 @@
return service != null ? service.getValue() : null;
}
+ public static List<ResourceRoot> getResourceRoots(DeploymentUnit unit) {
+ // wars define resource roots
+ AttachmentList<ResourceRoot> resourceRoots = unit.getAttachment(RESOURCE_ROOTS);
+ if (!unit.getName().endsWith(".war") && EjbDeploymentMarker.isEjbDeployment(unit)) {
+ // ejb archives don't define resource roots, using root resource
+ resourceRoots = new AttachmentList<ResourceRoot>(ResourceRoot.class);
+ final ResourceRoot root = unit.getAttachment(DEPLOYMENT_ROOT);
+ resourceRoots.add(root);
+ }
+ return resourceRoots;
+ }
}
10 years, 11 months
JBossWS SVN: r18283 - spi/trunk/src/main/java/org/jboss/wsf/spi/deployment.
by jbossws-commits@lists.jboss.org
Author: asoldano
Date: 2014-01-28 14:57:42 -0500 (Tue, 28 Jan 2014)
New Revision: 18283
Added:
spi/trunk/src/main/java/org/jboss/wsf/spi/deployment/AnnotationsInfo.java
Log:
[JBWS-3737] Adding interface for annotation info retrieval
Added: spi/trunk/src/main/java/org/jboss/wsf/spi/deployment/AnnotationsInfo.java
===================================================================
--- spi/trunk/src/main/java/org/jboss/wsf/spi/deployment/AnnotationsInfo.java (rev 0)
+++ spi/trunk/src/main/java/org/jboss/wsf/spi/deployment/AnnotationsInfo.java 2014-01-28 19:57:42 UTC (rev 18283)
@@ -0,0 +1,39 @@
+/*
+ * 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.wsf.spi.deployment;
+
+/**
+ * Utility for providing informations on annotations specified in a deployment.
+ * This basically decouples the WS stack from the Jandex project.
+ *
+ * @author alessio.soldano(a)jboss.com
+ */
+public interface AnnotationsInfo
+{
+ /**
+ * tells if the deployment includes classes annotated with the specified annotation(s).
+ *
+ * @param annotation The FQN of the annotation
+ * @return true if classes annotated with the specified annotation are found in the deployment, false otherwise.
+ */
+ boolean hasAnnotatedClasses(String... annotation);
+}
Property changes on: spi/trunk/src/main/java/org/jboss/wsf/spi/deployment/AnnotationsInfo.java
___________________________________________________________________
Added: svn:keywords
+ Rev Date
Added: svn:eol-style
+ native
10 years, 11 months
JBossWS SVN: r18282 - container/jboss72/branches/jbossws-jboss720/server-integration/src/main/java/org/jboss/as/webservices/invocation.
by jbossws-commits@lists.jboss.org
Author: asoldano
Date: 2014-01-28 13:37:09 -0500 (Tue, 28 Jan 2014)
New Revision: 18282
Modified:
container/jboss72/branches/jbossws-jboss720/server-integration/src/main/java/org/jboss/as/webservices/invocation/AbstractInvocationHandler.java
Log:
[JBWS-3670] Check component type before casting
Modified: container/jboss72/branches/jbossws-jboss720/server-integration/src/main/java/org/jboss/as/webservices/invocation/AbstractInvocationHandler.java
===================================================================
--- container/jboss72/branches/jbossws-jboss720/server-integration/src/main/java/org/jboss/as/webservices/invocation/AbstractInvocationHandler.java 2014-01-28 13:49:17 UTC (rev 18281)
+++ container/jboss72/branches/jbossws-jboss720/server-integration/src/main/java/org/jboss/as/webservices/invocation/AbstractInvocationHandler.java 2014-01-28 18:37:09 UTC (rev 18282)
@@ -114,8 +114,9 @@
}
// prepare invocation data
final ComponentView componentView = getComponentView();
- if (reference != null) {
- ((WSComponent)componentView.getComponent()).setReference(reference);
+ Component component = componentView.getComponent();
+ if (reference != null && component instanceof WSComponent) {
+ ((WSComponent)component).setReference(reference);
}
final Method method = getComponentViewMethod(wsInvocation.getJavaMethod(), componentView.getViewMethods());
final InterceptorContext context = new InterceptorContext();
@@ -123,7 +124,7 @@
context.setMethod(method);
context.setParameters(wsInvocation.getArgs());
context.setTarget(reference.getInstance());
- context.putPrivateData(Component.class, componentView.getComponent());
+ context.putPrivateData(Component.class, component);
context.putPrivateData(ComponentView.class, componentView);
// invoke method
final Object retObj = componentView.invoke(context);
10 years, 11 months
JBossWS SVN: r18281 - stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf.
by jbossws-commits@lists.jboss.org
Author: asoldano
Date: 2014-01-28 08:49:17 -0500 (Tue, 28 Jan 2014)
New Revision: 18281
Modified:
stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/RequestHandlerImpl.java
Log:
[JBWS-3741] Replace //, ///, ////, etc. in request paths with /
Modified: stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/RequestHandlerImpl.java
===================================================================
--- stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/RequestHandlerImpl.java 2014-01-27 16:49:11 UTC (rev 18280)
+++ stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/RequestHandlerImpl.java 2014-01-28 13:49:17 UTC (rev 18281)
@@ -28,6 +28,7 @@
import java.net.MalformedURLException;
import java.net.URL;
import java.util.Collection;
+import java.util.regex.Pattern;
import javax.servlet.ServletConfig;
import javax.servlet.ServletContext;
@@ -66,6 +67,7 @@
public class RequestHandlerImpl implements RequestHandler
{
private static final RequestHandlerImpl me = new RequestHandlerImpl();
+ private static final Pattern pathPattern = Pattern.compile("/{2,}");
RequestHandlerImpl()
{
@@ -132,6 +134,7 @@
{
throw Messages.MESSAGES.cannotObtainRegistry(DestinationRegistry.class.getName());
}
+ requestURI = pathPattern.matcher(requestURI).replaceAll("/");
//first try looking up the destination in the registry map
final AbstractHTTPDestination dest = destRegistry.getDestinationForPath(requestURI, true);
if (dest != null) {
10 years, 11 months
JBossWS SVN: r18280 - in stack/cxf/trunk/modules/testsuite/shared-tests/src/test: java/org/jboss/test/ws/jaxws and 4 other directories.
by jbossws-commits@lists.jboss.org
Author: asoldano
Date: 2014-01-27 11:49:11 -0500 (Mon, 27 Jan 2014)
New Revision: 18280
Added:
stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/jbws3753/
stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/jbws3753/JBWS3753TestCase.java
stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/jbws3753/ServiceAImpl.java
stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/jbws3753/ServiceBImpl.java
stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/jbws3753/ServiceImpl.java
stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/jbws3753/ServiceInterface.java
stack/cxf/trunk/modules/testsuite/shared-tests/src/test/resources/jaxws/jbws3753/
stack/cxf/trunk/modules/testsuite/shared-tests/src/test/resources/jaxws/jbws3753/WEB-INF/
stack/cxf/trunk/modules/testsuite/shared-tests/src/test/resources/jaxws/jbws3753/WEB-INF/web.xml
Modified:
stack/cxf/trunk/modules/testsuite/shared-tests/src/test/ant-import/build-jars-jaxws.xml
Log:
[JBWS-3753] Adding testcase
Modified: stack/cxf/trunk/modules/testsuite/shared-tests/src/test/ant-import/build-jars-jaxws.xml
===================================================================
--- stack/cxf/trunk/modules/testsuite/shared-tests/src/test/ant-import/build-jars-jaxws.xml 2014-01-27 16:48:40 UTC (rev 18279)
+++ stack/cxf/trunk/modules/testsuite/shared-tests/src/test/ant-import/build-jars-jaxws.xml 2014-01-27 16:49:11 UTC (rev 18280)
@@ -1366,6 +1366,13 @@
</classes>
</war>
+ <!-- jaxws-jbws3753 -->
+ <war destfile="${tests.output.dir}/test-libs/jaxws-jbws3753.war" webxml="${tests.output.dir}/test-resources/jaxws/jbws3753/WEB-INF/web.xml">
+ <classes dir="${tests.output.dir}/test-classes">
+ <include name="org/jboss/test/ws/jaxws/jbws3753/Service*.class" />
+ </classes>
+ </war>
+
<war warfile="${tests.output.dir}/test-libs/jaxws-jbws3367-usecase2.war" needxmlfile="false">
<classes dir="${tests.output.dir}/test-classes">
<include name="org/jboss/test/ws/jaxws/jbws3367/EndpointIface.class" />
Added: stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/jbws3753/JBWS3753TestCase.java
===================================================================
--- stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/jbws3753/JBWS3753TestCase.java (rev 0)
+++ stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/jbws3753/JBWS3753TestCase.java 2014-01-27 16:49:11 UTC (rev 18280)
@@ -0,0 +1,66 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2009, 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.jbws3753;
+
+import java.net.URL;
+
+import javax.xml.namespace.QName;
+import javax.xml.ws.Service;
+
+import junit.framework.Test;
+
+import org.jboss.wsf.test.JBossWSTest;
+import org.jboss.wsf.test.JBossWSTestSetup;
+
+/**
+ * [JBWS-3753] Improve destination matching when processing requests
+ *
+ * @author alessio.soldano(a)jboss.com
+ */
+public class JBWS3753TestCase extends JBossWSTest
+{
+ public static Test suite() {
+ return new JBossWSTestSetup(JBWS3753TestCase.class, "jaxws-jbws3753.war");
+ }
+
+ public void testService() throws Exception
+ {
+ Service service = Service.create(new URL("http://" + getServerHost() + ":8080/jaxws-jbws3753/service?wsdl"), new QName("http://org.jboss.ws/jaxws/jbws3753/", "MyService"));
+ ServiceInterface port = service.getPort(ServiceInterface.class);
+ assertEquals("Hi John", port.greetMe("John"));
+ }
+
+ public void testServiceA() throws Exception
+ {
+ Service service = Service.create(new URL("http://" + getServerHost() + ":8080/jaxws-jbws3753/serviceA?wsdl"), new QName("http://org.jboss.ws/jaxws/jbws3753/", "MyService"));
+ ServiceInterface port = service.getPort(ServiceInterface.class);
+ assertEquals("(A) Hi John", port.greetMe("John"));
+ }
+
+ public void testServiceB() throws Exception
+ {
+ Service service = Service.create(new URL("http://" + getServerHost() + ":8080/jaxws-jbws3753/serviceB?wsdl"), new QName("http://org.jboss.ws/jaxws/jbws3753/", "MyService"));
+ ServiceInterface port = service.getPort(ServiceInterface.class);
+ assertEquals("(B) Hi John", port.greetMe("John"));
+ }
+
+}
Property changes on: stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/jbws3753/JBWS3753TestCase.java
___________________________________________________________________
Added: svn:keywords
+ Rev Date
Added: svn:eol-style
+ native
Added: stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/jbws3753/ServiceAImpl.java
===================================================================
--- stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/jbws3753/ServiceAImpl.java (rev 0)
+++ stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/jbws3753/ServiceAImpl.java 2014-01-27 16:49:11 UTC (rev 18280)
@@ -0,0 +1,40 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2009, 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.jbws3753;
+
+import javax.jws.WebService;
+
+@WebService
+(
+ serviceName = "MyService",
+ endpointInterface = "org.jboss.test.ws.jaxws.jbws3753.ServiceInterface",
+ targetNamespace = "http://org.jboss.ws/jaxws/jbws3753/"
+)
+public class ServiceAImpl implements ServiceInterface
+{
+
+ public String greetMe(String input)
+ {
+ return "(A) Hi " + input;
+ }
+
+}
Property changes on: stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/jbws3753/ServiceAImpl.java
___________________________________________________________________
Added: svn:keywords
+ Rev Date
Added: svn:eol-style
+ native
Added: stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/jbws3753/ServiceBImpl.java
===================================================================
--- stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/jbws3753/ServiceBImpl.java (rev 0)
+++ stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/jbws3753/ServiceBImpl.java 2014-01-27 16:49:11 UTC (rev 18280)
@@ -0,0 +1,40 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2009, 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.jbws3753;
+
+import javax.jws.WebService;
+
+@WebService
+(
+ serviceName = "MyService",
+ endpointInterface = "org.jboss.test.ws.jaxws.jbws3753.ServiceInterface",
+ targetNamespace = "http://org.jboss.ws/jaxws/jbws3753/"
+)
+public class ServiceBImpl implements ServiceInterface
+{
+
+ public String greetMe(String input)
+ {
+ return "(B) Hi " + input;
+ }
+
+}
Property changes on: stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/jbws3753/ServiceBImpl.java
___________________________________________________________________
Added: svn:keywords
+ Rev Date
Added: svn:eol-style
+ native
Added: stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/jbws3753/ServiceImpl.java
===================================================================
--- stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/jbws3753/ServiceImpl.java (rev 0)
+++ stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/jbws3753/ServiceImpl.java 2014-01-27 16:49:11 UTC (rev 18280)
@@ -0,0 +1,40 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2009, 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.jbws3753;
+
+import javax.jws.WebService;
+
+@WebService
+(
+ serviceName = "MyService",
+ endpointInterface = "org.jboss.test.ws.jaxws.jbws3753.ServiceInterface",
+ targetNamespace = "http://org.jboss.ws/jaxws/jbws3753/"
+)
+public class ServiceImpl implements ServiceInterface
+{
+
+ public String greetMe(String input)
+ {
+ return "Hi " + input;
+ }
+
+}
Property changes on: stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/jbws3753/ServiceImpl.java
___________________________________________________________________
Added: svn:keywords
+ Rev Date
Added: svn:eol-style
+ native
Added: stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/jbws3753/ServiceInterface.java
===================================================================
--- stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/jbws3753/ServiceInterface.java (rev 0)
+++ stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/jbws3753/ServiceInterface.java 2014-01-27 16:49:11 UTC (rev 18280)
@@ -0,0 +1,31 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2009, 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.jbws3753;
+
+import javax.jws.WebService;
+
+@WebService(targetNamespace = "http://org.jboss.ws/jaxws/jbws3753/")
+public interface ServiceInterface
+{
+
+ String greetMe(String input);
+}
Property changes on: stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/jbws3753/ServiceInterface.java
___________________________________________________________________
Added: svn:keywords
+ Rev Date
Added: svn:eol-style
+ native
Added: stack/cxf/trunk/modules/testsuite/shared-tests/src/test/resources/jaxws/jbws3753/WEB-INF/web.xml
===================================================================
--- stack/cxf/trunk/modules/testsuite/shared-tests/src/test/resources/jaxws/jbws3753/WEB-INF/web.xml (rev 0)
+++ stack/cxf/trunk/modules/testsuite/shared-tests/src/test/resources/jaxws/jbws3753/WEB-INF/web.xml 2014-01-27 16:49:11 UTC (rev 18280)
@@ -0,0 +1,35 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<web-app xmlns="http://java.sun.com/xml/ns/j2ee"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"
+ version="2.4">
+
+ <servlet>
+ <servlet-name>ServiceA</servlet-name>
+ <servlet-class>org.jboss.test.ws.jaxws.jbws3753.ServiceAImpl</servlet-class>
+ </servlet>
+ <servlet>
+ <servlet-name>ServiceB</servlet-name>
+ <servlet-class>org.jboss.test.ws.jaxws.jbws3753.ServiceBImpl</servlet-class>
+ </servlet>
+ <servlet>
+ <servlet-name>Service</servlet-name>
+ <servlet-class>org.jboss.test.ws.jaxws.jbws3753.ServiceImpl</servlet-class>
+ </servlet>
+
+ <servlet-mapping>
+ <servlet-name>ServiceA</servlet-name>
+ <url-pattern>/serviceA</url-pattern>
+ </servlet-mapping>
+ <servlet-mapping>
+ <servlet-name>ServiceB</servlet-name>
+ <url-pattern>/serviceB</url-pattern>
+ </servlet-mapping>
+ <servlet-mapping>
+ <servlet-name>Service</servlet-name>
+ <url-pattern>/service</url-pattern>
+ </servlet-mapping>
+
+</web-app>
+
Property changes on: stack/cxf/trunk/modules/testsuite/shared-tests/src/test/resources/jaxws/jbws3753/WEB-INF/web.xml
___________________________________________________________________
Added: svn:mime-type
+ text/xml
Added: svn:keywords
+ Rev Date
Added: svn:eol-style
+ native
10 years, 11 months
JBossWS SVN: r18279 - in stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf: configuration and 1 other directories.
by jbossws-commits@lists.jboss.org
Author: asoldano
Date: 2014-01-27 11:48:40 -0500 (Mon, 27 Jan 2014)
New Revision: 18279
Added:
stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/transport/JBossWSDestinationRegistryImpl.java
Modified:
stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/RequestHandlerImpl.java
stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/configuration/BusHolder.java
Log:
[JBWS-3753] Installing a custom DestinationRegistry impl to use map lookup for matching destination on request receival
Modified: stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/RequestHandlerImpl.java
===================================================================
--- stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/RequestHandlerImpl.java 2014-01-27 15:04:27 UTC (rev 18278)
+++ stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/RequestHandlerImpl.java 2014-01-27 16:48:40 UTC (rev 18279)
@@ -132,33 +132,29 @@
{
throw Messages.MESSAGES.cannotObtainRegistry(DestinationRegistry.class.getName());
}
+ //first try looking up the destination in the registry map
+ final AbstractHTTPDestination dest = destRegistry.getDestinationForPath(requestURI, true);
+ if (dest != null) {
+ return dest;
+ }
+ //if there's no direct match, iterate on the destinations to see if there's valid "catch-all" destination
+ //(servlet-based endpoints, with "/*" url-pattern in web.xml)
Collection<AbstractHTTPDestination> destinations = destRegistry.getDestinations();
AbstractHTTPDestination returnValue = null;
for (AbstractHTTPDestination destination : destinations)
{
- EndpointInfo endpointInfo = destination.getEndpointInfo();
- String address = endpointInfo.getAddress();
-
- String path = address;
+ String path = destination.getEndpointInfo().getAddress();
try
{
- path = new URL(address).getPath();
+ path = new URL(path).getPath();
}
catch (MalformedURLException ex)
{
// ignore
}
- if (path != null)
- {
- if (requestURI.equals(path))
- {
- return destination; // exact match
- }
- else if (requestURI.startsWith(path))
- {
- returnValue = destination; // fallback
- }
+ if (path != null && requestURI.startsWith(path)) {
+ returnValue = destination;
}
}
Modified: stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/configuration/BusHolder.java
===================================================================
--- stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/configuration/BusHolder.java 2014-01-27 15:04:27 UTC (rev 18278)
+++ stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/configuration/BusHolder.java 2014-01-27 16:48:40 UTC (rev 18279)
@@ -40,6 +40,7 @@
import org.apache.cxf.resource.ResourceResolver;
import org.apache.cxf.service.factory.FactoryBeanListener;
import org.apache.cxf.service.factory.FactoryBeanListenerManager;
+import org.apache.cxf.transport.http.DestinationRegistry;
import org.apache.cxf.workqueue.AutomaticWorkQueue;
import org.apache.cxf.workqueue.AutomaticWorkQueueImpl;
import org.apache.cxf.workqueue.WorkQueueManager;
@@ -59,6 +60,7 @@
import org.jboss.wsf.stack.cxf.interceptor.HandlerAuthInterceptor;
import org.jboss.wsf.stack.cxf.interceptor.NsCtxSelectorStoreInterceptor;
import org.jboss.wsf.stack.cxf.management.InstrumentationManagerExtImpl;
+import org.jboss.wsf.stack.cxf.transport.JBossWSDestinationRegistryImpl;
/**
* A wrapper of the Bus for performing most of the configurations required on it by JBossWS
@@ -114,6 +116,10 @@
{
bus.getExtension(PolicyEngine.class).setAlternativeSelector(getAlternativeSelector(props));
}
+ if (bus.getExtension(DestinationRegistry.class) == null)
+ {
+ bus.setExtension(new JBossWSDestinationRegistryImpl(), DestinationRegistry.class);
+ }
setCXFManagement(bus, props); //*first* enabled cxf management if required, *then* add anything else which could be manageable (e.g. work queues)
setAdditionalWorkQueues(bus, props);
setWSDiscovery(bus, props);
Added: stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/transport/JBossWSDestinationRegistryImpl.java
===================================================================
--- stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/transport/JBossWSDestinationRegistryImpl.java (rev 0)
+++ stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/transport/JBossWSDestinationRegistryImpl.java 2014-01-27 16:48:40 UTC (rev 18279)
@@ -0,0 +1,70 @@
+/*
+ * 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.wsf.stack.cxf.transport;
+
+import java.net.MalformedURLException;
+import java.net.URL;
+
+import org.apache.cxf.transport.http.DestinationRegistryImpl;
+
+/**
+ * A JBossWS version of the CXF DestinationRegistryImpl that registers destinations
+ * with different key values.
+ *
+ * @author alessio.soldano(a)jboss.com
+ * @since 23-Jan-2014
+ *
+ */
+public class JBossWSDestinationRegistryImpl extends DestinationRegistryImpl
+{
+
+ /**
+ * Return a real path value, removing the protocol, host and port
+ * if specified.
+ *
+ * @param path
+ * @return trimmed path
+ */
+ @Override
+ public String getTrimmedPath(String path)
+ {
+ if (path == null)
+ {
+ return "/";
+ }
+ if (!path.startsWith("/"))
+ {
+ try
+ {
+ path = new URL(path).getPath();
+ }
+ catch (MalformedURLException ex)
+ {
+ // ignore
+ }
+ if (!path.startsWith("/")) {
+ path = "/" + path;
+ }
+ }
+ return path;
+ }
+}
Property changes on: stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/transport/JBossWSDestinationRegistryImpl.java
___________________________________________________________________
Added: svn:keywords
+ Rev Date
Added: svn:eol-style
+ native
10 years, 11 months