JBossWS SVN: r11933 - stack/cxf/trunk/modules/testsuite.
by jbossws-commits@lists.jboss.org
Author: alessio.soldano(a)jboss.com
Date: 2010-04-02 12:09:45 -0400 (Fri, 02 Apr 2010)
New Revision: 11933
Modified:
stack/cxf/trunk/modules/testsuite/pom.xml
Log:
[JBWS-2983] Update hornetq dependency
Modified: stack/cxf/trunk/modules/testsuite/pom.xml
===================================================================
--- stack/cxf/trunk/modules/testsuite/pom.xml 2010-04-02 13:13:06 UTC (rev 11932)
+++ stack/cxf/trunk/modules/testsuite/pom.xml 2010-04-02 16:09:45 UTC (rev 11933)
@@ -26,7 +26,7 @@
<wsdl.publish.location>${project.build.directory}/wsdl-publish</wsdl.publish.location>
<hibernate.version>3.2.4.sp1</hibernate.version>
<asm.version>2.2.3</asm.version>
- <hornetq.version>2.1.0.r8931</hornetq.version>
+ <hornetq.version>2.1.0.BETA1</hornetq.version>
<jboss.javaee.version>5.0.0.GA</jboss.javaee.version>
</properties>
14 years, 8 months
JBossWS SVN: r11932 - in stack/native/trunk/modules/testsuite/native-tests: src/test/java/org/jboss/test/ws/jaxws/samples/jmstransport and 1 other directory.
by jbossws-commits@lists.jboss.org
Author: alessio.soldano(a)jboss.com
Date: 2010-04-02 09:13:06 -0400 (Fri, 02 Apr 2010)
New Revision: 11932
Modified:
stack/native/trunk/modules/testsuite/native-tests/scripts/build-samples-jaxws.xml
stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/samples/jmstransport/JMSTransportTestCase.java
Log:
[JBWS-2983] Refactoring jms endpoint test archives
Modified: stack/native/trunk/modules/testsuite/native-tests/scripts/build-samples-jaxws.xml
===================================================================
--- stack/native/trunk/modules/testsuite/native-tests/scripts/build-samples-jaxws.xml 2010-04-02 11:04:49 UTC (rev 11931)
+++ stack/native/trunk/modules/testsuite/native-tests/scripts/build-samples-jaxws.xml 2010-04-02 13:13:06 UTC (rev 11932)
@@ -165,11 +165,13 @@
<include name="jboss-service.xml"/>
</metainf>
</jar>
- <jar jarfile="${tests.output.dir}/test-libs/jaxws-samples-jmstransport-as6.sar">
- <fileset dir="${tests.output.dir}/test-libs">
- <include name="jaxws-samples-jmstransport.jar"/>
+ <jar jarfile="${tests.output.dir}/test-libs/jaxws-samples-jmstransport-as6.jar">
+ <fileset dir="${tests.output.dir}/test-classes">
+ <include name="org/jboss/test/ws/jaxws/samples/jmstransport/Organization.class"/>
+ <include name="org/jboss/test/ws/jaxws/samples/jmstransport/OrganizationJMSEndpoint.class"/>
</fileset>
<metainf dir="${tests.output.dir}/test-resources/jaxws/samples/jmstransport/META-INF">
+ <include name="wsdl/*.wsdl"/>
<include name="hornetq-jms.xml"/>
</metainf>
</jar>
Modified: stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/samples/jmstransport/JMSTransportTestCase.java
===================================================================
--- stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/samples/jmstransport/JMSTransportTestCase.java 2010-04-02 11:04:49 UTC (rev 11931)
+++ stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/samples/jmstransport/JMSTransportTestCase.java 2010-04-02 13:13:06 UTC (rev 11932)
@@ -61,7 +61,7 @@
public static Test suite() throws Exception
{
//TODO: replace isHornetQAvailable call with JBossWSTestHelper.isTargetJBoss6() once AS 6 M3 is out and hence M2 is not supported anymore
- return new JBossWSTestSetup(JMSTransportTestCase.class, isHornetQAvailable() ? "jaxws-samples-jmstransport-as6.sar" : "jaxws-samples-jmstransport.sar");
+ return new JBossWSTestSetup(JMSTransportTestCase.class, isHornetQAvailable() ? "jaxws-samples-jmstransport-as6.jar" : "jaxws-samples-jmstransport.sar");
}
private static boolean isHornetQAvailable()
14 years, 8 months
JBossWS SVN: r11931 - stack/cxf/trunk/modules/testsuite.
by jbossws-commits@lists.jboss.org
Author: alessio.soldano(a)jboss.com
Date: 2010-04-02 07:04:49 -0400 (Fri, 02 Apr 2010)
New Revision: 11931
Modified:
stack/cxf/trunk/modules/testsuite/test-excludes-jboss501.txt
stack/cxf/trunk/modules/testsuite/test-excludes-jboss510.txt
stack/cxf/trunk/modules/testsuite/test-excludes-jboss600.txt
stack/cxf/trunk/modules/testsuite/test-excludes-jboss601.txt
Log:
Excluding cxf wstrust tests as they depends on Microsoft WCF plugfest endpoint, which is currently down
Modified: stack/cxf/trunk/modules/testsuite/test-excludes-jboss501.txt
===================================================================
--- stack/cxf/trunk/modules/testsuite/test-excludes-jboss501.txt 2010-04-02 10:46:42 UTC (rev 11930)
+++ stack/cxf/trunk/modules/testsuite/test-excludes-jboss501.txt 2010-04-02 11:04:49 UTC (rev 11931)
@@ -1,6 +1,9 @@
# UsernameTestCase requires trustore in jboss-web tomcat configuration
org/jboss/test/ws/jaxws/samples/wssePolicy/UsernameTestCase.*
+# WS-Trust tests require Microsoft WCF endpoint up and running
+org/jboss/test/ws/jaxws/cxf/interop/wstrust10/**
+
# [CXF-1252] Provider PAYLOAD endpoint expects SOAP Envelope
org/jboss/test/ws/jaxws/samples/provider/ProviderJAXBTestCase.*
org/jboss/test/ws/jaxws/samples/provider/ProviderPayloadTestCase.*
Modified: stack/cxf/trunk/modules/testsuite/test-excludes-jboss510.txt
===================================================================
--- stack/cxf/trunk/modules/testsuite/test-excludes-jboss510.txt 2010-04-02 10:46:42 UTC (rev 11930)
+++ stack/cxf/trunk/modules/testsuite/test-excludes-jboss510.txt 2010-04-02 11:04:49 UTC (rev 11931)
@@ -1,6 +1,9 @@
# UsernameTestCase requires trustore in jboss-web tomcat configuration
org/jboss/test/ws/jaxws/samples/wssePolicy/UsernameTestCase.*
+# WS-Trust tests require Microsoft WCF endpoint up and running
+org/jboss/test/ws/jaxws/cxf/interop/wstrust10/**
+
# [CXF-1252] Provider PAYLOAD endpoint expects SOAP Envelope
org/jboss/test/ws/jaxws/samples/provider/ProviderJAXBTestCase.*
org/jboss/test/ws/jaxws/samples/provider/ProviderPayloadTestCase.*
Modified: stack/cxf/trunk/modules/testsuite/test-excludes-jboss600.txt
===================================================================
--- stack/cxf/trunk/modules/testsuite/test-excludes-jboss600.txt 2010-04-02 10:46:42 UTC (rev 11930)
+++ stack/cxf/trunk/modules/testsuite/test-excludes-jboss600.txt 2010-04-02 11:04:49 UTC (rev 11931)
@@ -1,6 +1,9 @@
# UsernameTestCase requires trustore in jboss-web tomcat configuration
org/jboss/test/ws/jaxws/samples/wssePolicy/UsernameTestCase.*
+# WS-Trust tests require Microsoft WCF endpoint up and running
+org/jboss/test/ws/jaxws/cxf/interop/wstrust10/**
+
# [CXF-1252] Provider PAYLOAD endpoint expects SOAP Envelope
org/jboss/test/ws/jaxws/samples/provider/ProviderJAXBTestCase.*
org/jboss/test/ws/jaxws/samples/provider/ProviderPayloadTestCase.*
Modified: stack/cxf/trunk/modules/testsuite/test-excludes-jboss601.txt
===================================================================
--- stack/cxf/trunk/modules/testsuite/test-excludes-jboss601.txt 2010-04-02 10:46:42 UTC (rev 11930)
+++ stack/cxf/trunk/modules/testsuite/test-excludes-jboss601.txt 2010-04-02 11:04:49 UTC (rev 11931)
@@ -1,6 +1,9 @@
# UsernameTestCase requires trustore in jboss-web tomcat configuration
org/jboss/test/ws/jaxws/samples/wssePolicy/UsernameTestCase.*
+# WS-Trust tests require Microsoft WCF endpoint up and running
+org/jboss/test/ws/jaxws/cxf/interop/wstrust10/**
+
# [CXF-1252] Provider PAYLOAD endpoint expects SOAP Envelope
org/jboss/test/ws/jaxws/samples/provider/ProviderJAXBTestCase.*
org/jboss/test/ws/jaxws/samples/provider/ProviderPayloadTestCase.*
14 years, 8 months
JBossWS SVN: r11930 - framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/smoke/tools.
by jbossws-commits@lists.jboss.org
Author: alessio.soldano(a)jboss.com
Date: 2010-04-02 06:46:42 -0400 (Fri, 02 Apr 2010)
New Revision: 11930
Modified:
framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/smoke/tools/WSRunClientTestCase.java
Log:
Fixing regression
Modified: framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/smoke/tools/WSRunClientTestCase.java
===================================================================
--- framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/smoke/tools/WSRunClientTestCase.java 2010-04-02 10:21:31 UTC (rev 11929)
+++ framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/smoke/tools/WSRunClientTestCase.java 2010-04-02 10:46:42 UTC (rev 11930)
@@ -107,6 +107,8 @@
sb.append(PS).append(System.getProperty("basedir"));
sb.append(FS).append("target").append(FS).append("junit-libs").append(FS).append("junit.jar");
}
+ //integration jars required just because we're running our tests that need to deploy archives
+ sb.append(PS).append(jbossHome).append(FS).append("lib").append(FS).append("jboss-system.jar");
return sb.toString();
}
14 years, 8 months
JBossWS SVN: r11929 - framework/trunk/testsuite/test/ant-import.
by jbossws-commits@lists.jboss.org
Author: alessio.soldano(a)jboss.com
Date: 2010-04-02 06:21:31 -0400 (Fri, 02 Apr 2010)
New Revision: 11929
Modified:
framework/trunk/testsuite/test/ant-import/build-testsuite.xml
Log:
Cleaning up some libraries from AS 6 classpath (as they do not exist any more)
Modified: framework/trunk/testsuite/test/ant-import/build-testsuite.xml
===================================================================
--- framework/trunk/testsuite/test/ant-import/build-testsuite.xml 2010-04-02 09:42:06 UTC (rev 11928)
+++ framework/trunk/testsuite/test/ant-import/build-testsuite.xml 2010-04-02 10:21:31 UTC (rev 11929)
@@ -293,13 +293,10 @@
<pathelement location="${jboss.client}/jboss-ejb3-ext-api.jar"/>
<pathelement location="${jboss.client}/jboss-jaxr-api_1.0_spec.jar"/>
<pathelement location="${jboss.client}/jboss-logging-spi.jar"/>
- <pathelement location="${jboss.client}/jboss-metadata.jar"/>
<pathelement location="${jboss.client}/jboss-metadata-client.jar"/>
<pathelement location="${jboss.client}/jboss-metadata-common.jar"/>
<pathelement location="${jboss.client}/jboss-remoting.jar"/>
<pathelement location="${jboss.client}/jboss-servlet-api_3.0_spec.jar"/>
- <pathelement location="${jboss.client}/jboss-wsit-tools.jar"/>
- <pathelement location="${jboss.client}/jboss-xml-binding.jar"/>
<pathelement location="${jboss.client}/jbossxb.jar"/>
<pathelement location="${jboss.client}/mail.jar"/>
<pathelement location="${jboss.client}/stax-api.jar"/>
@@ -324,29 +321,22 @@
<pathelement location="${jboss.client}/jaxb-xjc.jar"/>
<pathelement location="${jboss.client}/jaxws-tools.jar"/>
<pathelement location="${jboss.client}/jboss-appclient.jar"/>
- <pathelement location="${jboss.client}/jboss-container-metadata.jar"/>
<pathelement location="${jboss.client}/jboss-ejb3-ext-api.jar"/>
- <pathelement location="${jboss.client}/jboss-metadata.jar"/>
<pathelement location="${jboss.client}/jboss-metadata-client.jar"/>
<pathelement location="${jboss.client}/jboss-metadata-common.jar"/>
<pathelement location="${jboss.client}/jboss-remoting.jar"/>
- <pathelement location="${jboss.client}/jboss-wsit-tools.jar"/>
- <pathelement location="${jboss.client}/jboss-xml-binding.jar"/>
<pathelement location="${jboss.client}/jbossxb.jar"/>
<pathelement location="${jboss.client}/jbossall-client.jar"/>
<pathelement location="${jboss.client}/jaxws-tools.jar"/>
- <pathelement location="${jboss.client}/jboss-wsit-tools.jar"/>
<pathelement location="${jboss.client}/log4j.jar"/>
<pathelement location="${jboss.client}/mail.jar"/>
<pathelement location="${jboss.client}/stax-api.jar"/>
<pathelement location="${jboss.client}/trove.jar"/>
<pathelement location="${jboss.client}/jboss-javaee.jar"/>
<!-- FIXME jars should be available in the client dir -->
- <pathelement location="${jboss.lib}/jboss-aop-jdk50.jar"/>
<pathelement location="${jboss.lib}/jboss-classloader.jar"/>
<pathelement location="${jboss.lib}/jboss-classloading.jar"/>
<pathelement location="${jboss.lib}/jboss-classloading-vfs.jar"/>
- <pathelement location="${jboss.lib}/jboss-container.jar"/>
<pathelement location="${jboss.lib}/jboss-dependency.jar"/>
<pathelement location="${jboss.lib}/jboss-vfs.jar"/>
<pathelement location="${jboss.lib}/jboss-kernel.jar"/>
@@ -355,7 +345,6 @@
<pathelement location="${jboss.server.lib}/jboss.jar"/>
<pathelement location="${jboss.server.lib}/jbosssx.jar"/>
<pathelement location="${jboss.server.lib}/jbossws-native-core.jar"/> <!-- For jaxrpc tests -->
- <pathelement location="${jboss.server.lib}/hibernate3.jar"/>
<pathelement location="${jboss.server.lib}/jnpserver.jar"/>
<pathelement location="${jboss.server.lib}/jboss-ejb3-core.jar"/>
<pathelement location="${jboss.server.lib}/jboss-ejb3-vfs-spi.jar"/>
14 years, 8 months
JBossWS SVN: r11928 - framework/trunk/testsuite/test/ant-import.
by jbossws-commits@lists.jboss.org
Author: alessio.soldano(a)jboss.com
Date: 2010-04-02 05:42:06 -0400 (Fri, 02 Apr 2010)
New Revision: 11928
Modified:
framework/trunk/testsuite/test/ant-import/build-testsuite.xml
Log:
Add jboss-system.jar to bin dist classpath to fix regressions against AS trunk
Modified: framework/trunk/testsuite/test/ant-import/build-testsuite.xml
===================================================================
--- framework/trunk/testsuite/test/ant-import/build-testsuite.xml 2010-04-02 09:41:53 UTC (rev 11927)
+++ framework/trunk/testsuite/test/ant-import/build-testsuite.xml 2010-04-02 09:42:06 UTC (rev 11928)
@@ -351,6 +351,7 @@
<pathelement location="${jboss.lib}/jboss-vfs.jar"/>
<pathelement location="${jboss.lib}/jboss-kernel.jar"/>
<pathelement location="${jboss.lib}/jboss-reflect.jar"/>
+ <pathelement location="${jboss.lib}/jboss-system.jar"/>
<pathelement location="${jboss.server.lib}/jboss.jar"/>
<pathelement location="${jboss.server.lib}/jbosssx.jar"/>
<pathelement location="${jboss.server.lib}/jbossws-native-core.jar"/> <!-- For jaxrpc tests -->
14 years, 8 months
JBossWS SVN: r11927 - stack/native/trunk/modules/core/src/main/java/org/jboss/wsf/stack/jbws.
by jbossws-commits@lists.jboss.org
Author: richard.opalka(a)jboss.com
Date: 2010-04-02 05:41:53 -0400 (Fri, 02 Apr 2010)
New Revision: 11927
Modified:
stack/native/trunk/modules/core/src/main/java/org/jboss/wsf/stack/jbws/WSDLFilePublisher.java
Log:
[JBWS-2986] fixing NPE - there can be endpoints not providing wsdl publish location - e.g. WSProvider endpoints
Modified: stack/native/trunk/modules/core/src/main/java/org/jboss/wsf/stack/jbws/WSDLFilePublisher.java
===================================================================
--- stack/native/trunk/modules/core/src/main/java/org/jboss/wsf/stack/jbws/WSDLFilePublisher.java 2010-04-02 05:31:43 UTC (rev 11926)
+++ stack/native/trunk/modules/core/src/main/java/org/jboss/wsf/stack/jbws/WSDLFilePublisher.java 2010-04-02 09:41:53 UTC (rev 11927)
@@ -67,9 +67,11 @@
String deploymentName = dep.getCanonicalName();
// For each service
- for (ServiceMetaData serviceMetaData : wsMetaData.getServices())
+ for (ServiceMetaData serviceMD : wsMetaData.getServices())
{
- File wsdlFile = getPublishLocation(deploymentName, serviceMetaData.getWsdlFileOrLocation().toExternalForm(), serviceMetaData.getWsdlPublishLocation());
+ final String wsdlLocation = this.getWSDLLocation(serviceMD);
+ final String publishLocation = serviceMD.getWsdlPublishLocation();
+ final File wsdlFile = getPublishLocation(deploymentName, wsdlLocation, publishLocation);
if (wsdlFile == null)
continue;
@@ -80,14 +82,14 @@
try
{
fWriter = IOUtils.getCharsetFileWriter(wsdlFile, Constants.DEFAULT_XML_CHARSET);
- WSDLDefinitions wsdlDefinitions = serviceMetaData.getWsdlDefinitions();
+ WSDLDefinitions wsdlDefinitions = serviceMD.getWsdlDefinitions();
new WSDLWriter(wsdlDefinitions).write(fWriter, Constants.DEFAULT_XML_CHARSET);
URL wsdlPublishURL = wsdlFile.toURI().toURL();
log.info("WSDL published to: " + wsdlPublishURL);
// udpate the wsdl file location
- serviceMetaData.setWsdlLocation(wsdlPublishURL);
+ serviceMD.setWsdlLocation(wsdlPublishURL);
// Process the wsdl imports
Definition wsdl11Definition = wsdlDefinitions.getWsdlOneOneDefinition();
@@ -123,6 +125,14 @@
}
}
+ private String getWSDLLocation(final ServiceMetaData serviceMD)
+ {
+ if (serviceMD.getWsdlFileOrLocation() == null)
+ return null;
+
+ return serviceMD.getWsdlFileOrLocation().toExternalForm();
+ }
+
/**
* Get the file publish location
*/
14 years, 8 months
JBossWS SVN: r11926 - stack/native/trunk/modules/testsuite.
by jbossws-commits@lists.jboss.org
Author: richard.opalka(a)jboss.com
Date: 2010-04-02 01:31:43 -0400 (Fri, 02 Apr 2010)
New Revision: 11926
Modified:
stack/native/trunk/modules/testsuite/pom.xml
Log:
synch with AS trunk
Modified: stack/native/trunk/modules/testsuite/pom.xml
===================================================================
--- stack/native/trunk/modules/testsuite/pom.xml 2010-04-01 17:21:15 UTC (rev 11925)
+++ stack/native/trunk/modules/testsuite/pom.xml 2010-04-02 05:31:43 UTC (rev 11926)
@@ -26,7 +26,7 @@
<wsdl.publish.location>${project.build.directory}/wsdl-publish</wsdl.publish.location>
<hibernate.version>3.2.4.sp1</hibernate.version>
<jboss.javaee.version>5.0.0.GA</jboss.javaee.version>
- <hornetq.version>2.1.0.r9031</hornetq.version>
+ <hornetq.version>2.1.0.BETA1</hornetq.version>
</properties>
<!-- Modules -->
14 years, 8 months
JBossWS SVN: r11925 - in stack/cxf/trunk/modules/server/src/main: java/org/jboss/wsf/stack/cxf/configuration and 5 other directories.
by jbossws-commits@lists.jboss.org
Author: alessio.soldano(a)jboss.com
Date: 2010-04-01 13:21:15 -0400 (Thu, 01 Apr 2010)
New Revision: 11925
Added:
stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/deployment/WSDLFilePublisher.java
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/DescriptorDeploymentAspect.java
stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/deployment/aspect/ResourceResolverDeploymentAspect.java
stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/deployment/aspect/SecurityActions.java
stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/resolver/
stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/resolver/JBossWSResourceResolver.java
stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/resolver/WebAppResolver.java
stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/transport/AddressRewritingEndpointInfo.java
stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/transport/SoapTransportFactoryExt.java
Removed:
stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/AddressRewritingEndpointInfo.java
stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/BusDeploymentAspect.java
stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/DescriptorDeploymentAspect.java
stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/JBossWSResourceResolver.java
stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/ResourceResolverDeploymentAspect.java
stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/SecurityActions.java
stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/SoapTransportFactoryExt.java
stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/WSDLFilePublisher.java
stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/WebAppResolver.java
Modified:
stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/CXFServletExt.java
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/JBossWSServerCXFConfigurer.java
stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/deployment/EndpointImpl.java
stack/cxf/trunk/modules/server/src/main/resources/jbossws-cxf-config-as5.xml
stack/cxf/trunk/modules/server/src/main/resources/jbossws-cxf-config-as6.xml
Log:
[JBWS-2971] reorganizing classes for server integration
Deleted: stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/AddressRewritingEndpointInfo.java
===================================================================
--- stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/AddressRewritingEndpointInfo.java 2010-04-01 16:07:54 UTC (rev 11924)
+++ stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/AddressRewritingEndpointInfo.java 2010-04-01 17:21:15 UTC (rev 11925)
@@ -1,214 +0,0 @@
-/*
- * 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.wsf.stack.cxf;
-
-import java.net.MalformedURLException;
-import java.net.URI;
-import java.net.URISyntaxException;
-import java.net.URL;
-
-import org.apache.cxf.service.model.EndpointInfo;
-import org.apache.cxf.service.model.ServiceInfo;
-import org.apache.cxf.tools.common.extensions.soap.SoapAddress;
-import org.jboss.logging.Logger;
-import org.jboss.wsf.spi.management.ServerConfig;
-
-/**
- * A custom EndpointInfo that updates the SoapAddress extension
- * coming from the wsdl definition according to the JBossWS
- * soap address rewrite rules.
- *
- * @see org.apache.cxf.binding.soap.SoapTransportFactory.SoapEndpointInfo
- *
- * @author alessio.soldano(a)jboss.com
- * @since 03-Aug-2009
- *
- */
-public class AddressRewritingEndpointInfo extends EndpointInfo
-{
- private static Logger log = Logger.getLogger(AddressRewritingEndpointInfo.class);
-
- private ServerConfig serverConfig;
- SoapAddress saddress;
-
- AddressRewritingEndpointInfo(ServiceInfo serv, String trans, ServerConfig serverConfig)
- {
- super(serv, trans);
- this.serverConfig = serverConfig;
- }
-
- /**
- * This is the method responsible for both setting the EndpointInfo address and
- * setting the soap:address in the wsdl.
- * While the former action is straightforward, the latter is performed according
- * to the JBossWS configuration: every time CXF updates the EndpointInfo address
- * (which usually happens twice) this makes sure a proper address is updated in
- * the wsdl.
- *
- * {@inheritDoc}
- */
- public void setAddress(String s)
- {
- String previousAddress = super.getAddress();
- super.setAddress(s);
- boolean setNewAddress = false;
- if (previousAddress == null)
- {
- setNewAddress = true;
- }
- else if (isRewriteAllowed(s) && isRewriteRequired(s, previousAddress))
- {
- String uriScheme = getUriScheme(s);
- //we set https if the transport guarantee is CONFIDENTIAL or the previous address already used https
- //(if the original wsdl soap:address uses https we can't overwrite it with http)
- if ("https".equalsIgnoreCase(getUriScheme(previousAddress)))
- {
- uriScheme = "https";
- }
- if (uriScheme == null)
- {
- uriScheme = "http";
- }
- //rewrite the candidate new address
- s = rewriteSoapAddress(s, uriScheme);
- setNewAddress = true;
- }
- if (setNewAddress && saddress != null)
- {
- log.info("Setting new service endpoint address in wsdl: " + s);
- saddress.setLocationURI(s);
- }
- }
-
- public void addExtensor(Object el)
- {
- super.addExtensor(el);
- if (el instanceof SoapAddress)
- {
- saddress = (SoapAddress)el;
- }
- }
-
- protected boolean isRewriteAllowed(String address)
- {
- //exclude non http addresses
- return (address != null && address.trim().toLowerCase().startsWith("http"));
- }
-
-
- protected boolean isRewriteRequired(String address, String previousAddress)
- {
- //check config prop forcing address rewrite
- if (serverConfig.isModifySOAPAddress())
- {
- log.debug("Rewrite required because of configuration");
- return true;
- }
- //check if the previous address is not valid
- if (isInvalidAddress(previousAddress))
- {
- log.debug("Rewrite required because of invalid url");
- return true;
- }
- log.debug("Rewrite not required");
- return false;
- }
-
- protected boolean isInvalidAddress(String address)
- {
- if (address == null)
- {
- return true;
- }
- String s = address.trim();
- if (s.length() == 0 || s.contains("REPLACE_WITH_ACTUAL_URL"))
- {
- return true;
- }
- try
- {
- new URL(s);
- }
- catch (Exception e)
- {
- return true;
- }
- return false;
- }
-
- /**
- * Rewrite the provided address according to the current server
- * configuration and always using the specified uriScheme.
- *
- * @param s The source address
- * @param uriScheme The uriScheme to use for rewrite
- * @return The obtained address
- */
- protected String rewriteSoapAddress(String s, String uriScheme)
- {
- try
- {
- URL url = new URL(s);
- String path = url.getPath();
- String host = serverConfig.getWebServiceHost();
- String port = "";
- if ("https".equals(uriScheme))
- {
- int portNo = serverConfig.getWebServiceSecurePort();
- if (portNo != 443)
- {
- port = ":" + portNo;
- }
- }
- else
- {
- int portNo = serverConfig.getWebServicePort();
- if (portNo != 80)
- {
- port = ":" + portNo;
- }
- }
- String urlStr = uriScheme + "://" + host + port + path;
- log.debug("Rewritten new candidate service endpoint address '" + s + "' to '" + urlStr + "'");
- return urlStr;
- }
- catch (Exception e)
- {
- log.debug("Invalid url provided, using it without rewriting: " + s);
- return s;
- }
- }
-
- private static String getUriScheme(String address)
- {
- try
- {
- URI addrURI = new URI(address);
- String scheme = addrURI.getScheme();
- return scheme;
- }
- catch (Exception e)
- {
- return null;
- }
- }
-}
\ No newline at end of file
Deleted: stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/BusDeploymentAspect.java
===================================================================
--- stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/BusDeploymentAspect.java 2010-04-01 16:07:54 UTC (rev 11924)
+++ stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/BusDeploymentAspect.java 2010-04-01 17:21:15 UTC (rev 11925)
@@ -1,122 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2010, 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;
-
-import java.io.IOException;
-import java.net.URL;
-import java.util.Map;
-
-import org.apache.cxf.BusFactory;
-import org.jboss.ws.Constants;
-import org.jboss.wsf.common.integration.AbstractDeploymentAspect;
-import org.jboss.wsf.common.integration.WSConstants;
-import org.jboss.wsf.spi.binding.BindingCustomization;
-import org.jboss.wsf.spi.deployment.ArchiveDeployment;
-import org.jboss.wsf.spi.deployment.Deployment;
-import org.jboss.wsf.spi.deployment.Endpoint;
-import org.jboss.wsf.spi.deployment.ResourceResolver;
-import org.jboss.wsf.stack.cxf.client.configuration.JBossWSCXFConfigurer;
-import org.jboss.wsf.stack.cxf.configuration.BusHolder;
-
-/**
- * A deployment aspect that creates the CXF Bus early and attaches it to the endpoints (wrapped in a BusHolder)
- *
- * @author alessio.soldano(a)jboss.com
- * @since 25-Mar-2010
- */
-public class BusDeploymentAspect extends AbstractDeploymentAspect
-{
- @SuppressWarnings("unchecked")
- @Override
- public void start(Deployment dep)
- {
- if (Constants.LAZY_LOAD_CXF_BUS)
- return;
-
- log.debug("Lazy load of CXF bus disabled, loading bus during deployment...");
- BusHolder holder;
- ClassLoader origClassLoader = SecurityActions.getContextClassLoader();
- try
- {
- ArchiveDeployment aDep = (ArchiveDeployment)dep;
- //set the runtime classloader (pointing to the deployment unit) to allow CXF accessing to the classes
- SecurityActions.setContextClassLoader(dep.getRuntimeClassLoader());
-
- ResourceResolver deploymentResolver = aDep.getResourceResolver();
-
- URL cxfServletURL = null;
- try
- {
- cxfServletURL = deploymentResolver.resolve("WEB-INF/cxf-servlet.xml");
- }
- catch (IOException e)
- {
- } //ignore, cxf-servlet.xml is optional, we might even decide not to support this
-
- holder = BusHolder.create(cxfServletURL);
-
- Map<String, String> contextParams = (Map<String, String>)dep.getProperty(WSConstants.STACK_CONTEXT_PARAMS);
- try
- {
- URL jbossCxfXml = deploymentResolver.resolve(contextParams.get(BusHolder.PARAM_CXF_BEANS_URL));
- org.apache.cxf.resource.ResourceResolver resolver = new JBossWSResourceResolver(deploymentResolver);
- JBossWSCXFConfigurer configurer = holder.createConfigurer(dep.getAttachment(BindingCustomization.class), new WSDLFilePublisher(aDep));
- holder.configure(jbossCxfXml, new SoapTransportFactoryExt(), resolver, configurer);
- }
- catch (IOException e)
- {
- throw new RuntimeException(e); //re-throw, jboss-cxf.xml is required
- }
- }
- finally
- {
- //clean threadlocals in BusFactory and restore the original classloader
- BusFactory.setDefaultBus(null);
- BusFactory.setThreadDefaultBus(null);
- SecurityActions.setContextClassLoader(origClassLoader);
- }
-
- for (Endpoint endpoint : dep.getService().getEndpoints())
- {
- endpoint.addAttachment(BusHolder.class, holder);
- }
- dep.addAttachment(BusHolder.class, holder);
- }
-
- @Override
- public void stop(Deployment dep)
- {
- for (Endpoint endpoint : dep.getService().getEndpoints())
- {
- BusHolder holder = endpoint.removeAttachment(BusHolder.class);
- if (holder != null)
- {
- holder.close();
- }
- }
- BusHolder holder = dep.removeAttachment(BusHolder.class);
- if (holder != null)
- {
- holder.close();
- }
- }
-}
Modified: stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/CXFServletExt.java
===================================================================
--- stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/CXFServletExt.java 2010-04-01 16:07:54 UTC (rev 11924)
+++ stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/CXFServletExt.java 2010-04-01 17:21:15 UTC (rev 11925)
@@ -57,6 +57,7 @@
import org.jboss.wsf.stack.cxf.client.configuration.JBossWSCXFConfigurer;
import org.jboss.wsf.stack.cxf.configuration.BusHolder;
import org.jboss.wsf.stack.cxf.management.InstrumentationManagerExtImpl;
+import org.jboss.wsf.stack.cxf.transport.SoapTransportFactoryExt;
import org.springframework.context.ApplicationContext;
/**
Deleted: stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/DescriptorDeploymentAspect.java
===================================================================
--- stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/DescriptorDeploymentAspect.java 2010-04-01 16:07:54 UTC (rev 11924)
+++ stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/DescriptorDeploymentAspect.java 2010-04-01 17:21:15 UTC (rev 11925)
@@ -1,236 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2006, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file in the
- * distribution for a full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.wsf.stack.cxf;
-
-import java.io.IOException;
-import java.net.URL;
-import java.util.HashMap;
-import java.util.Map;
-
-import javax.xml.ws.BindingType;
-import javax.xml.ws.soap.MTOM;
-import javax.xml.ws.soap.SOAPBinding;
-
-import org.jboss.logging.Logger;
-import org.jboss.wsf.common.integration.AbstractDeploymentAspect;
-import org.jboss.wsf.common.integration.WSConstants;
-import org.jboss.wsf.spi.deployment.ArchiveDeployment;
-import org.jboss.wsf.spi.deployment.Deployment;
-import org.jboss.wsf.spi.deployment.Endpoint;
-import org.jboss.wsf.spi.deployment.Deployment.DeploymentType;
-import org.jboss.wsf.stack.cxf.configuration.BusHolder;
-import org.jboss.wsf.stack.cxf.metadata.services.DDBeans;
-import org.jboss.wsf.stack.cxf.metadata.services.DDEndpoint;
-
-/**
- * A deployer that locates or generates cxf.xml
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 10-May-2007
- */
-public class DescriptorDeploymentAspect extends AbstractDeploymentAspect
-{
- // provide logging
- private final Logger log = Logger.getLogger(DescriptorDeploymentAspect.class);
-
- private String invokerEJB3;
- private String invokerJSE;
-
- public void setInvokerEJB3(String invokerEJB3)
- {
- this.invokerEJB3 = invokerEJB3;
- }
-
- public void setInvokerJSE(String invokerJSE)
- {
- this.invokerJSE = invokerJSE;
- }
-
- @Override
- public void start(Deployment dep)
- {
- URL cxfURL = getCXFConfigFromClassLoader(dep);
- if (cxfURL == null)
- {
- cxfURL = getCXFConfigFromDeployment(dep);
- if (cxfURL == null)
- {
- cxfURL = generateCXFConfigFromDeployment(dep);
- }
- putCXFConfigToDeployment(dep, cxfURL);
- }
- }
-
- @Override
- public void stop(Deployment dep)
- {
- DDBeans dd = dep.getAttachment(DDBeans.class);
- if (dd != null)
- {
- dd.destroyFileURL();
- }
- }
-
- /**
- * Looks for <b>cxf.xml</b> in classloader
- * @param dep deployment which initial classloader will be used
- * @return <b>cxf.xml URL</b> or <b>null</b> if not found
- */
- private URL getCXFConfigFromClassLoader(Deployment dep)
- {
- ClassLoader initCL = dep.getInitialClassLoader();
- URL cxfURL = initCL.getResource("cxf.xml");
- if (cxfURL != null)
- {
- log.info("CXF configuration found: " + cxfURL);
- }
- return cxfURL;
- }
-
- /**
- * Looks for <b>jbossws-cxf.xml</b> in:
- * <ul>
- * <li><b>META-INF</b> resource directory for EJB3 deployment</li>
- * <li><b>WEB-INF</b> resource directory for POJO deployment</li>
- * </ul>
- * @param dep deployment where to look for resources
- * @return <b>jbossws-cxf.xml URL</b> or <b>null</b> if not found
- */
- private URL getCXFConfigFromDeployment(Deployment dep)
- {
- DeploymentType depType = dep.getType();
-
- String metadir;
- if (depType == DeploymentType.JAXWS_EJB3)
- {
- // expected resource location for EJB3 deployments
- metadir = "META-INF";
- }
- else if (depType == DeploymentType.JAXWS_JSE)
- {
- // expected resource location for POJO deployments
- metadir = "WEB-INF";
- }
- else
- {
- // only POJO and EJB3 deployments are supported
- throw new IllegalStateException("Unsupported deployment type: " + depType);
- }
-
- URL cxfURL = null;
- try
- {
- // get resource URL
- ArchiveDeployment archDep = (ArchiveDeployment)dep;
- cxfURL = archDep.getResourceResolver().resolve(metadir + "/jbossws-cxf.xml");
- log.info("JBossWS-CXF configuration found: " + cxfURL);
- }
- catch (IOException ignore)
- {
- // resource not found
- }
-
- return cxfURL;
- }
-
- /**
- * Generated CXF descriptor from deployment
- * @param dep deployment
- * @return CXF descriptor URL
- */
- private URL generateCXFConfigFromDeployment(Deployment dep)
- {
- // Generate the jbossws-cxf.xml descriptor
- DeploymentType depType = dep.getType();
-
- DDBeans dd = new DDBeans();
- for (Endpoint ep : dep.getService().getEndpoints())
- {
- String id = ep.getShortName();
- String address = ep.getAddress();
- String implementor = ep.getTargetBeanName();
-
- boolean mtomEnabled = isMtomEnabled(ep.getTargetBeanClass());
-
- DDEndpoint ddep = new DDEndpoint(id, address, implementor, mtomEnabled);
-
- if (depType == DeploymentType.JAXWS_EJB3)
- {
- ddep.setInvoker(invokerEJB3);
- }
-
- if (depType == DeploymentType.JAXWS_JSE)
- {
- ddep.setInvoker(invokerJSE);
- }
-
-
- log.info("Add " + ddep);
- dd.addEndpoint(ddep);
- }
-
- URL cxfURL = dd.createFileURL();
- log.info("JBossWS-CXF configuration generated: " + cxfURL);
-
- dep.addAttachment(DDBeans.class, dd);
-
- return cxfURL;
- }
-
- /**
- * Puts CXF config file reference to the stack specific context properties.
- *
- * @param dep webservice deployment
- * @param cxfURL CXF DD URL
- * @see org.jboss.wsf.common.integration.WSConstants.STACK_CONTEXT_PARAMS
- */
- @SuppressWarnings("unchecked")
- private void putCXFConfigToDeployment(Deployment dep, URL cxfURL)
- {
- // get property map
- Map<String, String> contextParams = (Map<String, String>)dep.getProperty(WSConstants.STACK_CONTEXT_PARAMS);
- if (contextParams == null)
- {
- // if there's no associated map with the property create it now
- contextParams = new HashMap<String, String>();
- dep.setProperty(WSConstants.STACK_CONTEXT_PARAMS, contextParams);
- }
- // put cxf config URL to the property map
- contextParams.put(BusHolder.PARAM_CXF_BEANS_URL, cxfURL.toExternalForm());
- }
-
- private static boolean isMtomEnabled(Class<?> beanClass)
- {
- BindingType bindingType = (BindingType)beanClass.getAnnotation(BindingType.class);
- MTOM mtom = (MTOM)beanClass.getAnnotation(MTOM.class);
-
- boolean mtomEnabled = mtom != null;
- if (!mtomEnabled && bindingType != null)
- {
- String binding = bindingType.value();
- mtomEnabled = binding.equals(SOAPBinding.SOAP11HTTP_MTOM_BINDING) || binding.equals(SOAPBinding.SOAP12HTTP_MTOM_BINDING);
- }
-
- return mtomEnabled;
- }
-
-}
Deleted: stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/JBossWSResourceResolver.java
===================================================================
--- stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/JBossWSResourceResolver.java 2010-04-01 16:07:54 UTC (rev 11924)
+++ stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/JBossWSResourceResolver.java 2010-04-01 17:21:15 UTC (rev 11925)
@@ -1,85 +0,0 @@
-/*
- * 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.wsf.stack.cxf;
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.net.URL;
-
-import org.apache.cxf.resource.ResourceResolver;
-import org.jboss.logging.Logger;
-
-/**
- * A CXF resource resolver that uses the JBossWS spi resource resolver,
- * which in turn uses unified virtual files to access resources attached
- * to the deployment (via JBoss VFS).
- *
- * @author alessio.soldano(a)jboss.com
- * @since 17-Nov-2009
- *
- */
-public class JBossWSResourceResolver implements ResourceResolver
-{
- private static Logger log = Logger.getLogger(JBossWSResourceResolver.class);
- private org.jboss.wsf.spi.deployment.ResourceResolver resolver;
-
- public JBossWSResourceResolver(org.jboss.wsf.spi.deployment.ResourceResolver resolver)
- {
- this.resolver = resolver;
- }
-
- public InputStream getAsStream(String resourcePath)
- {
- URL url = resolve(resourcePath, URL.class);
- if (url != null)
- {
- try
- {
- return url.openStream();
- }
- catch (IOException ioe)
- {
- log.warn("Cannot open stream for resource: " + resourcePath);
- }
- }
- return null;
- }
-
- public <T> T resolve(String resourcePath, Class<T> resourceType)
- {
- URL url = null;
- try
- {
- url = resolver.resolve(resourcePath);
- }
- catch (IOException ioe)
- {
- log.warn("Cannot resolve resource: " + resourcePath);
- }
- if (url != null && resourceType.isInstance(url))
- {
- return resourceType.cast(url);
- }
- return null;
- }
-
-}
Deleted: stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/ResourceResolverDeploymentAspect.java
===================================================================
--- stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/ResourceResolverDeploymentAspect.java 2010-04-01 16:07:54 UTC (rev 11924)
+++ stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/ResourceResolverDeploymentAspect.java 2010-04-01 17:21:15 UTC (rev 11925)
@@ -1,65 +0,0 @@
-/*
- * 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.wsf.stack.cxf;
-
-import org.jboss.wsf.common.integration.AbstractDeploymentAspect;
-import org.jboss.wsf.spi.deployment.ArchiveDeployment;
-import org.jboss.wsf.spi.deployment.Deployment;
-import org.jboss.wsf.spi.deployment.Endpoint;
-import org.jboss.wsf.spi.deployment.ResourceResolver;
-
-/**
- * A deployment aspect for attaching a custom JBoss resources resolver to the endpoint;
- * CXF requires a ResourceResolver for getting wsdl, xsd, etc. correctly when they're
- * not reachable using the context classloader (for instance if they're out of
- * WEB-INF/classes in a war deployed on AS 5 or greater - see. JBAS-5151)
- *
- * @author alessio.soldano(a)jboss.com
- * @since 19-Nov-2009
- */
-public class ResourceResolverDeploymentAspect extends AbstractDeploymentAspect
-{
- @Override
- public void start(Deployment dep)
- {
- if (dep instanceof ArchiveDeployment)
- {
- ResourceResolver resolver = ((ArchiveDeployment)dep).getResourceResolver();
- for (Endpoint ep : dep.getService().getEndpoints())
- {
- ep.addAttachment(org.apache.cxf.resource.ResourceResolver.class, new JBossWSResourceResolver(resolver));
- }
- }
- }
-
- @Override
- public void stop(Deployment dep)
- {
- if (dep instanceof ArchiveDeployment)
- {
- for (Endpoint ep : dep.getService().getEndpoints())
- {
- ep.removeAttachment(org.apache.cxf.resource.ResourceResolver.class);
- }
- }
- }
-}
Deleted: stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/SecurityActions.java
===================================================================
--- stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/SecurityActions.java 2010-04-01 16:07:54 UTC (rev 11924)
+++ stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/SecurityActions.java 2010-04-01 17:21:15 UTC (rev 11925)
@@ -1,82 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2010, 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;
-
-import java.security.AccessController;
-import java.security.PrivilegedAction;
-
-/**
- *
- * @author alessio.soldano(a)jboss.com
- * @since 26-Mar-2010
- *
- */
-class SecurityActions
-{
- /**
- * Get context classloader.
- *
- * @return the current context classloader
- */
- static ClassLoader getContextClassLoader()
- {
- SecurityManager sm = System.getSecurityManager();
- if (sm == null)
- {
- return Thread.currentThread().getContextClassLoader();
- }
- else
- {
- return AccessController.doPrivileged(new PrivilegedAction<ClassLoader>() {
- public ClassLoader run()
- {
- return Thread.currentThread().getContextClassLoader();
- }
- });
- }
- }
-
- /**
- * Set context classloader.
- *
- * @param classLoader the classloader
- */
- static void setContextClassLoader(final ClassLoader classLoader)
- {
- if (System.getSecurityManager() == null)
- {
- Thread.currentThread().setContextClassLoader(classLoader);
- }
- else
- {
- AccessController.doPrivileged(new PrivilegedAction<Object>()
- {
- public Object run()
- {
- Thread.currentThread().setContextClassLoader(classLoader);
- return null;
- }
- });
- }
- }
-
-}
Deleted: stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/SoapTransportFactoryExt.java
===================================================================
--- stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/SoapTransportFactoryExt.java 2010-04-01 16:07:54 UTC (rev 11924)
+++ stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/SoapTransportFactoryExt.java 2010-04-01 17:21:15 UTC (rev 11925)
@@ -1,99 +0,0 @@
-/*
- * 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.wsf.stack.cxf;
-
-import java.net.MalformedURLException;
-import java.net.URL;
-import java.util.Iterator;
-import java.util.List;
-
-import javax.wsdl.Port;
-
-import org.apache.cxf.binding.soap.SoapTransportFactory;
-import org.apache.cxf.binding.soap.model.SoapBindingInfo;
-import org.apache.cxf.service.model.BindingInfo;
-import org.apache.cxf.service.model.EndpointInfo;
-import org.apache.cxf.service.model.ServiceInfo;
-import org.apache.cxf.tools.common.extensions.soap.SoapAddress;
-import org.apache.cxf.tools.util.SOAPBindingUtil;
-import org.jboss.logging.Logger;
-import org.jboss.wsf.spi.SPIProvider;
-import org.jboss.wsf.spi.SPIProviderResolver;
-import org.jboss.wsf.spi.management.ServerConfig;
-import org.jboss.wsf.spi.management.ServerConfigFactory;
-
-/**
- * A SoapTransportFactory extending @see org.apache.cxf.binding.soap.SoapTransportFactory.
- * It overrides the EndpointInfo creation method to allow for the soap:address extension
- * of the wsdl to be overwritten according to the JBossWS configuration.
- *
- * @author alessio.soldano(a)jboss.com
- * @since 31-Jul-2009
- *
- */
-public class SoapTransportFactoryExt extends SoapTransportFactory
-{
- private ServerConfig serverConfig;
-
- public EndpointInfo createEndpointInfo(ServiceInfo serviceInfo, BindingInfo b, Port port)
- {
- String transportURI = "http://schemas.xmlsoap.org/wsdl/soap/";
- if (b instanceof SoapBindingInfo)
- {
- SoapBindingInfo sbi = (SoapBindingInfo)b;
- transportURI = sbi.getTransportURI();
- }
- ServerConfig config = getServerConfig();
- EndpointInfo info = new AddressRewritingEndpointInfo(serviceInfo, transportURI, config);
- if (port != null)
- {
- List ees = port.getExtensibilityElements();
- for (Iterator itr = ees.iterator(); itr.hasNext();)
- {
- Object extensor = itr.next();
-
- if (SOAPBindingUtil.isSOAPAddress(extensor))
- {
- final SoapAddress sa = SOAPBindingUtil.getSoapAddress(extensor);
-
- info.addExtensor(sa);
- info.setAddress(sa.getLocationURI());
- }
- else
- {
- info.addExtensor(extensor);
- }
- }
- }
- return info;
- }
-
- private ServerConfig getServerConfig()
- {
- if (serverConfig == null)
- {
- SPIProvider spiProvider = SPIProviderResolver.getInstance().getProvider();
- serverConfig = spiProvider.getSPI(ServerConfigFactory.class).getServerConfig();
- }
- return serverConfig;
- }
-}
Deleted: stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/WSDLFilePublisher.java
===================================================================
--- stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/WSDLFilePublisher.java 2010-04-01 16:07:54 UTC (rev 11924)
+++ stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/WSDLFilePublisher.java 2010-04-01 17:21:15 UTC (rev 11925)
@@ -1,180 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2010, 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;
-
-import java.io.File;
-import java.io.FileOutputStream;
-import java.io.IOException;
-import java.net.URL;
-import java.util.LinkedList;
-import java.util.List;
-
-import javax.wsdl.Definition;
-import javax.wsdl.WSDLException;
-import javax.wsdl.xml.WSDLWriter;
-import javax.xml.namespace.QName;
-import javax.xml.stream.XMLStreamException;
-import javax.xml.stream.XMLStreamWriter;
-
-import org.apache.cxf.Bus;
-import org.apache.cxf.service.model.ServiceInfo;
-import org.apache.cxf.staxutils.StaxUtils;
-import org.apache.cxf.wsdl.WSDLManager;
-import org.apache.cxf.wsdl11.ServiceWSDLBuilder;
-import org.jboss.logging.Logger;
-import org.jboss.util.NotImplementedException;
-import org.jboss.ws.core.utils.AbstractWSDLFilePublisher;
-import org.jboss.wsf.spi.deployment.ArchiveDeployment;
-import org.w3c.dom.Document;
-
-/**
- * A WSDL file publisher for CXF based stack
- *
- * @author alessio.soldano(a)jboss.com
- * @since 25-Mar-2010
- *
- */
-public class WSDLFilePublisher extends AbstractWSDLFilePublisher
-{
- private static final Logger log = Logger.getLogger(WSDLFilePublisher.class);
-
- public WSDLFilePublisher(ArchiveDeployment dep)
- {
- super(dep);
- }
-
- /** Publish the deployed wsdl file to the data directory
- */
- public void publishWsdlFiles(QName serviceName, String wsdlLocation, Bus bus, List<ServiceInfo> serviceInfos) throws IOException
- {
- String deploymentName = dep.getCanonicalName();
- File wsdlFile = getPublishLocation(serviceName.getLocalPart(), deploymentName, wsdlLocation);
- wsdlFile.getParentFile().mkdirs();
- try
- {
- // Write the wsdl def to file
- ServiceWSDLBuilder builder = new ServiceWSDLBuilder(bus, serviceInfos);
- Definition def = builder.build();
-
- Document doc = getWsdlDocument(bus, def);
- writeDocument(doc, wsdlFile);
-
- URL wsdlPublishURL = wsdlFile.toURI().toURL();
- log.info("WSDL published to: " + wsdlPublishURL);
-
- // Process the wsdl imports
- if (def != null)
- {
- List<String> published = new LinkedList<String>();
- publishWsdlImports(wsdlPublishURL, def, published);
-
- // Publish XMLSchema imports
- publishSchemaImports(wsdlPublishURL, doc.getDocumentElement(), published);
- }
- else
- {
- throw new NotImplementedException("WSDL-2.0 imports");
- }
- }
- catch (RuntimeException rte)
- {
- throw rte;
- }
- catch (Exception e)
- {
- throw new RuntimeException("Cannot publish wsdl to: " + wsdlFile, e);
- }
- }
-
- private static Document getWsdlDocument(Bus bus, Definition def) throws WSDLException
- {
- WSDLWriter wsdlWriter = bus.getExtension(WSDLManager.class).getWSDLFactory().newWSDLWriter();
- def.setExtensionRegistry(bus.getExtension(WSDLManager.class).getExtensionRegistry());
- return wsdlWriter.getDocument(def);
- }
-
- private static void writeDocument(Document doc, File file) throws IOException, XMLStreamException
- {
- String enc = null;
- try
- {
- enc = doc.getXmlEncoding();
- }
- catch (Exception ex)
- {
- //ignore - not dom level 3
- }
- if (enc == null)
- {
- enc = "utf-8";
- }
- FileOutputStream fos = new FileOutputStream(file);
- try
- {
- XMLStreamWriter writer = StaxUtils.createXMLStreamWriter(fos, enc);
- StaxUtils.writeNode(doc, writer, true);
- writer.flush();
- }
- finally
- {
- fos.close();
- }
- }
-
- /**
- * Get the file publish location
- */
- private File getPublishLocation(String serviceName, String archiveName, String wsdlLocation) throws IOException
- {
- if (wsdlLocation == null && serviceName == null)
- {
- log.warn("Cannot get wsdl publish location for null wsdl location and serviceName!");
- return null;
- }
-
- //JBWS-2829: windows issue
- if (archiveName.startsWith("http://"))
- {
- archiveName = archiveName.replace("http://", "http-");
- }
-
- File locationFile = new File(serverConfig.getServerDataDir().getCanonicalPath() + "/wsdl/" + archiveName);
-
- File result;
- if (wsdlLocation != null && wsdlLocation.indexOf(expLocation) >= 0)
- {
- wsdlLocation = wsdlLocation.substring(wsdlLocation.indexOf(expLocation) + expLocation.length());
- result = new File(locationFile + "/" + wsdlLocation);
- }
- else if (wsdlLocation != null && (wsdlLocation.startsWith("vfsfile:") || wsdlLocation.startsWith("file:") || wsdlLocation.startsWith("jar:") || wsdlLocation.startsWith("vfszip:")))
- {
- wsdlLocation = wsdlLocation.substring(wsdlLocation.lastIndexOf("/") + 1);
- result = new File(locationFile + "/" + wsdlLocation);
- }
- else
- {
- result = new File(locationFile + "/" + serviceName + ".wsdl");
- }
-
- return result;
- }
-}
Deleted: stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/WebAppResolver.java
===================================================================
--- stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/WebAppResolver.java 2010-04-01 16:07:54 UTC (rev 11924)
+++ stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/WebAppResolver.java 2010-04-01 17:21:15 UTC (rev 11925)
@@ -1,69 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2006, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file in the
- * distribution for a full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.wsf.stack.cxf;
-
-import org.jboss.wsf.spi.management.EndpointResolver;
-import org.jboss.wsf.spi.deployment.Endpoint;
-
-import javax.management.ObjectName;
-import java.util.Iterator;
-
-/**
- * Resolves Endpoints by Servlet name and web context path.
- *
- * @author Heiko.Braun(a)jboss.com
- * Created: Jul 24, 2007
- */
-public class WebAppResolver implements EndpointResolver
-{
- private String contextPath;
- private String servletName;
-
- public WebAppResolver(String contextPath, String servletName)
- {
- this.contextPath = contextPath;
- this.servletName = servletName;
- }
-
- public Endpoint query(Iterator<Endpoint> endpoints)
- {
- Endpoint endpoint = null;
-
- if (contextPath.startsWith("/"))
- contextPath = contextPath.substring(1);
-
- while(endpoints.hasNext())
- {
- Endpoint auxEndpoint = endpoints.next();
- ObjectName sepId = auxEndpoint.getName();
- String propContext = sepId.getKeyProperty(Endpoint.SEPID_PROPERTY_CONTEXT);
- String propEndpoint = sepId.getKeyProperty(Endpoint.SEPID_PROPERTY_ENDPOINT);
- if (servletName.equals(propEndpoint) && contextPath.equals(propContext))
- {
- endpoint = auxEndpoint;
- break;
- }
- }
-
- return endpoint;
- }
-}
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 2010-04-01 16:07:54 UTC (rev 11924)
+++ stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/configuration/BusHolder.java 2010-04-01 17:21:15 UTC (rev 11925)
@@ -40,8 +40,8 @@
import org.jboss.logging.Logger;
import org.jboss.ws.Constants;
import org.jboss.wsf.spi.binding.BindingCustomization;
-import org.jboss.wsf.stack.cxf.WSDLFilePublisher;
import org.jboss.wsf.stack.cxf.client.configuration.JBossWSCXFConfigurer;
+import org.jboss.wsf.stack.cxf.deployment.WSDLFilePublisher;
import org.springframework.beans.factory.xml.XmlBeanDefinitionReader;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.GenericApplicationContext;
Modified: stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/configuration/JBossWSServerCXFConfigurer.java
===================================================================
--- stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/configuration/JBossWSServerCXFConfigurer.java 2010-04-01 16:07:54 UTC (rev 11924)
+++ stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/configuration/JBossWSServerCXFConfigurer.java 2010-04-01 17:21:15 UTC (rev 11925)
@@ -26,9 +26,9 @@
import org.apache.cxf.frontend.AbstractWSDLBasedEndpointFactory;
import org.apache.cxf.service.factory.ReflectionServiceFactoryBean;
import org.jboss.wsf.spi.binding.BindingCustomization;
-import org.jboss.wsf.stack.cxf.WSDLFilePublisher;
import org.jboss.wsf.stack.cxf.client.configuration.JBossWSCXFConfigurer;
import org.jboss.wsf.stack.cxf.deployment.EndpointImpl;
+import org.jboss.wsf.stack.cxf.deployment.WSDLFilePublisher;
/**
* A JBossWSCXFConfigured to be used on server side
Modified: stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/deployment/EndpointImpl.java
===================================================================
--- stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/deployment/EndpointImpl.java 2010-04-01 16:07:54 UTC (rev 11924)
+++ stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/deployment/EndpointImpl.java 2010-04-01 17:21:15 UTC (rev 11925)
@@ -32,7 +32,6 @@
import org.apache.cxf.jaxws.support.JaxWsImplementorInfo;
import org.apache.cxf.service.Service;
import org.jboss.logging.Logger;
-import org.jboss.wsf.stack.cxf.WSDLFilePublisher;
/**
* An extension of @see org.apache.cxf.jaxws.EndpointImpl for dealing with
Copied: stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/deployment/WSDLFilePublisher.java (from rev 11915, stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/WSDLFilePublisher.java)
===================================================================
--- stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/deployment/WSDLFilePublisher.java (rev 0)
+++ stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/deployment/WSDLFilePublisher.java 2010-04-01 17:21:15 UTC (rev 11925)
@@ -0,0 +1,180 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2010, 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.deployment;
+
+import java.io.File;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.net.URL;
+import java.util.LinkedList;
+import java.util.List;
+
+import javax.wsdl.Definition;
+import javax.wsdl.WSDLException;
+import javax.wsdl.xml.WSDLWriter;
+import javax.xml.namespace.QName;
+import javax.xml.stream.XMLStreamException;
+import javax.xml.stream.XMLStreamWriter;
+
+import org.apache.cxf.Bus;
+import org.apache.cxf.service.model.ServiceInfo;
+import org.apache.cxf.staxutils.StaxUtils;
+import org.apache.cxf.wsdl.WSDLManager;
+import org.apache.cxf.wsdl11.ServiceWSDLBuilder;
+import org.jboss.logging.Logger;
+import org.jboss.util.NotImplementedException;
+import org.jboss.ws.core.utils.AbstractWSDLFilePublisher;
+import org.jboss.wsf.spi.deployment.ArchiveDeployment;
+import org.w3c.dom.Document;
+
+/**
+ * A WSDL file publisher for CXF based stack
+ *
+ * @author alessio.soldano(a)jboss.com
+ * @since 25-Mar-2010
+ *
+ */
+public class WSDLFilePublisher extends AbstractWSDLFilePublisher
+{
+ private static final Logger log = Logger.getLogger(WSDLFilePublisher.class);
+
+ public WSDLFilePublisher(ArchiveDeployment dep)
+ {
+ super(dep);
+ }
+
+ /** Publish the deployed wsdl file to the data directory
+ */
+ public void publishWsdlFiles(QName serviceName, String wsdlLocation, Bus bus, List<ServiceInfo> serviceInfos) throws IOException
+ {
+ String deploymentName = dep.getCanonicalName();
+ File wsdlFile = getPublishLocation(serviceName.getLocalPart(), deploymentName, wsdlLocation);
+ wsdlFile.getParentFile().mkdirs();
+ try
+ {
+ // Write the wsdl def to file
+ ServiceWSDLBuilder builder = new ServiceWSDLBuilder(bus, serviceInfos);
+ Definition def = builder.build();
+
+ Document doc = getWsdlDocument(bus, def);
+ writeDocument(doc, wsdlFile);
+
+ URL wsdlPublishURL = wsdlFile.toURI().toURL();
+ log.info("WSDL published to: " + wsdlPublishURL);
+
+ // Process the wsdl imports
+ if (def != null)
+ {
+ List<String> published = new LinkedList<String>();
+ publishWsdlImports(wsdlPublishURL, def, published);
+
+ // Publish XMLSchema imports
+ publishSchemaImports(wsdlPublishURL, doc.getDocumentElement(), published);
+ }
+ else
+ {
+ throw new NotImplementedException("WSDL-2.0 imports");
+ }
+ }
+ catch (RuntimeException rte)
+ {
+ throw rte;
+ }
+ catch (Exception e)
+ {
+ throw new RuntimeException("Cannot publish wsdl to: " + wsdlFile, e);
+ }
+ }
+
+ private static Document getWsdlDocument(Bus bus, Definition def) throws WSDLException
+ {
+ WSDLWriter wsdlWriter = bus.getExtension(WSDLManager.class).getWSDLFactory().newWSDLWriter();
+ def.setExtensionRegistry(bus.getExtension(WSDLManager.class).getExtensionRegistry());
+ return wsdlWriter.getDocument(def);
+ }
+
+ private static void writeDocument(Document doc, File file) throws IOException, XMLStreamException
+ {
+ String enc = null;
+ try
+ {
+ enc = doc.getXmlEncoding();
+ }
+ catch (Exception ex)
+ {
+ //ignore - not dom level 3
+ }
+ if (enc == null)
+ {
+ enc = "utf-8";
+ }
+ FileOutputStream fos = new FileOutputStream(file);
+ try
+ {
+ XMLStreamWriter writer = StaxUtils.createXMLStreamWriter(fos, enc);
+ StaxUtils.writeNode(doc, writer, true);
+ writer.flush();
+ }
+ finally
+ {
+ fos.close();
+ }
+ }
+
+ /**
+ * Get the file publish location
+ */
+ private File getPublishLocation(String serviceName, String archiveName, String wsdlLocation) throws IOException
+ {
+ if (wsdlLocation == null && serviceName == null)
+ {
+ log.warn("Cannot get wsdl publish location for null wsdl location and serviceName!");
+ return null;
+ }
+
+ //JBWS-2829: windows issue
+ if (archiveName.startsWith("http://"))
+ {
+ archiveName = archiveName.replace("http://", "http-");
+ }
+
+ File locationFile = new File(serverConfig.getServerDataDir().getCanonicalPath() + "/wsdl/" + archiveName);
+
+ File result;
+ if (wsdlLocation != null && wsdlLocation.indexOf(expLocation) >= 0)
+ {
+ wsdlLocation = wsdlLocation.substring(wsdlLocation.indexOf(expLocation) + expLocation.length());
+ result = new File(locationFile + "/" + wsdlLocation);
+ }
+ else if (wsdlLocation != null && (wsdlLocation.startsWith("vfsfile:") || wsdlLocation.startsWith("file:") || wsdlLocation.startsWith("jar:") || wsdlLocation.startsWith("vfszip:")))
+ {
+ wsdlLocation = wsdlLocation.substring(wsdlLocation.lastIndexOf("/") + 1);
+ result = new File(locationFile + "/" + wsdlLocation);
+ }
+ else
+ {
+ result = new File(locationFile + "/" + serviceName + ".wsdl");
+ }
+
+ return result;
+ }
+}
Property changes on: stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/deployment/WSDLFilePublisher.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:mergeinfo
+
Name: svn:eol-style
+ LF
Copied: stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/deployment/aspect/BusDeploymentAspect.java (from rev 11915, stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/BusDeploymentAspect.java)
===================================================================
--- stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/deployment/aspect/BusDeploymentAspect.java (rev 0)
+++ stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/deployment/aspect/BusDeploymentAspect.java 2010-04-01 17:21:15 UTC (rev 11925)
@@ -0,0 +1,125 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2010, 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.deployment.aspect;
+
+import java.io.IOException;
+import java.net.URL;
+import java.util.Map;
+
+import org.apache.cxf.BusFactory;
+import org.jboss.ws.Constants;
+import org.jboss.wsf.common.integration.AbstractDeploymentAspect;
+import org.jboss.wsf.common.integration.WSConstants;
+import org.jboss.wsf.spi.binding.BindingCustomization;
+import org.jboss.wsf.spi.deployment.ArchiveDeployment;
+import org.jboss.wsf.spi.deployment.Deployment;
+import org.jboss.wsf.spi.deployment.Endpoint;
+import org.jboss.wsf.spi.deployment.ResourceResolver;
+import org.jboss.wsf.stack.cxf.client.configuration.JBossWSCXFConfigurer;
+import org.jboss.wsf.stack.cxf.configuration.BusHolder;
+import org.jboss.wsf.stack.cxf.deployment.WSDLFilePublisher;
+import org.jboss.wsf.stack.cxf.resolver.JBossWSResourceResolver;
+import org.jboss.wsf.stack.cxf.transport.SoapTransportFactoryExt;
+
+/**
+ * A deployment aspect that creates the CXF Bus early and attaches it to the endpoints (wrapped in a BusHolder)
+ *
+ * @author alessio.soldano(a)jboss.com
+ * @since 25-Mar-2010
+ */
+public class BusDeploymentAspect extends AbstractDeploymentAspect
+{
+ @SuppressWarnings("unchecked")
+ @Override
+ public void start(Deployment dep)
+ {
+ if (Constants.LAZY_LOAD_CXF_BUS)
+ return;
+
+ log.debug("Lazy load of CXF bus disabled, loading bus during deployment...");
+ BusHolder holder;
+ ClassLoader origClassLoader = SecurityActions.getContextClassLoader();
+ try
+ {
+ ArchiveDeployment aDep = (ArchiveDeployment)dep;
+ //set the runtime classloader (pointing to the deployment unit) to allow CXF accessing to the classes
+ SecurityActions.setContextClassLoader(dep.getRuntimeClassLoader());
+
+ ResourceResolver deploymentResolver = aDep.getResourceResolver();
+
+ URL cxfServletURL = null;
+ try
+ {
+ cxfServletURL = deploymentResolver.resolve("WEB-INF/cxf-servlet.xml");
+ }
+ catch (IOException e)
+ {
+ } //ignore, cxf-servlet.xml is optional, we might even decide not to support this
+
+ holder = BusHolder.create(cxfServletURL);
+
+ Map<String, String> contextParams = (Map<String, String>)dep.getProperty(WSConstants.STACK_CONTEXT_PARAMS);
+ try
+ {
+ URL jbossCxfXml = deploymentResolver.resolve(contextParams.get(BusHolder.PARAM_CXF_BEANS_URL));
+ org.apache.cxf.resource.ResourceResolver resolver = new JBossWSResourceResolver(deploymentResolver);
+ JBossWSCXFConfigurer configurer = holder.createConfigurer(dep.getAttachment(BindingCustomization.class), new WSDLFilePublisher(aDep));
+ holder.configure(jbossCxfXml, new SoapTransportFactoryExt(), resolver, configurer);
+ }
+ catch (IOException e)
+ {
+ throw new RuntimeException(e); //re-throw, jboss-cxf.xml is required
+ }
+ }
+ finally
+ {
+ //clean threadlocals in BusFactory and restore the original classloader
+ BusFactory.setDefaultBus(null);
+ BusFactory.setThreadDefaultBus(null);
+ SecurityActions.setContextClassLoader(origClassLoader);
+ }
+
+ for (Endpoint endpoint : dep.getService().getEndpoints())
+ {
+ endpoint.addAttachment(BusHolder.class, holder);
+ }
+ dep.addAttachment(BusHolder.class, holder);
+ }
+
+ @Override
+ public void stop(Deployment dep)
+ {
+ for (Endpoint endpoint : dep.getService().getEndpoints())
+ {
+ BusHolder holder = endpoint.removeAttachment(BusHolder.class);
+ if (holder != null)
+ {
+ holder.close();
+ }
+ }
+ BusHolder holder = dep.removeAttachment(BusHolder.class);
+ if (holder != null)
+ {
+ holder.close();
+ }
+ }
+}
Property changes on: stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/deployment/aspect/BusDeploymentAspect.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:mergeinfo
+
Name: svn:eol-style
+ LF
Copied: stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/deployment/aspect/DescriptorDeploymentAspect.java (from rev 11924, stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/DescriptorDeploymentAspect.java)
===================================================================
--- stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/deployment/aspect/DescriptorDeploymentAspect.java (rev 0)
+++ stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/deployment/aspect/DescriptorDeploymentAspect.java 2010-04-01 17:21:15 UTC (rev 11925)
@@ -0,0 +1,236 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.wsf.stack.cxf.deployment.aspect;
+
+import java.io.IOException;
+import java.net.URL;
+import java.util.HashMap;
+import java.util.Map;
+
+import javax.xml.ws.BindingType;
+import javax.xml.ws.soap.MTOM;
+import javax.xml.ws.soap.SOAPBinding;
+
+import org.jboss.logging.Logger;
+import org.jboss.wsf.common.integration.AbstractDeploymentAspect;
+import org.jboss.wsf.common.integration.WSConstants;
+import org.jboss.wsf.spi.deployment.ArchiveDeployment;
+import org.jboss.wsf.spi.deployment.Deployment;
+import org.jboss.wsf.spi.deployment.Endpoint;
+import org.jboss.wsf.spi.deployment.Deployment.DeploymentType;
+import org.jboss.wsf.stack.cxf.configuration.BusHolder;
+import org.jboss.wsf.stack.cxf.metadata.services.DDBeans;
+import org.jboss.wsf.stack.cxf.metadata.services.DDEndpoint;
+
+/**
+ * A deployer that locates or generates cxf.xml
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 10-May-2007
+ */
+public class DescriptorDeploymentAspect extends AbstractDeploymentAspect
+{
+ // provide logging
+ private final Logger log = Logger.getLogger(DescriptorDeploymentAspect.class);
+
+ private String invokerEJB3;
+ private String invokerJSE;
+
+ public void setInvokerEJB3(String invokerEJB3)
+ {
+ this.invokerEJB3 = invokerEJB3;
+ }
+
+ public void setInvokerJSE(String invokerJSE)
+ {
+ this.invokerJSE = invokerJSE;
+ }
+
+ @Override
+ public void start(Deployment dep)
+ {
+ URL cxfURL = getCXFConfigFromClassLoader(dep);
+ if (cxfURL == null)
+ {
+ cxfURL = getCXFConfigFromDeployment(dep);
+ if (cxfURL == null)
+ {
+ cxfURL = generateCXFConfigFromDeployment(dep);
+ }
+ putCXFConfigToDeployment(dep, cxfURL);
+ }
+ }
+
+ @Override
+ public void stop(Deployment dep)
+ {
+ DDBeans dd = dep.getAttachment(DDBeans.class);
+ if (dd != null)
+ {
+ dd.destroyFileURL();
+ }
+ }
+
+ /**
+ * Looks for <b>cxf.xml</b> in classloader
+ * @param dep deployment which initial classloader will be used
+ * @return <b>cxf.xml URL</b> or <b>null</b> if not found
+ */
+ private URL getCXFConfigFromClassLoader(Deployment dep)
+ {
+ ClassLoader initCL = dep.getInitialClassLoader();
+ URL cxfURL = initCL.getResource("cxf.xml");
+ if (cxfURL != null)
+ {
+ log.info("CXF configuration found: " + cxfURL);
+ }
+ return cxfURL;
+ }
+
+ /**
+ * Looks for <b>jbossws-cxf.xml</b> in:
+ * <ul>
+ * <li><b>META-INF</b> resource directory for EJB3 deployment</li>
+ * <li><b>WEB-INF</b> resource directory for POJO deployment</li>
+ * </ul>
+ * @param dep deployment where to look for resources
+ * @return <b>jbossws-cxf.xml URL</b> or <b>null</b> if not found
+ */
+ private URL getCXFConfigFromDeployment(Deployment dep)
+ {
+ DeploymentType depType = dep.getType();
+
+ String metadir;
+ if (depType == DeploymentType.JAXWS_EJB3)
+ {
+ // expected resource location for EJB3 deployments
+ metadir = "META-INF";
+ }
+ else if (depType == DeploymentType.JAXWS_JSE)
+ {
+ // expected resource location for POJO deployments
+ metadir = "WEB-INF";
+ }
+ else
+ {
+ // only POJO and EJB3 deployments are supported
+ throw new IllegalStateException("Unsupported deployment type: " + depType);
+ }
+
+ URL cxfURL = null;
+ try
+ {
+ // get resource URL
+ ArchiveDeployment archDep = (ArchiveDeployment)dep;
+ cxfURL = archDep.getResourceResolver().resolve(metadir + "/jbossws-cxf.xml");
+ log.info("JBossWS-CXF configuration found: " + cxfURL);
+ }
+ catch (IOException ignore)
+ {
+ // resource not found
+ }
+
+ return cxfURL;
+ }
+
+ /**
+ * Generated CXF descriptor from deployment
+ * @param dep deployment
+ * @return CXF descriptor URL
+ */
+ private URL generateCXFConfigFromDeployment(Deployment dep)
+ {
+ // Generate the jbossws-cxf.xml descriptor
+ DeploymentType depType = dep.getType();
+
+ DDBeans dd = new DDBeans();
+ for (Endpoint ep : dep.getService().getEndpoints())
+ {
+ String id = ep.getShortName();
+ String address = ep.getAddress();
+ String implementor = ep.getTargetBeanName();
+
+ boolean mtomEnabled = isMtomEnabled(ep.getTargetBeanClass());
+
+ DDEndpoint ddep = new DDEndpoint(id, address, implementor, mtomEnabled);
+
+ if (depType == DeploymentType.JAXWS_EJB3)
+ {
+ ddep.setInvoker(invokerEJB3);
+ }
+
+ if (depType == DeploymentType.JAXWS_JSE)
+ {
+ ddep.setInvoker(invokerJSE);
+ }
+
+
+ log.info("Add " + ddep);
+ dd.addEndpoint(ddep);
+ }
+
+ URL cxfURL = dd.createFileURL();
+ log.info("JBossWS-CXF configuration generated: " + cxfURL);
+
+ dep.addAttachment(DDBeans.class, dd);
+
+ return cxfURL;
+ }
+
+ /**
+ * Puts CXF config file reference to the stack specific context properties.
+ *
+ * @param dep webservice deployment
+ * @param cxfURL CXF DD URL
+ * @see org.jboss.wsf.common.integration.WSConstants.STACK_CONTEXT_PARAMS
+ */
+ @SuppressWarnings("unchecked")
+ private void putCXFConfigToDeployment(Deployment dep, URL cxfURL)
+ {
+ // get property map
+ Map<String, String> contextParams = (Map<String, String>)dep.getProperty(WSConstants.STACK_CONTEXT_PARAMS);
+ if (contextParams == null)
+ {
+ // if there's no associated map with the property create it now
+ contextParams = new HashMap<String, String>();
+ dep.setProperty(WSConstants.STACK_CONTEXT_PARAMS, contextParams);
+ }
+ // put cxf config URL to the property map
+ contextParams.put(BusHolder.PARAM_CXF_BEANS_URL, cxfURL.toExternalForm());
+ }
+
+ private static boolean isMtomEnabled(Class<?> beanClass)
+ {
+ BindingType bindingType = (BindingType)beanClass.getAnnotation(BindingType.class);
+ MTOM mtom = (MTOM)beanClass.getAnnotation(MTOM.class);
+
+ boolean mtomEnabled = mtom != null;
+ if (!mtomEnabled && bindingType != null)
+ {
+ String binding = bindingType.value();
+ mtomEnabled = binding.equals(SOAPBinding.SOAP11HTTP_MTOM_BINDING) || binding.equals(SOAPBinding.SOAP12HTTP_MTOM_BINDING);
+ }
+
+ return mtomEnabled;
+ }
+
+}
Property changes on: stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/deployment/aspect/DescriptorDeploymentAspect.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:mergeinfo
+
Name: svn:eol-style
+ LF
Copied: stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/deployment/aspect/ResourceResolverDeploymentAspect.java (from rev 11915, stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/ResourceResolverDeploymentAspect.java)
===================================================================
--- stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/deployment/aspect/ResourceResolverDeploymentAspect.java (rev 0)
+++ stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/deployment/aspect/ResourceResolverDeploymentAspect.java 2010-04-01 17:21:15 UTC (rev 11925)
@@ -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.wsf.stack.cxf.deployment.aspect;
+
+import org.jboss.wsf.common.integration.AbstractDeploymentAspect;
+import org.jboss.wsf.spi.deployment.ArchiveDeployment;
+import org.jboss.wsf.spi.deployment.Deployment;
+import org.jboss.wsf.spi.deployment.Endpoint;
+import org.jboss.wsf.spi.deployment.ResourceResolver;
+import org.jboss.wsf.stack.cxf.resolver.JBossWSResourceResolver;
+
+/**
+ * A deployment aspect for attaching a custom JBoss resources resolver to the endpoint;
+ * CXF requires a ResourceResolver for getting wsdl, xsd, etc. correctly when they're
+ * not reachable using the context classloader (for instance if they're out of
+ * WEB-INF/classes in a war deployed on AS 5 or greater - see. JBAS-5151)
+ *
+ * @author alessio.soldano(a)jboss.com
+ * @since 19-Nov-2009
+ */
+public class ResourceResolverDeploymentAspect extends AbstractDeploymentAspect
+{
+ @Override
+ public void start(Deployment dep)
+ {
+ if (dep instanceof ArchiveDeployment)
+ {
+ ResourceResolver resolver = ((ArchiveDeployment)dep).getResourceResolver();
+ for (Endpoint ep : dep.getService().getEndpoints())
+ {
+ ep.addAttachment(org.apache.cxf.resource.ResourceResolver.class, new JBossWSResourceResolver(resolver));
+ }
+ }
+ }
+
+ @Override
+ public void stop(Deployment dep)
+ {
+ if (dep instanceof ArchiveDeployment)
+ {
+ for (Endpoint ep : dep.getService().getEndpoints())
+ {
+ ep.removeAttachment(org.apache.cxf.resource.ResourceResolver.class);
+ }
+ }
+ }
+}
Property changes on: stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/deployment/aspect/ResourceResolverDeploymentAspect.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:mergeinfo
+
Name: svn:eol-style
+ LF
Added: stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/deployment/aspect/SecurityActions.java
===================================================================
--- stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/deployment/aspect/SecurityActions.java (rev 0)
+++ stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/deployment/aspect/SecurityActions.java 2010-04-01 17:21:15 UTC (rev 11925)
@@ -0,0 +1,82 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2010, 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.deployment.aspect;
+
+import java.security.AccessController;
+import java.security.PrivilegedAction;
+
+/**
+ *
+ * @author alessio.soldano(a)jboss.com
+ * @since 26-Mar-2010
+ *
+ */
+class SecurityActions
+{
+ /**
+ * Get context classloader.
+ *
+ * @return the current context classloader
+ */
+ static ClassLoader getContextClassLoader()
+ {
+ SecurityManager sm = System.getSecurityManager();
+ if (sm == null)
+ {
+ return Thread.currentThread().getContextClassLoader();
+ }
+ else
+ {
+ return AccessController.doPrivileged(new PrivilegedAction<ClassLoader>() {
+ public ClassLoader run()
+ {
+ return Thread.currentThread().getContextClassLoader();
+ }
+ });
+ }
+ }
+
+ /**
+ * Set context classloader.
+ *
+ * @param classLoader the classloader
+ */
+ static void setContextClassLoader(final ClassLoader classLoader)
+ {
+ if (System.getSecurityManager() == null)
+ {
+ Thread.currentThread().setContextClassLoader(classLoader);
+ }
+ else
+ {
+ AccessController.doPrivileged(new PrivilegedAction<Object>()
+ {
+ public Object run()
+ {
+ Thread.currentThread().setContextClassLoader(classLoader);
+ return null;
+ }
+ });
+ }
+ }
+
+}
Property changes on: stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/deployment/aspect/SecurityActions.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Copied: stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/resolver/JBossWSResourceResolver.java (from rev 11915, stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/JBossWSResourceResolver.java)
===================================================================
--- stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/resolver/JBossWSResourceResolver.java (rev 0)
+++ stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/resolver/JBossWSResourceResolver.java 2010-04-01 17:21:15 UTC (rev 11925)
@@ -0,0 +1,85 @@
+/*
+ * 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.wsf.stack.cxf.resolver;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.net.URL;
+
+import org.apache.cxf.resource.ResourceResolver;
+import org.jboss.logging.Logger;
+
+/**
+ * A CXF resource resolver that uses the JBossWS spi resource resolver,
+ * which in turn uses unified virtual files to access resources attached
+ * to the deployment (via JBoss VFS).
+ *
+ * @author alessio.soldano(a)jboss.com
+ * @since 17-Nov-2009
+ *
+ */
+public class JBossWSResourceResolver implements ResourceResolver
+{
+ private static Logger log = Logger.getLogger(JBossWSResourceResolver.class);
+ private org.jboss.wsf.spi.deployment.ResourceResolver resolver;
+
+ public JBossWSResourceResolver(org.jboss.wsf.spi.deployment.ResourceResolver resolver)
+ {
+ this.resolver = resolver;
+ }
+
+ public InputStream getAsStream(String resourcePath)
+ {
+ URL url = resolve(resourcePath, URL.class);
+ if (url != null)
+ {
+ try
+ {
+ return url.openStream();
+ }
+ catch (IOException ioe)
+ {
+ log.warn("Cannot open stream for resource: " + resourcePath);
+ }
+ }
+ return null;
+ }
+
+ public <T> T resolve(String resourcePath, Class<T> resourceType)
+ {
+ URL url = null;
+ try
+ {
+ url = resolver.resolve(resourcePath);
+ }
+ catch (IOException ioe)
+ {
+ log.warn("Cannot resolve resource: " + resourcePath);
+ }
+ if (url != null && resourceType.isInstance(url))
+ {
+ return resourceType.cast(url);
+ }
+ return null;
+ }
+
+}
Property changes on: stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/resolver/JBossWSResourceResolver.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:mergeinfo
+
Name: svn:eol-style
+ LF
Copied: stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/resolver/WebAppResolver.java (from rev 11915, stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/WebAppResolver.java)
===================================================================
--- stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/resolver/WebAppResolver.java (rev 0)
+++ stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/resolver/WebAppResolver.java 2010-04-01 17:21:15 UTC (rev 11925)
@@ -0,0 +1,69 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.wsf.stack.cxf.resolver;
+
+import org.jboss.wsf.spi.management.EndpointResolver;
+import org.jboss.wsf.spi.deployment.Endpoint;
+
+import javax.management.ObjectName;
+import java.util.Iterator;
+
+/**
+ * Resolves Endpoints by Servlet name and web context path.
+ *
+ * @author Heiko.Braun(a)jboss.com
+ * Created: Jul 24, 2007
+ */
+public class WebAppResolver implements EndpointResolver
+{
+ private String contextPath;
+ private String servletName;
+
+ public WebAppResolver(String contextPath, String servletName)
+ {
+ this.contextPath = contextPath;
+ this.servletName = servletName;
+ }
+
+ public Endpoint query(Iterator<Endpoint> endpoints)
+ {
+ Endpoint endpoint = null;
+
+ if (contextPath.startsWith("/"))
+ contextPath = contextPath.substring(1);
+
+ while(endpoints.hasNext())
+ {
+ Endpoint auxEndpoint = endpoints.next();
+ ObjectName sepId = auxEndpoint.getName();
+ String propContext = sepId.getKeyProperty(Endpoint.SEPID_PROPERTY_CONTEXT);
+ String propEndpoint = sepId.getKeyProperty(Endpoint.SEPID_PROPERTY_ENDPOINT);
+ if (servletName.equals(propEndpoint) && contextPath.equals(propContext))
+ {
+ endpoint = auxEndpoint;
+ break;
+ }
+ }
+
+ return endpoint;
+ }
+}
Property changes on: stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/resolver/WebAppResolver.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:mergeinfo
+
Name: svn:eol-style
+ LF
Copied: stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/transport/AddressRewritingEndpointInfo.java (from rev 11915, stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/AddressRewritingEndpointInfo.java)
===================================================================
--- stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/transport/AddressRewritingEndpointInfo.java (rev 0)
+++ stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/transport/AddressRewritingEndpointInfo.java 2010-04-01 17:21:15 UTC (rev 11925)
@@ -0,0 +1,212 @@
+/*
+ * 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.wsf.stack.cxf.transport;
+
+import java.net.URI;
+import java.net.URL;
+
+import org.apache.cxf.service.model.EndpointInfo;
+import org.apache.cxf.service.model.ServiceInfo;
+import org.apache.cxf.tools.common.extensions.soap.SoapAddress;
+import org.jboss.logging.Logger;
+import org.jboss.wsf.spi.management.ServerConfig;
+
+/**
+ * A custom EndpointInfo that updates the SoapAddress extension
+ * coming from the wsdl definition according to the JBossWS
+ * soap address rewrite rules.
+ *
+ * @see org.apache.cxf.binding.soap.SoapTransportFactory.SoapEndpointInfo
+ *
+ * @author alessio.soldano(a)jboss.com
+ * @since 03-Aug-2009
+ *
+ */
+public class AddressRewritingEndpointInfo extends EndpointInfo
+{
+ private static Logger log = Logger.getLogger(AddressRewritingEndpointInfo.class);
+
+ private ServerConfig serverConfig;
+ SoapAddress saddress;
+
+ AddressRewritingEndpointInfo(ServiceInfo serv, String trans, ServerConfig serverConfig)
+ {
+ super(serv, trans);
+ this.serverConfig = serverConfig;
+ }
+
+ /**
+ * This is the method responsible for both setting the EndpointInfo address and
+ * setting the soap:address in the wsdl.
+ * While the former action is straightforward, the latter is performed according
+ * to the JBossWS configuration: every time CXF updates the EndpointInfo address
+ * (which usually happens twice) this makes sure a proper address is updated in
+ * the wsdl.
+ *
+ * {@inheritDoc}
+ */
+ public void setAddress(String s)
+ {
+ String previousAddress = super.getAddress();
+ super.setAddress(s);
+ boolean setNewAddress = false;
+ if (previousAddress == null)
+ {
+ setNewAddress = true;
+ }
+ else if (isRewriteAllowed(s) && isRewriteRequired(s, previousAddress))
+ {
+ String uriScheme = getUriScheme(s);
+ //we set https if the transport guarantee is CONFIDENTIAL or the previous address already used https
+ //(if the original wsdl soap:address uses https we can't overwrite it with http)
+ if ("https".equalsIgnoreCase(getUriScheme(previousAddress)))
+ {
+ uriScheme = "https";
+ }
+ if (uriScheme == null)
+ {
+ uriScheme = "http";
+ }
+ //rewrite the candidate new address
+ s = rewriteSoapAddress(s, uriScheme);
+ setNewAddress = true;
+ }
+ if (setNewAddress && saddress != null)
+ {
+ log.info("Setting new service endpoint address in wsdl: " + s);
+ saddress.setLocationURI(s);
+ }
+ }
+
+ public void addExtensor(Object el)
+ {
+ super.addExtensor(el);
+ if (el instanceof SoapAddress)
+ {
+ saddress = (SoapAddress)el;
+ }
+ }
+
+ protected boolean isRewriteAllowed(String address)
+ {
+ //exclude non http addresses
+ return (address != null && address.trim().toLowerCase().startsWith("http"));
+ }
+
+
+ protected boolean isRewriteRequired(String address, String previousAddress)
+ {
+ //check config prop forcing address rewrite
+ if (serverConfig.isModifySOAPAddress())
+ {
+ log.debug("Rewrite required because of configuration");
+ return true;
+ }
+ //check if the previous address is not valid
+ if (isInvalidAddress(previousAddress))
+ {
+ log.debug("Rewrite required because of invalid url");
+ return true;
+ }
+ log.debug("Rewrite not required");
+ return false;
+ }
+
+ protected boolean isInvalidAddress(String address)
+ {
+ if (address == null)
+ {
+ return true;
+ }
+ String s = address.trim();
+ if (s.length() == 0 || s.contains("REPLACE_WITH_ACTUAL_URL"))
+ {
+ return true;
+ }
+ try
+ {
+ new URL(s);
+ }
+ catch (Exception e)
+ {
+ return true;
+ }
+ return false;
+ }
+
+ /**
+ * Rewrite the provided address according to the current server
+ * configuration and always using the specified uriScheme.
+ *
+ * @param s The source address
+ * @param uriScheme The uriScheme to use for rewrite
+ * @return The obtained address
+ */
+ protected String rewriteSoapAddress(String s, String uriScheme)
+ {
+ try
+ {
+ URL url = new URL(s);
+ String path = url.getPath();
+ String host = serverConfig.getWebServiceHost();
+ String port = "";
+ if ("https".equals(uriScheme))
+ {
+ int portNo = serverConfig.getWebServiceSecurePort();
+ if (portNo != 443)
+ {
+ port = ":" + portNo;
+ }
+ }
+ else
+ {
+ int portNo = serverConfig.getWebServicePort();
+ if (portNo != 80)
+ {
+ port = ":" + portNo;
+ }
+ }
+ String urlStr = uriScheme + "://" + host + port + path;
+ log.debug("Rewritten new candidate service endpoint address '" + s + "' to '" + urlStr + "'");
+ return urlStr;
+ }
+ catch (Exception e)
+ {
+ log.debug("Invalid url provided, using it without rewriting: " + s);
+ return s;
+ }
+ }
+
+ private static String getUriScheme(String address)
+ {
+ try
+ {
+ URI addrURI = new URI(address);
+ String scheme = addrURI.getScheme();
+ return scheme;
+ }
+ catch (Exception e)
+ {
+ return null;
+ }
+ }
+}
Property changes on: stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/transport/AddressRewritingEndpointInfo.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:mergeinfo
+
Name: svn:eol-style
+ LF
Copied: stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/transport/SoapTransportFactoryExt.java (from rev 11915, stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/SoapTransportFactoryExt.java)
===================================================================
--- stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/transport/SoapTransportFactoryExt.java (rev 0)
+++ stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/transport/SoapTransportFactoryExt.java 2010-04-01 17:21:15 UTC (rev 11925)
@@ -0,0 +1,97 @@
+/*
+ * 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.wsf.stack.cxf.transport;
+
+import java.util.Iterator;
+import java.util.List;
+
+import javax.wsdl.Port;
+
+import org.apache.cxf.binding.soap.SoapTransportFactory;
+import org.apache.cxf.binding.soap.model.SoapBindingInfo;
+import org.apache.cxf.service.model.BindingInfo;
+import org.apache.cxf.service.model.EndpointInfo;
+import org.apache.cxf.service.model.ServiceInfo;
+import org.apache.cxf.tools.common.extensions.soap.SoapAddress;
+import org.apache.cxf.tools.util.SOAPBindingUtil;
+import org.jboss.wsf.spi.SPIProvider;
+import org.jboss.wsf.spi.SPIProviderResolver;
+import org.jboss.wsf.spi.management.ServerConfig;
+import org.jboss.wsf.spi.management.ServerConfigFactory;
+
+/**
+ * A SoapTransportFactory extending @see org.apache.cxf.binding.soap.SoapTransportFactory.
+ * It overrides the EndpointInfo creation method to allow for the soap:address extension
+ * of the wsdl to be overwritten according to the JBossWS configuration.
+ *
+ * @author alessio.soldano(a)jboss.com
+ * @since 31-Jul-2009
+ *
+ */
+public class SoapTransportFactoryExt extends SoapTransportFactory
+{
+ private ServerConfig serverConfig;
+
+ @SuppressWarnings("unchecked")
+ public EndpointInfo createEndpointInfo(ServiceInfo serviceInfo, BindingInfo b, Port port)
+ {
+ String transportURI = "http://schemas.xmlsoap.org/wsdl/soap/";
+ if (b instanceof SoapBindingInfo)
+ {
+ SoapBindingInfo sbi = (SoapBindingInfo)b;
+ transportURI = sbi.getTransportURI();
+ }
+ ServerConfig config = getServerConfig();
+ EndpointInfo info = new AddressRewritingEndpointInfo(serviceInfo, transportURI, config);
+ if (port != null)
+ {
+ List ees = port.getExtensibilityElements();
+ for (Iterator itr = ees.iterator(); itr.hasNext();)
+ {
+ Object extensor = itr.next();
+
+ if (SOAPBindingUtil.isSOAPAddress(extensor))
+ {
+ final SoapAddress sa = SOAPBindingUtil.getSoapAddress(extensor);
+
+ info.addExtensor(sa);
+ info.setAddress(sa.getLocationURI());
+ }
+ else
+ {
+ info.addExtensor(extensor);
+ }
+ }
+ }
+ return info;
+ }
+
+ private ServerConfig getServerConfig()
+ {
+ if (serverConfig == null)
+ {
+ SPIProvider spiProvider = SPIProviderResolver.getInstance().getProvider();
+ serverConfig = spiProvider.getSPI(ServerConfigFactory.class).getServerConfig();
+ }
+ return serverConfig;
+ }
+}
Property changes on: stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/transport/SoapTransportFactoryExt.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:mergeinfo
+
Name: svn:eol-style
+ LF
Modified: stack/cxf/trunk/modules/server/src/main/resources/jbossws-cxf-config-as5.xml
===================================================================
--- stack/cxf/trunk/modules/server/src/main/resources/jbossws-cxf-config-as5.xml 2010-04-01 16:07:54 UTC (rev 11924)
+++ stack/cxf/trunk/modules/server/src/main/resources/jbossws-cxf-config-as5.xml 2010-04-01 17:21:15 UTC (rev 11925)
@@ -38,7 +38,7 @@
<property name="relativeOrder">31</property> <!-- [JBDEPLOY-201] workaround -->
</bean>
- <bean name="WSCXFDescriptorDeploymentAspect" class="org.jboss.wsf.stack.cxf.DescriptorDeploymentAspect">
+ <bean name="WSCXFDescriptorDeploymentAspect" class="org.jboss.wsf.stack.cxf.deployment.aspect.DescriptorDeploymentAspect">
<property name="requires">EndpointAddress,JAXBIntros</property>
<property name="provides">StackDescriptor</property>
<property name="invokerEJB3">org.jboss.wsf.stack.cxf.InvokerEJB3</property>
@@ -46,7 +46,7 @@
<property name="relativeOrder">21</property> <!-- [JBDEPLOY-201] workaround -->
</bean>
- <bean name="ResourceResolverDeploymentAspect" class="org.jboss.wsf.stack.cxf.ResourceResolverDeploymentAspect">
+ <bean name="WSCXFResourceResolverDeploymentAspect" class="org.jboss.wsf.stack.cxf.deployment.aspect.ResourceResolverDeploymentAspect">
<property name="requires">JmsEndpointAddress</property>
<property name="provides">ResourceResolver</property>
<property name="relativeOrder">23</property> <!-- [JBDEPLOY-201] workaround -->
@@ -76,7 +76,7 @@
<property name="relativeOrder">20</property> <!-- [JBDEPLOY-201] workaround -->
</bean>
- <bean name="WSCXFBusDeploymentAspect" class="org.jboss.wsf.stack.cxf.BusDeploymentAspect">
+ <bean name="WSCXFBusDeploymentAspect" class="org.jboss.wsf.stack.cxf.deployment.aspect.BusDeploymentAspect">
<property name="provides">BusHolder</property>
<property name="requires">ResourceResolver,StackDescriptor</property>
<property name="relativeOrder">24</property> <!-- [JBDEPLOY-201] workaround -->
Modified: stack/cxf/trunk/modules/server/src/main/resources/jbossws-cxf-config-as6.xml
===================================================================
--- stack/cxf/trunk/modules/server/src/main/resources/jbossws-cxf-config-as6.xml 2010-04-01 16:07:54 UTC (rev 11924)
+++ stack/cxf/trunk/modules/server/src/main/resources/jbossws-cxf-config-as6.xml 2010-04-01 17:21:15 UTC (rev 11925)
@@ -38,7 +38,7 @@
<property name="forJaxRpc">false</property>
</bean>
- <bean name="WSCXFDescriptorDeploymentAspect" class="org.jboss.wsf.stack.cxf.DescriptorDeploymentAspect">
+ <bean name="WSCXFDescriptorDeploymentAspect" class="org.jboss.wsf.stack.cxf.deployment.aspect.DescriptorDeploymentAspect">
<property name="requires">EndpointAddress,JAXBIntros</property>
<property name="provides">StackDescriptor</property>
<property name="invokerEJB3">org.jboss.wsf.stack.cxf.InvokerEJB3</property>
@@ -46,7 +46,7 @@
<property name="forJaxRpc">false</property>
</bean>
- <bean name="ResourceResolverDeploymentAspect" class="org.jboss.wsf.stack.cxf.ResourceResolverDeploymentAspect">
+ <bean name="WSCXFResourceResolverDeploymentAspect" class="org.jboss.wsf.stack.cxf.deployment.aspect.ResourceResolverDeploymentAspect">
<property name="requires">JmsEndpointAddress</property>
<property name="provides">ResourceResolver</property>
<property name="forJaxRpc">false</property>
@@ -76,7 +76,7 @@
<property name="forJaxRpc">false</property>
</bean>
- <bean name="WSCXFBusDeploymentAspect" class="org.jboss.wsf.stack.cxf.BusDeploymentAspect">
+ <bean name="WSCXFBusDeploymentAspect" class="org.jboss.wsf.stack.cxf.deployment.aspect.BusDeploymentAspect">
<property name="provides">BusHolder</property>
<property name="requires">ResourceResolver,StackDescriptor</property>
<property name="forJaxRpc">false</property>
14 years, 8 months
JBossWS SVN: r11924 - in stack/cxf/trunk/modules: server/src/main/java/org/jboss/wsf/stack/cxf and 6 other directories.
by jbossws-commits@lists.jboss.org
Author: alessio.soldano(a)jboss.com
Date: 2010-04-01 12:07:54 -0400 (Thu, 01 Apr 2010)
New Revision: 11924
Added:
stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/deployment/
stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/deployment/EndpointImpl.java
stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/deployment/aspect/
stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/spring/
stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/spring/handler/
stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/spring/handler/JaxwsNamespaceHandler.java
stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/spring/parser/
stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/spring/parser/JaxwsEndpointDefinitionParser.java
Removed:
stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/JBossWSServiceFactoryBean.java
Modified:
stack/cxf/trunk/modules/client/src/main/resources/META-INF/spring.handlers
stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/DescriptorDeploymentAspect.java
stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/configuration/JBossWSServerCXFConfigurer.java
stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/metadata/services/DDEndpoint.java
Log:
[JBWS-2971] Removing JBossWSServiceFactoryBean and providing proper integration through customized Spring NamespaceHandlerSupport
Modified: stack/cxf/trunk/modules/client/src/main/resources/META-INF/spring.handlers
===================================================================
--- stack/cxf/trunk/modules/client/src/main/resources/META-INF/spring.handlers 2010-04-01 15:42:48 UTC (rev 11923)
+++ stack/cxf/trunk/modules/client/src/main/resources/META-INF/spring.handlers 2010-04-01 16:07:54 UTC (rev 11924)
@@ -42,6 +42,7 @@
#
#
http\://cxf.apache.org/jaxws=org.apache.cxf.jaxws.spring.NamespaceHandler
+http\://cxf.apache.org/jaxws=org.jboss.wsf.stack.cxf.spring.handler.JaxwsNamespaceHandler
#
#
# Licensed to the Apache Software Foundation (ASF) under one
Modified: stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/DescriptorDeploymentAspect.java
===================================================================
--- stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/DescriptorDeploymentAspect.java 2010-04-01 15:42:48 UTC (rev 11923)
+++ stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/DescriptorDeploymentAspect.java 2010-04-01 16:07:54 UTC (rev 11924)
@@ -171,7 +171,7 @@
boolean mtomEnabled = isMtomEnabled(ep.getTargetBeanClass());
- DDEndpoint ddep = new DDEndpoint(id, address, implementor, mtomEnabled, JBossWSServiceFactoryBean.class.getName());
+ DDEndpoint ddep = new DDEndpoint(id, address, implementor, mtomEnabled);
if (depType == DeploymentType.JAXWS_EJB3)
{
Deleted: stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/JBossWSServiceFactoryBean.java
===================================================================
--- stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/JBossWSServiceFactoryBean.java 2010-04-01 15:42:48 UTC (rev 11923)
+++ stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/JBossWSServiceFactoryBean.java 2010-04-01 16:07:54 UTC (rev 11924)
@@ -1,76 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2010, 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;
-
-import java.io.IOException;
-
-import org.apache.cxf.BusFactory;
-import org.apache.cxf.endpoint.Endpoint;
-import org.apache.cxf.endpoint.EndpointException;
-import org.apache.cxf.jaxws.support.JaxWsServiceFactoryBean;
-import org.apache.cxf.service.Service;
-import org.apache.cxf.service.model.EndpointInfo;
-import org.jboss.logging.Logger;
-
-/**
- * A service factory bean that performs additional operations
- * required by the JBossWS integration when creating a service.
- *
- * @author alessio.soldano(a)jboss.com
- * @since 30-Mar-2010
- *
- */
-public class JBossWSServiceFactoryBean extends JaxWsServiceFactoryBean
-{
- private WSDLFilePublisher wsdlPublisher;
-
- @Override
- public Endpoint createEndpoint(EndpointInfo ei) throws EndpointException
- {
- Endpoint endpoint = super.createEndpoint(ei);
- Service service = endpoint.getService();
- // Publish wsdl after endpoint deployment, as required by JSR-109, section 8.2
- if (wsdlPublisher != null)
- {
- String wsdlLocation = isFromWsdl() ? getWsdlURL() : null;
- try
- {
- wsdlPublisher.publishWsdlFiles(service.getName(), wsdlLocation, BusFactory.getThreadDefaultBus(false), service.getServiceInfos());
- }
- catch (IOException ioe)
- {
- throw new RuntimeException("Error while publishing wsdl for service " + service.getName(), ioe);
- }
- }
- else
- {
- Logger.getLogger(JBossWSServiceFactoryBean.class).warn("WSDLPublisher not configured, unable to publish contract!");
- }
- return endpoint;
- }
-
- public void setWsdlPublisher(WSDLFilePublisher wsdlPublisher)
- {
- this.wsdlPublisher = wsdlPublisher;
- }
-
-}
Modified: stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/configuration/JBossWSServerCXFConfigurer.java
===================================================================
--- stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/configuration/JBossWSServerCXFConfigurer.java 2010-04-01 15:42:48 UTC (rev 11923)
+++ stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/configuration/JBossWSServerCXFConfigurer.java 2010-04-01 16:07:54 UTC (rev 11924)
@@ -26,9 +26,9 @@
import org.apache.cxf.frontend.AbstractWSDLBasedEndpointFactory;
import org.apache.cxf.service.factory.ReflectionServiceFactoryBean;
import org.jboss.wsf.spi.binding.BindingCustomization;
-import org.jboss.wsf.stack.cxf.JBossWSServiceFactoryBean;
import org.jboss.wsf.stack.cxf.WSDLFilePublisher;
import org.jboss.wsf.stack.cxf.client.configuration.JBossWSCXFConfigurer;
+import org.jboss.wsf.stack.cxf.deployment.EndpointImpl;
/**
* A JBossWSCXFConfigured to be used on server side
@@ -50,14 +50,24 @@
super(delegate, customization);
this.wsdlPublisher = wsdlPublisher;
}
+
+ @Override
+ protected void internalConfigure(Object beanInstance)
+ {
+ super.internalConfigure(beanInstance);
+ if (beanInstance instanceof EndpointImpl)
+ {
+ configureEndpoint((EndpointImpl)beanInstance);
+ }
+ }
@Override
protected synchronized void configureEndpointFactory(AbstractWSDLBasedEndpointFactory factory)
{
- ReflectionServiceFactoryBean serviceFactory = factory.getServiceFactory();
//Configure binding customization
if (customization != null)
{
+ ReflectionServiceFactoryBean serviceFactory = factory.getServiceFactory();
//customize default databinding (early pulls in ServiceFactory default databinding and configure it, as it's lazily loaded)
serviceFactory.reset();
DataBinding serviceFactoryDataBinding = serviceFactory.getDataBinding(true);
@@ -74,12 +84,16 @@
setBindingCustomization(factory.getDataBinding(), customization);
}
}
+ //add other configurations here below
+ }
+
+ protected synchronized void configureEndpoint(EndpointImpl endpoint)
+ {
//Configure wsdl file publisher
- if (wsdlPublisher != null && serviceFactory instanceof JBossWSServiceFactoryBean)
+ if (wsdlPublisher != null)
{
- ((JBossWSServiceFactoryBean)serviceFactory).setWsdlPublisher(wsdlPublisher);
+ endpoint.setWsdlPublisher(wsdlPublisher);
}
- //add other configurations here below
}
public void setWsdlPublisher(WSDLFilePublisher wsdlPublisher)
Added: stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/deployment/EndpointImpl.java
===================================================================
--- stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/deployment/EndpointImpl.java (rev 0)
+++ stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/deployment/EndpointImpl.java 2010-04-01 16:07:54 UTC (rev 11924)
@@ -0,0 +1,128 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2010, 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.deployment;
+
+import java.io.IOException;
+
+import javax.xml.namespace.QName;
+
+import org.apache.cxf.Bus;
+import org.apache.cxf.BusFactory;
+import org.apache.cxf.configuration.Configurer;
+import org.apache.cxf.endpoint.Endpoint;
+import org.apache.cxf.jaxws.support.JaxWsImplementorInfo;
+import org.apache.cxf.service.Service;
+import org.jboss.logging.Logger;
+import org.jboss.wsf.stack.cxf.WSDLFilePublisher;
+
+/**
+ * An extension of @see org.apache.cxf.jaxws.EndpointImpl for dealing with
+ * JBossWS integration needs.
+ *
+ * @author alessio.soldano(a)jboss.com
+ * @since 01-Apr-2010
+ *
+ */
+public class EndpointImpl extends org.apache.cxf.jaxws.EndpointImpl
+{
+ private WSDLFilePublisher wsdlPublisher;
+
+ public EndpointImpl(Object implementor)
+ {
+ super(implementor);
+ }
+
+ public EndpointImpl(Bus bus, Object implementor)
+ {
+ super(bus, implementor);
+ }
+
+ @Override
+ protected void doPublish(String addr)
+ {
+ super.doPublish(addr);
+ //allow for configuration so that the wsdlPublisher can be set be the JBossWSCXFConfigurer
+ configureObject(this);
+ //publish the wsdl to data/wsdl
+ publishContractToFilesystem();
+ }
+
+ /**
+ * Publish the contract to a file using the configured wsdl publisher
+ *
+ * @param endpoint
+ */
+ protected void publishContractToFilesystem()
+ {
+ // Publish wsdl after endpoint deployment, as required by JSR-109, section 8.2
+ if (wsdlPublisher != null)
+ {
+ Endpoint endpoint = getServer().getEndpoint();
+ Service service = endpoint.getService();
+ try
+ {
+ JaxWsImplementorInfo info = new JaxWsImplementorInfo(getImplementorClass());
+ wsdlPublisher.publishWsdlFiles(service.getName(), info.getWsdlLocation(), BusFactory.getThreadDefaultBus(false), service.getServiceInfos());
+ }
+ catch (IOException ioe)
+ {
+ throw new RuntimeException("Error while publishing wsdl for service " + service.getName(), ioe);
+ }
+ }
+ else
+ {
+ Logger.getLogger(this.getClass()).warn("WSDLPublisher not configured, unable to publish contract!");
+ }
+ }
+
+ private void configureObject(Object instance)
+ {
+ Configurer configurer = getBus().getExtension(Configurer.class);
+ if (null != configurer)
+ {
+ configurer.configureBean(instance);
+ }
+ }
+
+ @Override
+ public String getBeanName()
+ {
+ QName endpointName = this.getEndpointName();
+ if (endpointName == null)
+ {
+ JaxWsImplementorInfo implInfo = new JaxWsImplementorInfo(getImplementorClass());
+ endpointName = implInfo.getEndpointName();
+ }
+ return endpointName.toString() + ".jaxws-endpoint";
+ }
+
+ public WSDLFilePublisher getWsdlPublisher()
+ {
+ return wsdlPublisher;
+ }
+
+ public void setWsdlPublisher(WSDLFilePublisher wsdlPublisher)
+ {
+ this.wsdlPublisher = wsdlPublisher;
+ }
+
+}
Property changes on: stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/deployment/EndpointImpl.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Modified: stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/metadata/services/DDEndpoint.java
===================================================================
--- stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/metadata/services/DDEndpoint.java 2010-04-01 15:42:48 UTC (rev 11923)
+++ stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/metadata/services/DDEndpoint.java 2010-04-01 16:07:54 UTC (rev 11924)
@@ -37,15 +37,13 @@
private String implementor;
private String invoker;
private boolean mtomEnabled;
- private String serviceFactory;
- public DDEndpoint(String id, String address, String implementor, boolean mtomEnabled, String serviceFactory)
+ public DDEndpoint(String id, String address, String implementor, boolean mtomEnabled)
{
this.id = id;
this.address = address;
this.implementor = implementor;
this.mtomEnabled = mtomEnabled;
- this.serviceFactory = serviceFactory;
}
public void setInvoker(String invoker)
@@ -60,8 +58,6 @@
writer.write(" implementor='" + this.implementor + "'");
writer.write(">");
- writer.write("<jaxws:serviceFactory><bean class='" + this.serviceFactory + "'/></jaxws:serviceFactory>");
-
if (this.mtomEnabled)
{
writer.write("<jaxws:binding>");
@@ -85,7 +81,6 @@
str.append("\n implementor=" + this.implementor);
str.append("\n invoker=" + this.invoker);
str.append("\n mtomEnabled=" + this.mtomEnabled);
- str.append("\n serviceFactory=" + this.serviceFactory);
return str.toString();
}
}
Added: stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/spring/handler/JaxwsNamespaceHandler.java
===================================================================
--- stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/spring/handler/JaxwsNamespaceHandler.java (rev 0)
+++ stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/spring/handler/JaxwsNamespaceHandler.java 2010-04-01 16:07:54 UTC (rev 11924)
@@ -0,0 +1,44 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2010, 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.spring.handler;
+
+import org.apache.cxf.jaxws.spring.NamespaceHandler;
+import org.jboss.wsf.stack.cxf.spring.parser.JaxwsEndpointDefinitionParser;
+
+/**
+ * A Spring namespace handler that extends the handler
+ * configured by CXF for the jaxws ns, allowing for
+ * different beans to be associated to elements by
+ * default.
+ *
+ * @author alessio.soldano(a)jboss.com
+ * @since 01-Apr-2010
+ *
+ */
+public class JaxwsNamespaceHandler extends NamespaceHandler
+{
+ @Override
+ public void init() {
+ super.init();
+ registerBeanDefinitionParser("endpoint", new JaxwsEndpointDefinitionParser());
+ }
+}
Property changes on: stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/spring/handler/JaxwsNamespaceHandler.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/spring/parser/JaxwsEndpointDefinitionParser.java
===================================================================
--- stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/spring/parser/JaxwsEndpointDefinitionParser.java (rev 0)
+++ stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/spring/parser/JaxwsEndpointDefinitionParser.java 2010-04-01 16:07:54 UTC (rev 11924)
@@ -0,0 +1,72 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2010, 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.spring.parser;
+
+import org.apache.cxf.Bus;
+import org.apache.cxf.BusFactory;
+import org.apache.cxf.bus.spring.BusWiringBeanFactoryPostProcessor;
+import org.apache.cxf.jaxws.spring.EndpointDefinitionParser;
+import org.jboss.wsf.stack.cxf.deployment.EndpointImpl;
+import org.springframework.beans.BeansException;
+import org.springframework.context.ApplicationContext;
+import org.springframework.context.ApplicationContextAware;
+
+/**
+ * A parser for jaxws-endpoint beans that extends the CXF default one
+ * allowing for a custom Endpoint implementation class to be used.
+ *
+ * @author alessio.soldano(a)jboss.com
+ * @since 01-Apr-2010
+ *
+ */
+public class JaxwsEndpointDefinitionParser extends EndpointDefinitionParser
+{
+ public JaxwsEndpointDefinitionParser()
+ {
+ super();
+ setBeanClass(JBossWSSpringEndpointImpl.class);
+ }
+
+ public static class JBossWSSpringEndpointImpl extends EndpointImpl implements ApplicationContextAware
+ {
+
+ public JBossWSSpringEndpointImpl(Object implementor)
+ {
+ super((Bus)null, implementor);
+ }
+
+ public JBossWSSpringEndpointImpl(Bus bus, Object implementor)
+ {
+ super(bus, implementor);
+ }
+
+ public void setApplicationContext(ApplicationContext ctx) throws BeansException
+ {
+ if (getBus() == null)
+ {
+ Bus bus = BusFactory.getThreadDefaultBus();
+ BusWiringBeanFactoryPostProcessor.updateBusReferencesInContext(bus, ctx);
+ setBus(bus);
+ }
+ }
+ }
+}
Property changes on: stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/spring/parser/JaxwsEndpointDefinitionParser.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
14 years, 8 months