Author: alessio.soldano(a)jboss.com
Date: 2011-04-28 06:57:21 -0400 (Thu, 28 Apr 2011)
New Revision: 14209
Added:
stack/cxf/trunk/modules/addons/transports/http/httpserver/src/main/java/org/jboss/wsf/stack/cxf/addons/transports/httpserver/HttpServerDestinationFactory.java
stack/cxf/trunk/modules/addons/transports/http/httpserver/src/main/resources/META-INF/cxf/bus-extensions.txt
stack/cxf/trunk/modules/resources/src/main/resources/modules/org/apache/ws/xmlschema/
stack/cxf/trunk/modules/resources/src/main/resources/modules/org/apache/ws/xmlschema/main/
stack/cxf/trunk/modules/resources/src/main/resources/modules/org/apache/ws/xmlschema/main/module.xml
Removed:
stack/cxf/trunk/modules/addons/transports/http/httpserver/src/main/java/org/jboss/wsf/stack/cxf/addons/transports/httpserver/HttpServerTransportFactory.java
stack/cxf/trunk/modules/addons/transports/http/httpserver/src/main/resources/META-INF/cxf/bus-extensions.xml
stack/cxf/trunk/modules/addons/transports/http/httpserver/src/main/resources/META-INF/cxf/cxf-extension-httpserver.xml
stack/cxf/trunk/modules/addons/transports/http/httpserver/src/main/resources/META-INF/cxf/cxf.extension
stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/configuration/JBossWSBusApplicationContext.java
stack/cxf/trunk/modules/client/src/main/resources/META-INF/cxf/jbossws-cxf.xml
stack/cxf/trunk/modules/resources/src/main/resources/modules/org/apache/ws/commons/
stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/ServletControllerExt.java
stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/configuration/JBossWSServerSpringConfigurer.java
Modified:
stack/cxf/trunk/modules/addons/transports/http/httpserver/src/main/java/org/jboss/wsf/stack/cxf/addons/transports/httpserver/HttpServerDestination.java
stack/cxf/trunk/modules/addons/transports/http/httpserver/src/main/java/org/jboss/wsf/stack/cxf/addons/transports/httpserver/HttpServerEngineFactory.java
stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/configuration/JBossWSNonSpringBusFactory.java
stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/configuration/JBossWSSpringBusFactory.java
stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/configuration/JBossWSSpringConfigurer.java
stack/cxf/trunk/modules/client/src/main/resources/META-INF/cxf/aegis.xsd
stack/cxf/trunk/modules/client/src/main/resources/META-INF/cxf/java2wsbeans.xml
stack/cxf/trunk/modules/client/src/main/resources/META-INF/tools-plugin.xml
stack/cxf/trunk/modules/dist/src/main/scripts/assembly-deploy-artifacts.xml
stack/cxf/trunk/modules/resources/src/main/resources/modules/org/apache/cxf/main/module.xml
stack/cxf/trunk/modules/resources/src/main/resources/resources/jbossws-deploy-macros.xml
stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/CXFNonSpringServletExt.java
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/RequestHandlerImpl.java
stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/configuration/NonSpringBusHolder.java
stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/configuration/SpringBusHolder.java
stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/security/authentication/SubjectCreatingInterceptor.java
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/transport/ServletHelper.java
stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/transport/SoapTransportFactoryExt.java
stack/cxf/trunk/modules/testsuite/cxf-spring-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/CustomSubjectCreatingInterceptor.java
stack/cxf/trunk/modules/testsuite/cxf-spring-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/ServerUsernamePasswordCallback.java
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/etc/log4j.xml
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/gzip/GZIPEnforcingInInterceptor.java
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/gzip/Helper.java
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsrm/service/RMCheckInterceptor.java
stack/cxf/trunk/pom.xml
Log:
[JBWS-3272] Upgrade to Apache CXF 2.4
Modified:
stack/cxf/trunk/modules/addons/transports/http/httpserver/src/main/java/org/jboss/wsf/stack/cxf/addons/transports/httpserver/HttpServerDestination.java
===================================================================
---
stack/cxf/trunk/modules/addons/transports/http/httpserver/src/main/java/org/jboss/wsf/stack/cxf/addons/transports/httpserver/HttpServerDestination.java 2011-04-27
13:09:15 UTC (rev 14208)
+++
stack/cxf/trunk/modules/addons/transports/http/httpserver/src/main/java/org/jboss/wsf/stack/cxf/addons/transports/httpserver/HttpServerDestination.java 2011-04-28
10:57:21 UTC (rev 14209)
@@ -30,6 +30,7 @@
import org.apache.cxf.common.logging.LogUtils;
import org.apache.cxf.interceptor.Fault;
import org.apache.cxf.service.model.EndpointInfo;
+import org.apache.cxf.transport.http.DestinationRegistry;
import org.apache.cxf.transport.http_jaxws_spi.HttpHandlerImpl;
import org.apache.cxf.transport.http_jaxws_spi.JAXWSHttpSpiDestination;
import org.jboss.ws.httpserver_httpspi.HttpExchangeDelegate;
@@ -53,16 +54,14 @@
private static final long serialVersionUID = 1L;
- private HttpServerTransportFactory factory;
private HttpServerEngineFactory serverEngineFactory;
private HttpServerEngine engine;
private URL url;
- public HttpServerDestination(Bus b, HttpServerTransportFactory factory, EndpointInfo
ei) throws IOException
+ public HttpServerDestination(Bus b, DestinationRegistry registry, EndpointInfo ei)
throws IOException
{
- super(b, ei);
- this.factory = factory;
- this.serverEngineFactory = factory.getServerEngineFactory();
+ super(b, registry, ei);
+ this.serverEngineFactory = getServerEngineFactory();
getAddressValue(ei, true); //generate address if not specified
this.url = new URL(ei.getAddress());
}
@@ -73,12 +72,19 @@
return LOG;
}
- public void finalizeConfig() throws IOException
+ public void finalizeConfig()
{
engine = serverEngineFactory.retrieveHttpServerEngine(url.getPort());
if (engine == null)
{
- engine = serverEngineFactory.createHttpServerEngine(url.getHost(),
url.getPort(), url.getProtocol());
+ try
+ {
+ engine = serverEngineFactory.createHttpServerEngine(url.getHost(),
url.getPort(), url.getProtocol());
+ }
+ catch (IOException e)
+ {
+ throw new RuntimeException(e);
+ }
}
if (!url.getProtocol().equals(engine.getProtocol()))
{
@@ -86,6 +92,19 @@
+ engine.getProtocol() + "\" for \"" + url +
"\"");
}
}
+
+ protected HttpServerEngineFactory getServerEngineFactory()
+ {
+ HttpServerEngineFactory serverEngineFactory =
getBus().getExtension(HttpServerEngineFactory.class);
+ // If it's not there, then create it and register it.
+ // Spring may override it later, but we need it here for default
+ // with no spring configuration.
+ if (serverEngineFactory == null)
+ {
+ serverEngineFactory = new HttpServerEngineFactory(bus);
+ }
+ return serverEngineFactory;
+ }
/**
* Activate receipt of incoming messages.
@@ -114,13 +133,6 @@
engine.removeHandler(endpointInfo.getAddress());
}
- @Override
- public void shutdown()
- {
- factory.removeDestination(endpointInfo);
- super.shutdown();
- }
-
class Handler extends HttpHandlerImpl implements HttpHandler
{
Added:
stack/cxf/trunk/modules/addons/transports/http/httpserver/src/main/java/org/jboss/wsf/stack/cxf/addons/transports/httpserver/HttpServerDestinationFactory.java
===================================================================
---
stack/cxf/trunk/modules/addons/transports/http/httpserver/src/main/java/org/jboss/wsf/stack/cxf/addons/transports/httpserver/HttpServerDestinationFactory.java
(rev 0)
+++
stack/cxf/trunk/modules/addons/transports/http/httpserver/src/main/java/org/jboss/wsf/stack/cxf/addons/transports/httpserver/HttpServerDestinationFactory.java 2011-04-28
10:57:21 UTC (rev 14209)
@@ -0,0 +1,50 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2011, 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.addons.transports.httpserver;
+
+import java.io.IOException;
+
+import org.apache.cxf.Bus;
+import org.apache.cxf.common.injection.NoJSR250Annotations;
+import org.apache.cxf.service.model.EndpointInfo;
+import org.apache.cxf.transport.http.AbstractHTTPDestination;
+import org.apache.cxf.transport.http.DestinationRegistry;
+import org.apache.cxf.transport.http.HttpDestinationFactory;
+
+
+/**
+ * Factory for HttpServerDestination
+ *
+ * @author alessio.soldano(a)jboss.com
+ * @since 22-Apr-2011
+ *
+ */
+@NoJSR250Annotations()
+public class HttpServerDestinationFactory implements HttpDestinationFactory
+{
+ @Override
+ public AbstractHTTPDestination createDestination(EndpointInfo endpointInfo, Bus bus,
DestinationRegistry registry)
+ throws IOException
+ {
+ return new HttpServerDestination(bus, registry, endpointInfo);
+ }
+}
Modified:
stack/cxf/trunk/modules/addons/transports/http/httpserver/src/main/java/org/jboss/wsf/stack/cxf/addons/transports/httpserver/HttpServerEngineFactory.java
===================================================================
---
stack/cxf/trunk/modules/addons/transports/http/httpserver/src/main/java/org/jboss/wsf/stack/cxf/addons/transports/httpserver/HttpServerEngineFactory.java 2011-04-27
13:09:15 UTC (rev 14208)
+++
stack/cxf/trunk/modules/addons/transports/http/httpserver/src/main/java/org/jboss/wsf/stack/cxf/addons/transports/httpserver/HttpServerEngineFactory.java 2011-04-28
10:57:21 UTC (rev 14209)
@@ -140,7 +140,10 @@
HttpServerEngine[] engines = portMap.values().toArray(new HttpServerEngine[0]);
for (HttpServerEngine engine : engines)
{
- engine.shutdown();
+ if (engine.getBus() == getBus())
+ {
+ engine.shutdown();
+ }
}
}
Deleted:
stack/cxf/trunk/modules/addons/transports/http/httpserver/src/main/java/org/jboss/wsf/stack/cxf/addons/transports/httpserver/HttpServerTransportFactory.java
===================================================================
---
stack/cxf/trunk/modules/addons/transports/http/httpserver/src/main/java/org/jboss/wsf/stack/cxf/addons/transports/httpserver/HttpServerTransportFactory.java 2011-04-27
13:09:15 UTC (rev 14208)
+++
stack/cxf/trunk/modules/addons/transports/http/httpserver/src/main/java/org/jboss/wsf/stack/cxf/addons/transports/httpserver/HttpServerTransportFactory.java 2011-04-28
10:57:21 UTC (rev 14209)
@@ -1,118 +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.addons.transports.httpserver;
-
-import java.io.IOException;
-import java.util.Map;
-import java.util.concurrent.ConcurrentHashMap;
-
-import javax.annotation.PostConstruct;
-import javax.annotation.Resource;
-
-import org.apache.cxf.Bus;
-import org.apache.cxf.service.model.EndpointInfo;
-import org.apache.cxf.transport.Destination;
-import org.apache.cxf.transport.DestinationFactory;
-import org.apache.cxf.transport.http.AbstractHTTPTransportFactory;
-
-/**
- * A Destination/Transport factory for the JDK6 httpserver
- *
- * @author alessio.soldano(a)jboss.com
- * @since 19-Aug-2010
- *
- */
-public class HttpServerTransportFactory extends AbstractHTTPTransportFactory implements
DestinationFactory
-{
- private Map<String, HttpServerDestination> destinations = new
ConcurrentHashMap<String, HttpServerDestination>();
-
- public HttpServerTransportFactory()
- {
- super();
- }
-
- @Resource
- public void setBus(Bus b)
- {
- super.setBus(b);
- }
-
- @PostConstruct
- public void finalizeConfig()
- {
- if (null == bus)
- {
- return;
- }
- // This call will register the server engine factory
- // with the Bus.
- getServerEngineFactory();
- }
-
- protected HttpServerEngineFactory getServerEngineFactory()
- {
- HttpServerEngineFactory serverEngineFactory =
getBus().getExtension(HttpServerEngineFactory.class);
- // If it's not there, then create it and register it.
- // Spring may override it later, but we need it here for default
- // with no spring configuration.
- if (serverEngineFactory == null)
- {
- serverEngineFactory = new HttpServerEngineFactory(bus);
- serverEngineFactory.setBus(getBus());
- }
- return serverEngineFactory;
- }
-
- public Destination getDestination(EndpointInfo endpointInfo) throws IOException
- {
- String addr = endpointInfo.getAddress();
- HttpServerDestination destination = addr == null ? null : destinations.get(addr);
- if (destination == null)
- {
- destination = createDestination(endpointInfo);
- }
- return destination;
- }
-
- private synchronized HttpServerDestination createDestination(EndpointInfo
endpointInfo) throws IOException
- {
- String addr = endpointInfo.getAddress();
- HttpServerDestination destination = addr == null ? null : destinations.get(addr);
- if (destination == null)
- {
- destination = new HttpServerDestination(getBus(), this, endpointInfo);
- destinations.put(endpointInfo.getAddress(), destination);
- configure(destination);
- destination.finalizeConfig();
- }
- return destination;
- }
-
- /**
- * This function removes the destination for a particular endpoint.
- */
- void removeDestination(EndpointInfo ei)
- {
- destinations.remove(ei.getAddress());
- }
-
-}
Added:
stack/cxf/trunk/modules/addons/transports/http/httpserver/src/main/resources/META-INF/cxf/bus-extensions.txt
===================================================================
---
stack/cxf/trunk/modules/addons/transports/http/httpserver/src/main/resources/META-INF/cxf/bus-extensions.txt
(rev 0)
+++
stack/cxf/trunk/modules/addons/transports/http/httpserver/src/main/resources/META-INF/cxf/bus-extensions.txt 2011-04-28
10:57:21 UTC (rev 14209)
@@ -0,0 +1 @@
+org.jboss.wsf.stack.cxf.addons.transports.httpserver.HttpServerDestinationFactory::true
\ No newline at end of file
Deleted:
stack/cxf/trunk/modules/addons/transports/http/httpserver/src/main/resources/META-INF/cxf/bus-extensions.xml
===================================================================
---
stack/cxf/trunk/modules/addons/transports/http/httpserver/src/main/resources/META-INF/cxf/bus-extensions.xml 2011-04-27
13:09:15 UTC (rev 14208)
+++
stack/cxf/trunk/modules/addons/transports/http/httpserver/src/main/resources/META-INF/cxf/bus-extensions.xml 2011-04-28
10:57:21 UTC (rev 14209)
@@ -1,10 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<extensions
xmlns="http://cxf.apache.org/bus/extension">
-
- <extension
class="org.jboss.wsf.stack.cxf.addons.transports.httpserver.HttpServerTransportFactory"
deferred="false">
- <
namespace>http://cxf.apache.org/transports/http</namespace>
-
<
namespace>http://cxf.apache.org/transports/http/configuration</name...
- <
namespace>http://schemas.xmlsoap.org/wsdl/http</namespace>
- <
namespace>http://schemas.xmlsoap.org/wsdl/http/</namespace>
- </extension>
-</extensions>
Deleted:
stack/cxf/trunk/modules/addons/transports/http/httpserver/src/main/resources/META-INF/cxf/cxf-extension-httpserver.xml
===================================================================
---
stack/cxf/trunk/modules/addons/transports/http/httpserver/src/main/resources/META-INF/cxf/cxf-extension-httpserver.xml 2011-04-27
13:09:15 UTC (rev 14208)
+++
stack/cxf/trunk/modules/addons/transports/http/httpserver/src/main/resources/META-INF/cxf/cxf-extension-httpserver.xml 2011-04-28
10:57:21 UTC (rev 14209)
@@ -1,24 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<beans
xmlns="http://www.springframework.org/schema/beans"
-
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-
xmlns:foo="http://cxf.apache.org/configuration/foo"
- xsi:schemaLocation="
-http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd">
-
- <import resource="classpath:META-INF/cxf/cxf-extension-http.xml" />
-
- <bean
class="org.jboss.wsf.stack.cxf.addons.transports.httpserver.HttpServerTransportFactory"
-
id="org.jboss.wsf.stack.cxf.addons.transports.httpserver.HttpServerTransportFactory"
- lazy-init="true">
- <property name="bus" ref="cxf"/>
- <property name="transportIds">
- <list>
- <
value>http://cxf.apache.org/transports/http</value>
-
<
value>http://cxf.apache.org/transports/http/configuration</value>
- <
value>http://schemas.xmlsoap.org/wsdl/http</value>
- <
value>http://schemas.xmlsoap.org/wsdl/http/</value>
- </list>
- </property>
- </bean>
-
-</beans>
Deleted:
stack/cxf/trunk/modules/addons/transports/http/httpserver/src/main/resources/META-INF/cxf/cxf.extension
===================================================================
---
stack/cxf/trunk/modules/addons/transports/http/httpserver/src/main/resources/META-INF/cxf/cxf.extension 2011-04-27
13:09:15 UTC (rev 14208)
+++
stack/cxf/trunk/modules/addons/transports/http/httpserver/src/main/resources/META-INF/cxf/cxf.extension 2011-04-28
10:57:21 UTC (rev 14209)
@@ -1 +0,0 @@
-META-INF/cxf/cxf-extension-httpserver.xml
\ No newline at end of file
Deleted:
stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/configuration/JBossWSBusApplicationContext.java
===================================================================
---
stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/configuration/JBossWSBusApplicationContext.java 2011-04-27
13:09:15 UTC (rev 14208)
+++
stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/configuration/JBossWSBusApplicationContext.java 2011-04-28
10:57:21 UTC (rev 14209)
@@ -1,121 +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.client.configuration;
-
-import java.io.BufferedReader;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.InputStreamReader;
-import java.net.URL;
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.List;
-
-import org.apache.cxf.bus.spring.BusApplicationContext;
-import org.springframework.context.ApplicationContext;
-import org.springframework.core.io.Resource;
-import org.springframework.core.io.support.PathMatchingResourcePatternResolver;
-
-/**
- * A JBossWS version of @see{org.apache.cxf.bus.spring.BusApplicationContext} that
- * allows for getting the default bus configuration from the JBossWS
- * integration.
- *
- * @author alessio.soldano(a)jboss.com
- * @since 25-May-2010
- *
- */
-public class JBossWSBusApplicationContext extends BusApplicationContext
-{
- private static final String JBWS_INTEGRATION_CXF_CFG_FILE =
"META-INF/cxf/jbossws-cxf.xml";
-
- private static final String JBWS_CXF_EXT_CFG_FILE =
"classpath*:META-INF/cxf/cxf-extension-jbossws.xml";
-
- private static final String DEFAULT_CXF_EXT_CFG_FILE =
"classpath*:META-INF/cxf/cxf.extension";
-
- private final boolean jbwsIncludeDefaults;
- private final boolean ready;
-
- public JBossWSBusApplicationContext(String[] cf, boolean include, ApplicationContext
parent)
- {
- super(cf, false, parent);
- this.jbwsIncludeDefaults = include;
- this.ready = true;
- refresh();
- }
-
- public JBossWSBusApplicationContext(URL[] url, boolean include, ApplicationContext
parent)
- {
- super(url, false, parent);
- this.jbwsIncludeDefaults = include;
- this.ready = true;
- refresh();
- }
-
- @Override
- protected Resource[] getConfigResources()
- {
- List<Resource> resources = new ArrayList<Resource>();
- if (ready)
- {
- if (jbwsIncludeDefaults)
- {
- try
- {
- PathMatchingResourcePatternResolver resolver = new
PathMatchingResourcePatternResolver(Thread
- .currentThread().getContextClassLoader());
- //jbossws-cxf.xml with our integration defaults for the Bus
- Collections.addAll(resources,
resolver.getResources(JBWS_INTEGRATION_CXF_CFG_FILE));
- //cxf-extensions-jbossws.xml, for customers' jbossws additions
- Collections.addAll(resources,
resolver.getResources(JBWS_CXF_EXT_CFG_FILE));
- //CXF vanilla extensions, need to load them here as super skips defaults
loading
- Resource[] exts = resolver.getResources(DEFAULT_CXF_EXT_CFG_FILE);
- for (Resource r : exts)
- {
- InputStream is = r.getInputStream();
- BufferedReader rd = new BufferedReader(new InputStreamReader(is,
"UTF-8"));
- String line = rd.readLine();
- while (line != null)
- {
- if (!"".equals(line))
- {
- resources.add(resolver.getResource(line));
- }
- line = rd.readLine();
- }
- is.close();
- }
-
- }
- catch (IOException ex)
- {
- // ignore
- }
- }
- //recurse to super; this loads everything else the user specified
- Resource[] superResources = super.getConfigResources();
- if (superResources != null)
- Collections.addAll(resources, superResources);
- }
- return resources.isEmpty() ? null : (Resource[]) resources.toArray(new
Resource[resources.size()]);
- }
-}
Modified:
stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/configuration/JBossWSNonSpringBusFactory.java
===================================================================
---
stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/configuration/JBossWSNonSpringBusFactory.java 2011-04-27
13:09:15 UTC (rev 14208)
+++
stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/configuration/JBossWSNonSpringBusFactory.java 2011-04-28
10:57:21 UTC (rev 14209)
@@ -1,6 +1,6 @@
/*
* JBoss, Home of Professional Open Source.
- * Copyright 2010, Red Hat Middleware LLC, and individual contributors
+ * Copyright 2011, 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.
*
@@ -21,40 +21,13 @@
*/
package org.jboss.wsf.stack.cxf.client.configuration;
-import java.lang.ref.WeakReference;
-import java.util.Collection;
import java.util.HashMap;
-import java.util.LinkedList;
import java.util.Map;
-import javax.xml.bind.JAXBException;
-import javax.xml.namespace.QName;
-
import org.apache.cxf.Bus;
import org.apache.cxf.bus.CXFBusFactory;
import org.apache.cxf.bus.extension.ExtensionManagerBus;
import org.apache.cxf.configuration.Configurer;
-import org.apache.cxf.ws.addressing.Names;
-import org.apache.cxf.ws.addressing.policy.AddressingAssertionBuilder;
-import org.apache.cxf.ws.addressing.policy.AddressingPolicyInterceptorProvider;
-import org.apache.cxf.ws.policy.AssertionBuilderRegistry;
-import org.apache.cxf.ws.policy.AssertionBuilderRegistryImpl;
-import org.apache.cxf.ws.policy.PolicyBuilder;
-import org.apache.cxf.ws.policy.PolicyBuilderImpl;
-import org.apache.cxf.ws.policy.PolicyEngine;
-import org.apache.cxf.ws.policy.PolicyEngineImpl;
-import org.apache.cxf.ws.policy.PolicyInterceptorProviderRegistry;
-import org.apache.cxf.ws.policy.PolicyInterceptorProviderRegistryImpl;
-import org.apache.cxf.ws.policy.PolicyProvider;
-import org.apache.cxf.ws.policy.attachment.ServiceModelPolicyProvider;
-import org.apache.cxf.ws.policy.attachment.external.DomainExpressionBuilderRegistry;
-import org.apache.cxf.ws.policy.attachment.wsdl11.Wsdl11AttachmentPolicyProvider;
-import org.apache.cxf.ws.policy.builder.primitive.PrimitiveAssertionBuilder;
-import org.apache.cxf.ws.policy.mtom.MTOMAssertionBuilder;
-import org.apache.cxf.ws.policy.mtom.MTOMPolicyInterceptorProvider;
-import org.apache.cxf.ws.rm.RMManager;
-import org.apache.cxf.ws.rm.policy.RMAssertionBuilder;
-import org.apache.cxf.ws.rm.policy.RMPolicyInterceptorProvider;
import org.jboss.wsf.stack.cxf.client.ProviderImpl;
/**
@@ -77,81 +50,14 @@
extensions.put(Configurer.class, new JBossWSNonSpringConfigurer(new
BeanCustomizer()));
}
- preparePolicyEngine(extensions);
-
//Explicitly ask for the ProviderImpl.class.getClassLoader() to be used for
getting
//cxf bus extensions (as that classloader is the jaxws-client module one which
'sees' all
//extensions, unless different dependencies are explicitly set)
- Bus bus = new ExtensionManagerBus(extensions, properties,
ProviderImpl.class.getClassLoader());
-
- initPolicyEngine((PolicyEngineImpl)extensions.get(PolicyEngine.class), bus);
+ ExtensionManagerBus bus = new ExtensionManagerBus(extensions, properties,
ProviderImpl.class.getClassLoader());
possiblySetDefaultBus(bus);
initializeBus(bus);
+ bus.initialize();
return bus;
}
-
- @SuppressWarnings("rawtypes")
- private static void preparePolicyEngine(Map<Class, Object> extensions)
- {
- PolicyEngineImpl engine = new PolicyEngineImpl(true);
- extensions.put(PolicyEngine.class, engine);
- DomainExpressionBuilderRegistry domainExpBuilderRegistry = new
DomainExpressionBuilderRegistry();
- extensions.put(DomainExpressionBuilderRegistry.class, domainExpBuilderRegistry);
- }
-
- private static void initPolicyEngine(PolicyEngineImpl engine, Bus bus)
- {
- engine.setBus(bus);
- AssertionBuilderRegistry assertionBuilderRegistry = new
AssertionBuilderRegistryImpl(bus);
- PolicyInterceptorProviderRegistry policyInterceptorProviderRegistry = new
PolicyInterceptorProviderRegistryImpl(bus);
- PolicyBuilderImpl policyBuilder = new PolicyBuilderImpl();
- policyBuilder.setBus(bus);
- policyBuilder.setAssertionBuilderRegistry(assertionBuilderRegistry);
- bus.setExtension(policyBuilder, PolicyBuilder.class);
- Collection<PolicyProvider> policyProviders = engine.getPolicyProviders();
- Wsdl11AttachmentPolicyProvider wsdl11PolicyAttachmentProvider = new
Wsdl11AttachmentPolicyProvider(bus);
- wsdl11PolicyAttachmentProvider.setBuilder(policyBuilder);
- wsdl11PolicyAttachmentProvider.setRegistry(engine.getRegistry());
- policyProviders.add(wsdl11PolicyAttachmentProvider);
- ServiceModelPolicyProvider serviceModelPolicyProvider = new
ServiceModelPolicyProvider(bus);
- serviceModelPolicyProvider.setBuilder(policyBuilder);
- serviceModelPolicyProvider.setRegistry(engine.getRegistry());
- policyProviders.add(serviceModelPolicyProvider);
-
- //MTOM Policy
- assertionBuilderRegistry.register(new MTOMAssertionBuilder());
- policyInterceptorProviderRegistry.register(new MTOMPolicyInterceptorProvider());
-
- //RM
- RMManager rmManager = new RMManager();
- rmManager.init(bus);
-
- //RM Policy
- policyInterceptorProviderRegistry.register(new RMPolicyInterceptorProvider(bus));
- try
- {
- assertionBuilderRegistry.register(new RMAssertionBuilder());
- }
- catch (JAXBException e)
- {
- throw new RuntimeException(e);
- }
-
- //Addressing Policy
- policyInterceptorProviderRegistry.register(new
AddressingPolicyInterceptorProvider());
- assertionBuilderRegistry.register(new AddressingAssertionBuilder(bus));
- Collection<QName> addressingKnownEls = new LinkedList<QName>();
- addressingKnownEls.add(new
QName("http://schemas.xmlsoap.org/ws/2004/08/addressing/policy",
Names.WSAW_USING_ADDRESSING_NAME));
- addressingKnownEls.add(new QName(Names.WSA_NAMESPACE_WSDL_NAME_OLD,
Names.WSAW_USING_ADDRESSING_NAME));
- addressingKnownEls.add(Names.WSAW_USING_ADDRESSING_QNAME);
- PrimitiveAssertionBuilder primitiveAssertionBuilder = new
PrimitiveAssertionBuilder(addressingKnownEls);
- primitiveAssertionBuilder.setBus(bus);
- assertionBuilderRegistry.register(primitiveAssertionBuilder);
- }
-
- @Override
- protected void initializeBus(Bus bus) {
- super.initializeBus(bus);
- }
}
Modified:
stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/configuration/JBossWSSpringBusFactory.java
===================================================================
---
stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/configuration/JBossWSSpringBusFactory.java 2011-04-27
13:09:15 UTC (rev 14208)
+++
stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/configuration/JBossWSSpringBusFactory.java 2011-04-28
10:57:21 UTC (rev 14209)
@@ -31,6 +31,7 @@
import org.apache.cxf.buslifecycle.BusLifeCycleListener;
import org.apache.cxf.buslifecycle.BusLifeCycleManager;
import org.apache.cxf.common.logging.LogUtils;
+import org.apache.cxf.configuration.Configurer;
import org.springframework.beans.BeansException;
import org.springframework.context.ApplicationContext;
@@ -56,6 +57,11 @@
super(context);
}
+ /**
+ * We override the Apache CXF method to skip the checks on cxf.xml conf file as that
would prevent
+ * creating a Spring version of the bus when the jbossws-cxf.xml is available;
generally speaking
+ * the JBossWS-CXF integration requires a Spring bus to be created by Spring bus
factories.
+ */
@Override
public Bus createBus(String cfgFiles[], boolean includeDefaults)
{
@@ -75,7 +81,7 @@
{
try
{
- return finishCreatingBus(new JBossWSBusApplicationContext(urls, includeDefaults,
getApplicationContext()));
+ return finishCreatingBus(new BusApplicationContext(urls, includeDefaults,
getApplicationContext()));
}
catch (BeansException ex)
{
@@ -89,6 +95,8 @@
final Bus bus = (Bus) bac.getBean(Bus.DEFAULT_BUS_ID);
bus.setExtension(bac, BusApplicationContext.class);
+
+ setConfigurer(bus);
possiblySetDefaultBus(bus);
@@ -102,7 +110,7 @@
{
try
{
- return new JBossWSBusApplicationContext(cfgFiles, includeDefaults,
getApplicationContext());
+ return new BusApplicationContext(cfgFiles, includeDefaults,
getApplicationContext());
}
catch (BeansException ex)
{
@@ -113,7 +121,7 @@
Thread.currentThread().setContextClassLoader(BusApplicationContext.class.getClassLoader());
try
{
- return new JBossWSBusApplicationContext(cfgFiles, includeDefaults,
getApplicationContext());
+ return new BusApplicationContext(cfgFiles, includeDefaults,
getApplicationContext());
}
finally
{
@@ -126,6 +134,13 @@
}
}
}
+
+ private void setConfigurer(Bus bus)
+ {
+ JBossWSSpringConfigurer configurer = new
JBossWSSpringConfigurer(bus.getExtension(Configurer.class));
+ configurer.setCustomizer(new BeanCustomizer());
+ bus.setExtension(configurer, Configurer.class);
+ }
void registerAppContextLifeCycleListener(final Bus bus, final BusApplicationContext
bac)
{
Modified:
stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/configuration/JBossWSSpringConfigurer.java
===================================================================
---
stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/configuration/JBossWSSpringConfigurer.java 2011-04-27
13:09:15 UTC (rev 14208)
+++
stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/configuration/JBossWSSpringConfigurer.java 2011-04-28
10:57:21 UTC (rev 14209)
@@ -21,32 +21,52 @@
*/
package org.jboss.wsf.stack.cxf.client.configuration;
+import org.apache.cxf.configuration.Configurer;
import org.apache.cxf.configuration.spring.ConfigurerImpl;
+import org.apache.cxf.extension.BusExtension;
+import org.springframework.beans.BeansException;
+import org.springframework.context.ApplicationContext;
+import org.springframework.context.ApplicationContextAware;
/**
- * A CXF configurer (Spring based) that sets JBossWS stuff / customizations / properties
etc. in CXF configurable beans
+ * A CXF delegate configurer that sets JBossWS stuff / customizations / properties etc.
in CXF configurable beans
+ * (to be used for Spring based bus)
*
* @author alessio.soldano(a)jboss.com
* @since 05-Oct-2009
*/
-public class JBossWSSpringConfigurer extends ConfigurerImpl implements JBossWSConfigurer
+public class JBossWSSpringConfigurer implements JBossWSConfigurer,
ApplicationContextAware, BusExtension
{
private BeanCustomizer customizer;
+ private Configurer delegate;
+
+ public JBossWSSpringConfigurer(Configurer delegate)
+ {
+ this.delegate = delegate;
+ }
@Override
public void configureBean(Object beanInstance)
{
customConfigure(beanInstance);
- super.configureBean(beanInstance);
+ delegate.configureBean(beanInstance);
}
@Override
public void configureBean(String name, Object beanInstance)
{
customConfigure(beanInstance);
- super.configureBean(name, beanInstance);
+ delegate.configureBean(name, beanInstance);
}
+ public void addApplicationContext(ApplicationContext ctx)
+ {
+ if (delegate instanceof ConfigurerImpl)
+ {
+ ((ConfigurerImpl)delegate).addApplicationContext(ctx);
+ }
+ }
+
protected synchronized void customConfigure(Object beanInstance)
{
if (customizer != null)
@@ -64,4 +84,23 @@
{
this.customizer = customizer;
}
+
+ @Override
+ public Class<?> getRegistrationType()
+ {
+ if (delegate instanceof BusExtension)
+ {
+ return ((BusExtension)delegate).getRegistrationType();
+ }
+ throw new RuntimeException("Delegate is not a BusExtension instance: " +
delegate);
+ }
+
+ @Override
+ public void setApplicationContext(ApplicationContext applicationContext) throws
BeansException
+ {
+ if (delegate instanceof ApplicationContextAware)
+ {
+ ((ApplicationContextAware)delegate).setApplicationContext(applicationContext);
+ }
+ }
}
Modified: stack/cxf/trunk/modules/client/src/main/resources/META-INF/cxf/aegis.xsd
===================================================================
--- stack/cxf/trunk/modules/client/src/main/resources/META-INF/cxf/aegis.xsd 2011-04-27
13:09:15 UTC (rev 14208)
+++ stack/cxf/trunk/modules/client/src/main/resources/META-INF/cxf/aegis.xsd 2011-04-28
10:57:21 UTC (rev 14209)
@@ -49,6 +49,7 @@
<xsd:element name="parameter" type="parameterType" />
</xsd:choice>
<xsd:attribute name="name" type="xsd:string" />
+ <xsd:attribute name="ignore" type="xsd:boolean" />
</xsd:complexType>
<xsd:complexType name="return-typeType">
@@ -72,7 +73,7 @@
<xsd:attribute name="typeName" type="xsd:string" />
<xsd:attribute name="mappedName" type="xsd:string" />
<xsd:attribute name="nillable" type="xsd:boolean" />
- <xsd:attribute name="flag" type="xsd:boolean" />
+ <xsd:attribute name="flat" type="xsd:boolean" />
<xsd:attribute name="ignore" type="xsd:boolean" />
<xsd:attribute name="componentType" type="xsd:string" />
<xsd:attribute name="keyType" type="xsd:string" />
Modified: stack/cxf/trunk/modules/client/src/main/resources/META-INF/cxf/java2wsbeans.xml
===================================================================
---
stack/cxf/trunk/modules/client/src/main/resources/META-INF/cxf/java2wsbeans.xml 2011-04-27
13:09:15 UTC (rev 14208)
+++
stack/cxf/trunk/modules/client/src/main/resources/META-INF/cxf/java2wsbeans.xml 2011-04-28
10:57:21 UTC (rev 14209)
@@ -1,4 +1,4 @@
-<?xml version="1.0" encoding="UTF-8"?>
+<?xml version="1.0" encoding="UTF-8"?>
<!--
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
@@ -16,17 +16,13 @@
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
--->
-<beans
xmlns="http://www.springframework.org/schema/beans"
-
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="
-http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd">
-
-<bean id='JaxwsServiceBuilderBean'
class='org.apache.cxf.jaxws.JaxwsServiceBuilder' scope="prototype"
/>
-<bean id='SimpleServiceBuilderBean'
class='org.apache.cxf.simple.SimpleServiceBuilder' scope="prototype"
/>
-
-<bean id='JaxbDatabindingBean'
class="org.apache.cxf.jaxb.JAXBDataBinding" scope="prototype"/>
-<bean id='AegisDatabindingBean'
class="org.apache.cxf.aegis.databinding.AegisDatabinding"
scope="prototype" />
-
-
-</beans>
+-->
+<beans
xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="
http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd">
+ <bean id="JaxbDatabindingBean"
class="org.apache.cxf.jaxb.JAXBDataBinding" scope="prototype" />
+ <bean id="XmlbeansDatabindingBean"
class="org.apache.cxf.xmlbeans.XmlBeansDataBinding" scope="prototype"
/>
+ <bean id="SdoDatabindingBean"
class="org.apache.cxf.sdo.SDODataBinding" scope="prototype" />
+ <bean id="JaxwsServiceBuilderBean"
class="org.apache.cxf.jaxws.JaxwsServiceBuilder" scope="prototype"
/>
+ <bean id="SimpleServiceBuilderBean"
class="org.apache.cxf.simple.SimpleServiceBuilder" scope="prototype"
/>
+ <bean id="AegisDatabindingBean"
class="org.apache.cxf.aegis.databinding.AegisDatabinding"
scope="prototype" />
+</beans>
+
Deleted: stack/cxf/trunk/modules/client/src/main/resources/META-INF/cxf/jbossws-cxf.xml
===================================================================
---
stack/cxf/trunk/modules/client/src/main/resources/META-INF/cxf/jbossws-cxf.xml 2011-04-27
13:09:15 UTC (rev 14208)
+++
stack/cxf/trunk/modules/client/src/main/resources/META-INF/cxf/jbossws-cxf.xml 2011-04-28
10:57:21 UTC (rev 14209)
@@ -1,141 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements. See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership. The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License. You may obtain a copy of the License at
-
-
http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, either express or implied. See the License for the
- specific language governing permissions and limitations
- under the License.
--->
-<beans
xmlns="http://www.springframework.org/schema/beans"
-
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-
xmlns:context="http://www.springframework.org/schema/context"
- xsi:schemaLocation="
-http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd
-http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context-2.5.xsd"...
-
- <!-- For Testing using the Swing commons processor, uncomment one of:
- <bean
class="org.springframework.context.annotation.CommonAnnotationBeanPostProcessor"/>
- <context:annotation-config/>
- -->
- <bean id="cxf" class="org.apache.cxf.bus.CXFBusImpl"/>
- <bean id="org.apache.cxf.bus.spring.BusApplicationListener"
class="org.apache.cxf.bus.spring.BusApplicationListener"/>
- <bean id="org.apache.cxf.bus.spring.BusWiringBeanFactoryPostProcessor"
class="org.apache.cxf.bus.spring.BusWiringBeanFactoryPostProcessor"/>
- <bean id="org.apache.cxf.bus.spring.Jsr250BeanPostProcessor"
class="org.apache.cxf.bus.spring.Jsr250BeanPostProcessor"/>
- <bean id="org.apache.cxf.bus.spring.BusExtensionPostProcessor"
class="org.apache.cxf.bus.spring.BusExtensionPostProcessor"/>
-
- <bean id="org.apache.cxf.resource.ResourceManager"
class="org.apache.cxf.bus.resource.ResourceManagerImpl">
- <property name="resolvers">
- <list>
- <bean
class="org.apache.cxf.resource.ClasspathResolver"/>
- <bean
class="org.apache.cxf.resource.ClassLoaderResolver"/>
- <!-- The following can be commented on AS 6 when not using Spring
3.0.3 or greater; see JBWS-3039 -->
- <bean
class="org.apache.cxf.bus.spring.BusApplicationContextResourceResolver"/>
- </list>
- </property>
- <property name="bus" ref="cxf"/>
- </bean>
-
- <bean id="org.apache.cxf.configuration.Configurer"
class="org.jboss.wsf.stack.cxf.client.configuration.JBossWSSpringConfigurer">
- <property name="customizer">
- <bean
class="org.jboss.wsf.stack.cxf.client.configuration.BeanCustomizer"/>
- </property>
- </bean>
-
- <bean id="org.apache.cxf.binding.BindingFactoryManager"
- class="org.apache.cxf.binding.BindingFactoryManagerImpl"
- lazy-init="true">
- <constructor-arg ref="cxf"/>
- </bean>
-
- <bean id="org.apache.cxf.transport.DestinationFactoryManager"
- class="org.apache.cxf.transport.DestinationFactoryManagerImpl"
- lazy-init="true">
- <constructor-arg ref="cxf"/>
- </bean>
-
- <bean id="org.apache.cxf.transport.ConduitInitiatorManager"
- class="org.apache.cxf.transport.ConduitInitiatorManagerImpl"
- lazy-init="true">
- <constructor-arg ref="cxf"/>
- </bean>
-
- <bean id="org.apache.cxf.wsdl.WSDLManager"
- class="org.apache.cxf.wsdl11.WSDLManagerImpl"
- lazy-init="true">
- <constructor-arg ref="cxf"/>
- </bean>
-
- <bean id="org.apache.cxf.phase.PhaseManager"
- class="org.apache.cxf.phase.PhaseManagerImpl"
- lazy-init="true"/>
-
- <bean id="org.apache.cxf.workqueue.WorkQueueManager"
- class="org.apache.cxf.workqueue.WorkQueueManagerImpl"
- lazy-init="true">
- <constructor-arg ref="cxf"/>
- </bean>
-
- <bean id="org.apache.cxf.buslifecycle.BusLifeCycleManager"
- class="org.apache.cxf.buslifecycle.CXFBusLifeCycleManager"
- lazy-init="true">
- <constructor-arg ref="cxf"/>
- </bean>
-
- <bean id="org.apache.cxf.endpoint.ServerRegistry"
- class="org.apache.cxf.endpoint.ServerRegistryImpl"
- lazy-init="true">
- <constructor-arg ref="cxf"/>
- </bean>
-
- <bean id="org.apache.cxf.endpoint.ServerLifeCycleManager"
- class="org.apache.cxf.endpoint.ServerLifeCycleManagerImpl"
- lazy-init="true"/>
- <bean id="org.apache.cxf.endpoint.ClientLifeCycleManager"
- class="org.apache.cxf.endpoint.ClientLifeCycleManagerImpl"
- lazy-init="true"/>
-
-
- <bean id="org.apache.cxf.transports.http.QueryHandlerRegistry"
- class="org.apache.cxf.transport.http.QueryHandlerRegistryImpl"
- lazy-init="true">
- <constructor-arg ref="cxf"/>
- </bean>
-
- <bean id="org.apache.cxf.endpoint.EndpointResolverRegistry"
- class="org.apache.cxf.endpoint.EndpointResolverRegistryImpl"
- lazy-init="true">
- <constructor-arg ref="cxf"/>
- </bean>
- <bean id="org.apache.cxf.headers.HeaderManager"
- class="org.apache.cxf.headers.HeaderManagerImpl"
- lazy-init="true">
- <constructor-arg ref="cxf"/>
- </bean>
- <bean id="org.apache.cxf.catalog.OASISCatalogManager"
- class="org.apache.cxf.catalog.OASISCatalogManager"
- lazy-init="true">
- <constructor-arg ref="cxf"/>
- </bean>
- <bean id="org.apache.cxf.service.factory.FactoryBeanListenerManager"
- class="org.apache.cxf.service.factory.FactoryBeanListenerManager"
- lazy-init="true">
- <constructor-arg ref="cxf"/>
- </bean>
-
- <bean id="org.apache.cxf.endpoint.ServiceContractResolverRegistry"
- class="org.apache.cxf.endpoint.ServiceContractResolverRegistryImpl"
- lazy-init="true">
- <constructor-arg ref="cxf"/>
- </bean>
-</beans>
Modified: stack/cxf/trunk/modules/client/src/main/resources/META-INF/tools-plugin.xml
===================================================================
--- stack/cxf/trunk/modules/client/src/main/resources/META-INF/tools-plugin.xml 2011-04-27
13:09:15 UTC (rev 14208)
+++ stack/cxf/trunk/modules/client/src/main/resources/META-INF/tools-plugin.xml 2011-04-28
10:57:21 UTC (rev 14209)
@@ -32,7 +32,25 @@
<generator name="ServiceGenerator" />
</generators>
</frontend>
+ <frontend name="jaxws21"
package="org.apache.cxf.tools.wsdlto.frontend.jaxws"
profile="JAXWSProfile">
+ <container name="JAXWS21Container"
toolspec="jaxws-toolspec.xml" />
+ <processor name="WSDLToJavaProcessor"
package="org.apache.cxf.tools.wsdlto.frontend.jaxws.processor" />
+ <builder name="JAXWSDefinitionBuilder"
package="org.apache.cxf.tools.wsdlto.frontend.jaxws.wsdl11" />
+ <generators
package="org.apache.cxf.tools.wsdlto.frontend.jaxws.generators">
+ <generator name="AntGenerator" />
+ <generator name="ClientGenerator" />
+ <generator name="FaultGenerator" />
+ <generator name="ImplGenerator" />
+ <generator name="SEIGenerator" />
+ <generator name="ServerGenerator" />
+ <generator name="JAXWS21ServiceGenerator" />
+ </generators>
+ </frontend>
<databinding name="jaxb"
package="org.apache.cxf.tools.wsdlto.databinding.jaxb"
profile="JAXBDataBinding" />
<databinding name="xmlbeans"
package="org.apache.cxf.xmlbeans.tools"
profile="XMLBeansToolingDataBinding" />
+ <databinding name="jibx" package="org.apache.cxf.jibx.tools"
profile="JibxToolingDataBinding" />
+ <databinding name="sdo" package="org.apache.cxf.sdo.tools"
profile="SDODatabinding" />
+ <databinding name="sdo-dynamic"
package="org.apache.cxf.sdo.tools" profile="SDODatabinding" />
+ <databinding name="sdo-static"
package="org.apache.cxf.sdo.tools" profile="SDODatabinding" />
</plugin>
Modified: stack/cxf/trunk/modules/dist/src/main/scripts/assembly-deploy-artifacts.xml
===================================================================
--- stack/cxf/trunk/modules/dist/src/main/scripts/assembly-deploy-artifacts.xml 2011-04-27
13:09:15 UTC (rev 14208)
+++ stack/cxf/trunk/modules/dist/src/main/scripts/assembly-deploy-artifacts.xml 2011-04-28
10:57:21 UTC (rev 14209)
@@ -61,7 +61,7 @@
<include>org.jboss.ws:jbossws-spi:jar</include>
<include>org.apache.neethi:neethi:jar</include>
<include>wsdl4j:wsdl4j:jar</include>
- <include>org.apache.ws.commons.schema:XmlSchema:jar</include>
+ <include>org.apache.ws.xmlschema:xmlschema-core:jar</include>
<include>com.sun.xml.fastinfoset:FastInfoset:jar</include>
<include>org.apache.ws.security:wss4j:jar</include>
<include>org.apache.santuario:xmlsec:jar</include>
Modified:
stack/cxf/trunk/modules/resources/src/main/resources/modules/org/apache/cxf/main/module.xml
===================================================================
---
stack/cxf/trunk/modules/resources/src/main/resources/modules/org/apache/cxf/main/module.xml 2011-04-27
13:09:15 UTC (rev 14208)
+++
stack/cxf/trunk/modules/resources/src/main/resources/modules/org/apache/cxf/main/module.xml 2011-04-28
10:57:21 UTC (rev 14209)
@@ -42,7 +42,7 @@
<module name="javax.xml.ws.api" />
<module name="org.apache.neethi" />
<module name="org.apache.velocity" />
- <module name="org.apache.ws.commons.xmlschema" />
+ <module name="org.apache.ws.xmlschema" />
<module name="org.apache.ws.security" />
<module name="org.apache.santuario.xmlsec" />
<module name="org.springframework.spring"
optional="true"/>
Added:
stack/cxf/trunk/modules/resources/src/main/resources/modules/org/apache/ws/xmlschema/main/module.xml
===================================================================
---
stack/cxf/trunk/modules/resources/src/main/resources/modules/org/apache/ws/xmlschema/main/module.xml
(rev 0)
+++
stack/cxf/trunk/modules/resources/src/main/resources/modules/org/apache/ws/xmlschema/main/module.xml 2011-04-28
10:57:21 UTC (rev 14209)
@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+ ~ JBoss, Home of Professional Open Source.
+ ~ Copyright 2011, Red Hat, Inc., 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.
+ -->
+
+<module xmlns="urn:jboss:module:1.0"
name="org.apache.ws.xmlschema">
+
+ <resources>
+ <!-- Insert resources here -->
+ </resources>
+
+ <dependencies>
+ <module name="javax.api" />
+ </dependencies>
+</module>
Modified:
stack/cxf/trunk/modules/resources/src/main/resources/resources/jbossws-deploy-macros.xml
===================================================================
---
stack/cxf/trunk/modules/resources/src/main/resources/resources/jbossws-deploy-macros.xml 2011-04-27
13:09:15 UTC (rev 14208)
+++
stack/cxf/trunk/modules/resources/src/main/resources/resources/jbossws-deploy-macros.xml 2011-04-28
10:57:21 UTC (rev 14209)
@@ -49,7 +49,7 @@
<include name="**/wsdl4j.jar"/>
<include name="**/wss4j.jar"/>
<include name="**/wstx.jar"/>
- <include name="**/XmlSchema.jar"/>
+ <include name="**/xmlschema-core.jar"/>
<include name="**/FastInfoset.jar"/>
<include name="**/wstx.jar"/>
</patternset>
@@ -81,7 +81,7 @@
<include name="**/jbossws-spi.jar"/>
<include name="**/jdom.jar"/>
<include name="**/neethi.jar"/>
- <include name="**/XmlSchema.jar"/>
+ <include name="**/xmlschema-core.jar"/>
<include name="**/xmlsec.jar"/>
<include name="**/wsdl4j.jar"/>
<include name="**/wss4j.jar"/>
@@ -382,9 +382,9 @@
<include name="**/neethi.jar"/>
</fileset>
</copy>
- <copy todir="@{targetdir}/org/apache/ws/commons/xmlschema/main"
flatten="false" overwrite="true">
+ <copy todir="@{targetdir}/org/apache/ws/xmlschema/main"
flatten="false" overwrite="true">
<fileset dir="@{thirdpartydir}/lib">
- <include name="**/XmlSchema.jar"/>
+ <include name="**/xmlschema-core.jar"/>
</fileset>
</copy>
<copy todir="@{targetdir}/org/jboss/as/webservices/main"
flatten="false" overwrite="true">
Modified:
stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/CXFNonSpringServletExt.java
===================================================================
---
stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/CXFNonSpringServletExt.java 2011-04-27
13:09:15 UTC (rev 14208)
+++
stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/CXFNonSpringServletExt.java 2011-04-28
10:57:21 UTC (rev 14209)
@@ -1,6 +1,6 @@
/*
* JBoss, Home of Professional Open Source.
- * Copyright 2010, Red Hat Middleware LLC, and individual contributors
+ * Copyright 2011, 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.
*
@@ -29,12 +29,11 @@
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
+import org.apache.cxf.Bus;
import org.apache.cxf.BusFactory;
import org.apache.cxf.resource.ResourceManager;
-import org.apache.cxf.transport.servlet.CXFNonSpringServlet;
+import org.apache.cxf.transport.servlet.AbstractHTTPServlet;
import org.apache.cxf.transport.servlet.ServletContextResourceResolver;
-import org.apache.cxf.transport.servlet.ServletController;
-import org.apache.cxf.transport.servlet.ServletTransportFactory;
import org.jboss.wsf.spi.deployment.Endpoint;
import org.jboss.wsf.spi.deployment.ServletDelegate;
import org.jboss.wsf.stack.cxf.configuration.BusHolder;
@@ -47,19 +46,18 @@
* @since 16-Jun-2010
*
*/
-public class CXFNonSpringServletExt extends CXFNonSpringServlet implements
ServletDelegate
+public class CXFNonSpringServletExt extends AbstractHTTPServlet implements
ServletDelegate
{
protected Endpoint endpoint;
+ protected Bus bus;
@Override
- public ServletController createServletController(ServletConfig servletConfig)
- {
- ServletTransportFactory stf = (ServletTransportFactory)
createServletTransportFactory();
- return new ServletControllerExt(stf, servletConfig,
servletConfig.getServletContext(), bus);
+ public void init(ServletConfig sc) throws ServletException {
+ super.init(sc);
+ loadBus(sc);
}
- @Override
- public void loadBus(ServletConfig servletConfig) throws ServletException
+ protected void loadBus(ServletConfig servletConfig) throws ServletException
{
//Init the Endpoint
endpoint = ServletHelper.initEndpoint(servletConfig, getServletName());
@@ -69,7 +67,6 @@
//register the InstrumentManagementImpl
ServletHelper.registerInstrumentManger(bus, getServletContext());
-
}
private void updateAvailableBusWithServletInfo(ServletConfig servletConfig)
@@ -81,17 +78,12 @@
//update the resource manager adding the ServletContextResourceResolver that was to
be added by CXF servlet
ResourceManager resourceManager = bus.getExtension(ResourceManager.class);
resourceManager.addResourceResolver(new
ServletContextResourceResolver(servletConfig.getServletContext()));
- replaceDestinationFactory();
- //set up the ServletController as the CXF servlet would have done
- controller = createServletController(servletConfig);
- //set the controller in the servlet context now that the bus has been configured in
the servlet
- servletConfig.getServletContext().setAttribute(ServletController.class.getName(),
getController());
}
@Override
protected void invoke(HttpServletRequest req, HttpServletResponse res) throws
ServletException
{
- ServletHelper.callRequestHandler(req, res, getServletContext(), getBus(),
endpoint);
+ ServletHelper.callRequestHandler(req, res, getServletContext(), bus, endpoint);
}
@Override
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 2011-04-27
13:09:15 UTC (rev 14208)
+++
stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/CXFServletExt.java 2011-04-28
10:57:21 UTC (rev 14209)
@@ -21,24 +21,7 @@
*/
package org.jboss.wsf.stack.cxf;
-import java.io.IOException;
-
-import javax.servlet.ServletConfig;
-import javax.servlet.ServletContext;
-import javax.servlet.ServletException;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-
-import org.apache.cxf.BusFactory;
-import org.apache.cxf.resource.ResourceManager;
-import org.apache.cxf.transport.servlet.CXFServlet;
-import org.apache.cxf.transport.servlet.ServletContextResourceResolver;
-import org.apache.cxf.transport.servlet.ServletController;
-import org.apache.cxf.transport.servlet.ServletTransportFactory;
-import org.jboss.wsf.spi.deployment.Endpoint;
import org.jboss.wsf.spi.deployment.ServletDelegate;
-import org.jboss.wsf.stack.cxf.configuration.BusHolder;
-import org.jboss.wsf.stack.cxf.transport.ServletHelper;
/**
* An extension to the CXF servlet
@@ -48,97 +31,7 @@
*
* @since 21-Apr-2007
*/
-public class CXFServletExt extends CXFServlet implements ServletDelegate
+public class CXFServletExt extends CXFNonSpringServletExt implements ServletDelegate
{
- protected Endpoint endpoint;
- @Override
- public ServletController createServletController(ServletConfig servletConfig)
- {
- ServletTransportFactory stf = (ServletTransportFactory)
createServletTransportFactory();
- return new ServletControllerExt(stf, servletConfig,
servletConfig.getServletContext(), bus);
- }
-
- @Override
- public void loadBus(ServletConfig servletConfig) throws ServletException
- {
- //Init the Endpoint
- endpoint = ServletHelper.initEndpoint(servletConfig, getServletName());
-
- //keep the bus created during deployment and update it with the information coming
from the servlet config
- updateAvailableBusWithServletInfo(servletConfig);
-
- //register the InstrumentManagementImpl
- ServletHelper.registerInstrumentManger(bus, getServletContext());
- }
-
- private void updateAvailableBusWithServletInfo(ServletConfig servletConfig)
- {
- BusHolder holder =
endpoint.getService().getDeployment().getAttachment(BusHolder.class);
- //set the bus from deployment into the CXF servlet and assign it to the current
thread (do not touch the default bus!)
- bus = holder.getBus();
- BusFactory.setThreadDefaultBus(bus);
- //update the resource manager adding the ServletContextResourceResolver that was to
be added by CXF servlet
- ResourceManager resourceManager = bus.getExtension(ResourceManager.class);
- resourceManager.addResourceResolver(new
ServletContextResourceResolver(servletConfig.getServletContext()));
- replaceDestinationFactory();
- //set up the ServletController as the CXF servlet would have done
- controller = createServletController(servletConfig);
- //set the controller in the servlet context now that the bus has been configured in
the servlet
- servletConfig.getServletContext().setAttribute(ServletController.class.getName(),
getController());
- }
-
- @Override
- protected void invoke(HttpServletRequest req, HttpServletResponse res) throws
ServletException
- {
- ServletHelper.callRequestHandler(req, res, getServletContext(), getBus(),
endpoint);
- }
-
- @Override
- public void destroy()
- {
- ServletHelper.callPreDestroy(endpoint);
- }
-
- @Override
- public void doHead(HttpServletRequest request, HttpServletResponse response,
ServletContext context)
- throws ServletException, IOException
- {
- this.doHead(request, response);
- }
-
- @Override
- public void doGet(HttpServletRequest request, HttpServletResponse response,
ServletContext context)
- throws ServletException, IOException
- {
- this.doGet(request, response);
- }
-
- @Override
- public void doPost(HttpServletRequest request, HttpServletResponse response,
ServletContext context)
- throws ServletException, IOException
- {
- this.doPost(request, response);
- }
-
- @Override
- public void doPut(HttpServletRequest request, HttpServletResponse response,
ServletContext context)
- throws ServletException, IOException
- {
- this.doPut(request, response);
- }
-
- @Override
- public void doDelete(HttpServletRequest request, HttpServletResponse response,
ServletContext context)
- throws ServletException, IOException
- {
- this.doDelete(request, response);
- }
-
- @Override
- public void service(HttpServletRequest request, HttpServletResponse response,
ServletContext context)
- throws ServletException, IOException
- {
- this.service(request, response);
- }
}
Modified:
stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/RequestHandlerImpl.java
===================================================================
---
stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/RequestHandlerImpl.java 2011-04-27
13:09:15 UTC (rev 14208)
+++
stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/RequestHandlerImpl.java 2011-04-28
10:57:21 UTC (rev 14209)
@@ -1,6 +1,6 @@
/*
* JBoss, Home of Professional Open Source.
- * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * Copyright 2011, 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.
*
@@ -24,17 +24,37 @@
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
+import java.net.MalformedURLException;
+import java.net.URL;
+import java.util.Collection;
+import javax.servlet.ServletConfig;
import javax.servlet.ServletContext;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
-import org.apache.cxf.transport.servlet.ServletController;
+import org.apache.cxf.Bus;
+import org.apache.cxf.BusException;
+import org.apache.cxf.frontend.WSDLGetInterceptor;
+import org.apache.cxf.service.model.EndpointInfo;
+import org.apache.cxf.transport.DestinationFactory;
+import org.apache.cxf.transport.DestinationFactoryManager;
+import org.apache.cxf.transport.http.AbstractHTTPDestination;
+import org.apache.cxf.transport.http.DestinationRegistry;
+import org.apache.cxf.transport.http.HTTPTransportFactory;
+import org.apache.cxf.transports.http.QueryHandler;
+import org.apache.cxf.transports.http.QueryHandlerRegistry;
import org.jboss.util.NotImplementedException;
+import org.jboss.wsf.spi.SPIProvider;
+import org.jboss.wsf.spi.SPIProviderResolver;
import org.jboss.wsf.spi.deployment.Endpoint;
import org.jboss.wsf.spi.invocation.InvocationContext;
import org.jboss.wsf.spi.invocation.RequestHandler;
+import org.jboss.wsf.spi.management.EndpointMetrics;
+import org.jboss.wsf.spi.management.ServerConfig;
+import org.jboss.wsf.spi.management.ServerConfigFactory;
+import org.jboss.wsf.stack.cxf.configuration.BusHolder;
/**
* A request handler
@@ -44,17 +64,42 @@
*/
public class RequestHandlerImpl implements RequestHandler
{
+ private ServerConfig serverConfig;
+
RequestHandlerImpl()
{
+ final SPIProvider spiProvider = SPIProviderResolver.getInstance().getProvider();
+ serverConfig = spiProvider.getSPI(ServerConfigFactory.class).getServerConfig();
}
public void handleHttpRequest(Endpoint ep, HttpServletRequest req, HttpServletResponse
res, ServletContext context) throws ServletException, IOException
{
- ServletControllerExt controller =
(ServletControllerExt)context.getAttribute(ServletController.class.getName());
- if (controller == null)
- throw new IllegalStateException("Cannot obtain servlet controller");
-
- controller.invoke(req, res, ep);
+ Bus bus = ep.getService().getDeployment().getAttachment(BusHolder.class).getBus();
+ AbstractHTTPDestination dest = findDestination(req, bus);
+
+ boolean requestHandled = handleQuery(req, res, dest, bus);
+ if (false == requestHandled)
+ {
+ Long beginTime = initRequestMetrics(ep);
+ HttpServletResponseExt response = new HttpServletResponseExt(res);
+ try
+ {
+ ServletConfig cfg =
(ServletConfig)context.getAttribute(ServletConfig.class.getName());
+ dest.invoke(cfg, context, req, response);
+ }
+ catch (IOException e)
+ {
+ throw new ServletException(e);
+ }
+ if (response.getStatus() < 500)
+ {
+ processResponseMetrics(ep, beginTime);
+ }
+ else
+ {
+ processFaultMetrics(ep, beginTime);
+ }
+ }
}
public void handleRequest(Endpoint endpoint, InputStream inStream, OutputStream
outStream, InvocationContext context)
@@ -66,4 +111,140 @@
{
throw new NotImplementedException();
}
+
+ /**
+ * Finds destination based on request URI
+ * @param requestURI to be recognized
+ * @return destination associated with the request URI
+ * @throws ServletException when destination wasn't found
+ */
+ private AbstractHTTPDestination findDestination(HttpServletRequest req, Bus bus)
throws ServletException
+ {
+ // Find destination based on request URI
+ String requestURI = req.getRequestURI();
+ DestinationRegistry destRegistry = getDestinationRegistryFromBus(bus);
+ if (destRegistry == null)
+ {
+ throw new ServletException("Cannot obtain DestinationRegistry!");
+ }
+ Collection<AbstractHTTPDestination> destinations =
destRegistry.getDestinations();
+ AbstractHTTPDestination returnValue = null;
+ for (AbstractHTTPDestination destination : destinations)
+ {
+ EndpointInfo endpointInfo = destination.getEndpointInfo();
+ String address = endpointInfo.getAddress();
+
+ String path = address;
+ try
+ {
+ path = new URL(address).getPath();
+ }
+ catch (MalformedURLException ex)
+ {
+ // ignore
+ }
+
+ if (path != null)
+ {
+ if (requestURI.equals(path))
+ {
+ return destination; // exact match
+ }
+ else if (requestURI.startsWith(path))
+ {
+ returnValue = destination; // fallback
+ }
+ }
+ }
+
+ if (returnValue == null)
+ throw new ServletException("Cannot obtain destination for: " +
requestURI);
+
+ return returnValue;
+ }
+
+ private static DestinationRegistry getDestinationRegistryFromBus(Bus bus) throws
ServletException {
+ DestinationFactoryManager dfm = bus.getExtension(DestinationFactoryManager.class);
+ try {
+ DestinationFactory df = dfm
+
.getDestinationFactory("http://cxf.apache.org/transports/http/configuration");
+ if (df instanceof HTTPTransportFactory) {
+ HTTPTransportFactory transportFactory = (HTTPTransportFactory)df;
+ return transportFactory.getRegistry();
+ }
+ } catch (BusException e) {
+ throw new ServletException("Cannot get DestinationFactory for http
transport!");
+ }
+ return null;
+ }
+
+ /**
+ * When request includes query it tries to lookup the query handler and tries to
handle the request message
+ * @param req request
+ * @param res response
+ * @param dest destination
+ * @return true if there was a query handler that successfully handled the request,
false otherwise
+ * @throws ServletException if some problem occurs
+ */
+ private boolean handleQuery(HttpServletRequest req, HttpServletResponse res,
AbstractHTTPDestination dest, Bus bus)
+ throws ServletException
+ {
+ boolean hasQuery = (null != req.getQueryString()) &&
(req.getQueryString().length() > 0);
+ boolean queryHandlerRegistryExists = bus.getExtension(QueryHandlerRegistry.class)
!= null;
+
+ if (hasQuery && queryHandlerRegistryExists)
+ {
+ String ctxUri = req.getRequestURI();
+ String baseUri = req.getRequestURL().toString() + "?" +
req.getQueryString();
+ EndpointInfo endpointInfo = dest.getEndpointInfo();
+ endpointInfo.setProperty(WSDLGetInterceptor.AUTO_REWRITE_ADDRESS,
+
ServerConfig.UNDEFINED_HOSTNAME.equals(serverConfig.getWebServiceHost()));
+
+ for (QueryHandler queryHandler :
bus.getExtension(QueryHandlerRegistry.class).getHandlers())
+ {
+ if (queryHandler.isRecognizedQuery(baseUri, ctxUri, endpointInfo))
+ {
+ res.setContentType(queryHandler.getResponseContentType(baseUri, ctxUri));
+ try
+ {
+ OutputStream out = res.getOutputStream();
+ queryHandler.writeResponse(baseUri, ctxUri, endpointInfo, out);
+ out.flush();
+ return true;
+ }
+ catch (Exception e)
+ {
+ throw new ServletException(e);
+ }
+ }
+ }
+ }
+
+ return false;
+ }
+
+ private long initRequestMetrics(Endpoint endpoint)
+ {
+ long beginTime = 0;
+
+ EndpointMetrics metrics = endpoint.getEndpointMetrics();
+ if (metrics != null)
+ beginTime = metrics.processRequestMessage();
+
+ return beginTime;
+ }
+
+ private void processResponseMetrics(Endpoint endpoint, long beginTime)
+ {
+ EndpointMetrics metrics = endpoint.getEndpointMetrics();
+ if (metrics != null)
+ metrics.processResponseMessage(beginTime);
+ }
+
+ private void processFaultMetrics(Endpoint endpoint, long beginTime)
+ {
+ EndpointMetrics metrics = endpoint.getEndpointMetrics();
+ if (metrics != null)
+ metrics.processFaultMessage(beginTime);
+ }
}
Deleted:
stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/ServletControllerExt.java
===================================================================
---
stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/ServletControllerExt.java 2011-04-27
13:09:15 UTC (rev 14208)
+++
stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/ServletControllerExt.java 2011-04-28
10:57:21 UTC (rev 14209)
@@ -1,211 +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.OutputStream;
-import java.net.MalformedURLException;
-import java.net.URL;
-import java.util.Collection;
-
-import javax.servlet.ServletConfig;
-import javax.servlet.ServletContext;
-import javax.servlet.ServletException;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-
-import org.apache.cxf.Bus;
-import org.apache.cxf.service.model.EndpointInfo;
-import org.apache.cxf.transport.servlet.ServletController;
-import org.apache.cxf.transport.servlet.ServletDestination;
-import org.apache.cxf.transport.servlet.ServletTransportFactory;
-import org.apache.cxf.transports.http.QueryHandler;
-import org.apache.cxf.transports.http.QueryHandlerRegistry;
-import org.jboss.wsf.spi.SPIProvider;
-import org.jboss.wsf.spi.SPIProviderResolver;
-import org.jboss.wsf.spi.classloading.ClassLoaderProvider;
-import org.jboss.wsf.spi.deployment.Endpoint;
-import org.jboss.wsf.spi.management.EndpointMetrics;
-import org.jboss.wsf.spi.management.ServerConfig;
-import org.jboss.wsf.spi.management.ServerConfigFactory;
-
-/**
- * An extension to the CXF servlet controller
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 21-Apr-2007
- */
-public class ServletControllerExt extends ServletController
-{
- private ServletTransportFactory cxfTransport;
- private Bus bus;
- private ServerConfig serverConfig;
-
- public ServletControllerExt(ServletTransportFactory cxfTransport, ServletConfig
config, ServletContext servletCtx, Bus bus)
- {
- super(cxfTransport, config, servletCtx, bus);
- this.cxfTransport = cxfTransport;
- this.bus = bus;
- ClassLoader cl =
ClassLoaderProvider.getDefaultProvider().getServerIntegrationClassLoader();
- SPIProvider spiProvider = SPIProviderResolver.getInstance(cl).getProvider();
- serverConfig = spiProvider.getSPI(ServerConfigFactory.class,
cl).getServerConfig();
- }
-
- /**
- * Finds destination based on request URI
- * @param requestURI to be recognized
- * @return destination associated with the request URI
- * @throws ServletException when destination wasn't found
- */
- private ServletDestination findDestination(HttpServletRequest req) throws
ServletException
- {
- // Find destination based on request URI
- String requestURI = req.getRequestURI();
- Collection<ServletDestination> destinations =
cxfTransport.getDestinations();
- ServletDestination returnValue = null;
- for (ServletDestination destination : destinations)
- {
- EndpointInfo endpointInfo = destination.getEndpointInfo();
- String address = endpointInfo.getAddress();
-
- String path = address;
- try
- {
- path = new URL(address).getPath();
- }
- catch (MalformedURLException ex)
- {
- // ignore
- }
-
- if (path != null)
- {
- if (requestURI.equals(path))
- {
- return destination; // exact match
- }
- else if (requestURI.startsWith(path))
- {
- returnValue = destination; // fallback
- }
- }
- }
-
- if (returnValue == null)
- throw new ServletException("Cannot obtain destination for: " +
requestURI);
-
- return returnValue;
- }
-
- /**
- * When request includes query it tries to lookup the query handler and tries to
handle the request message
- * @param req request
- * @param res response
- * @param dest destination
- * @return true if there was a query handler that successfully handled the request,
false otherwise
- * @throws ServletException if some problem occurs
- */
- private boolean handleQuery(HttpServletRequest req, HttpServletResponse res,
ServletDestination dest)
- throws ServletException
- {
- boolean hasQuery = (null != req.getQueryString()) &&
(req.getQueryString().length() > 0);
- boolean queryHandlerRegistryExists = bus.getExtension(QueryHandlerRegistry.class)
!= null;
-
- if (hasQuery && queryHandlerRegistryExists)
- {
- String ctxUri = req.getRequestURI();
- String baseUri = req.getRequestURL().toString() + "?" +
req.getQueryString();
- EndpointInfo endpointInfo = dest.getEndpointInfo();
- if (ServerConfig.UNDEFINED_HOSTNAME.equals(serverConfig.getWebServiceHost()))
- {
- endpointInfo.setProperty("autoRewriteSoapAddress", true);
- }
-
- for (QueryHandler queryHandler :
bus.getExtension(QueryHandlerRegistry.class).getHandlers())
- {
- if (queryHandler.isRecognizedQuery(baseUri, ctxUri, endpointInfo))
- {
- res.setContentType(queryHandler.getResponseContentType(baseUri, ctxUri));
- try
- {
- OutputStream out = res.getOutputStream();
- queryHandler.writeResponse(baseUri, ctxUri, endpointInfo, out);
- out.flush();
- return true;
- }
- catch (Exception e)
- {
- throw new ServletException(e);
- }
- }
- }
- }
-
- return false;
- }
-
- public void invoke(HttpServletRequest req, HttpServletResponse res, Endpoint ep)
throws ServletException
- {
- ServletDestination dest = findDestination(req);
- boolean requestHandled = handleQuery(req, res, dest);
-
- if (false == requestHandled)
- {
- Long beginTime = initRequestMetrics(ep);
- HttpServletResponseExt response = new HttpServletResponseExt(res);
- invokeDestination(req, response, dest);
- if (response.getStatus() < 500)
- {
- processResponseMetrics(ep, beginTime);
- }
- else
- {
- processFaultMetrics(ep, beginTime);
- }
- }
- }
-
- private long initRequestMetrics(Endpoint endpoint)
- {
- long beginTime = 0;
-
- EndpointMetrics metrics = endpoint.getEndpointMetrics();
- if (metrics != null)
- beginTime = metrics.processRequestMessage();
-
- return beginTime;
- }
-
- private void processResponseMetrics(Endpoint endpoint, long beginTime)
- {
- EndpointMetrics metrics = endpoint.getEndpointMetrics();
- if (metrics != null)
- metrics.processResponseMessage(beginTime);
- }
-
- private void processFaultMetrics(Endpoint endpoint, long beginTime)
- {
- EndpointMetrics metrics = endpoint.getEndpointMetrics();
- if (metrics != null)
- metrics.processFaultMessage(beginTime);
- }
-
-}
Deleted:
stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/configuration/JBossWSServerSpringConfigurer.java
===================================================================
---
stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/configuration/JBossWSServerSpringConfigurer.java 2011-04-27
13:09:15 UTC (rev 14208)
+++
stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/configuration/JBossWSServerSpringConfigurer.java 2011-04-28
10:57:21 UTC (rev 14209)
@@ -1,40 +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.configuration;
-
-import org.jboss.wsf.stack.cxf.client.configuration.JBossWSSpringConfigurer;
-import org.springframework.context.ApplicationContext;
-
-/**
- * A JBossWS CXF Configurer (Spring based) to be used on server side
- *
- * @author alessio.soldano(a)jboss.com
- * @author ema(a)redhat.com
- * @since 31-Mar-2010
- */
-public class JBossWSServerSpringConfigurer extends JBossWSSpringConfigurer
-{
- public JBossWSServerSpringConfigurer(ApplicationContext ctx)
- {
- setApplicationContext(ctx);
- }
-}
Modified:
stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/configuration/NonSpringBusHolder.java
===================================================================
---
stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/configuration/NonSpringBusHolder.java 2011-04-27
13:09:15 UTC (rev 14208)
+++
stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/configuration/NonSpringBusHolder.java 2011-04-28
10:57:21 UTC (rev 14209)
@@ -28,13 +28,11 @@
import javax.xml.ws.soap.SOAPBinding;
import org.apache.cxf.binding.soap.SoapTransportFactory;
-import org.apache.cxf.bus.extension.ExtensionManager;
import org.apache.cxf.configuration.Configurer;
import org.apache.cxf.resource.ResourceResolver;
import org.apache.cxf.service.invoker.Invoker;
-import org.apache.cxf.transport.ConduitInitiator;
-import org.apache.cxf.transport.DestinationFactory;
-import org.apache.cxf.transport.servlet.ServletTransportFactory;
+import org.apache.cxf.transport.http.HttpDestinationFactory;
+import org.apache.cxf.transport.servlet.ServletDestinationFactory;
import org.apache.cxf.ws.addressing.WSAddressingFeature;
import org.apache.cxf.ws.rm.RMManager;
import org.jboss.wsf.spi.binding.BindingCustomization;
@@ -66,14 +64,8 @@
super();
this.metadata = metadata;
bus = new JBossWSNonSpringBusFactory().createBus();
- //Force servlet transport to prevent CXF from using Jetty or other transports
- ExtensionManager em = bus.getExtension(ExtensionManager.class);
- em.activateAllByType(ConduitInitiator.class); //need to activate/register all the
beans implementing ConduitInitiator so that does not happen later
- DestinationFactory factory = new ServletTransportFactory(bus);
- for (String s : factory.getTransportIds())
- {
- registerTransport(factory, s);
- }
+ //Force servlet transport to prevent CXF from using Jetty / http server or other
transports
+ bus.setExtension(new ServletDestinationFactory(), HttpDestinationFactory.class);
}
/**
Modified:
stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/configuration/SpringBusHolder.java
===================================================================
---
stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/configuration/SpringBusHolder.java 2011-04-27
13:09:15 UTC (rev 14208)
+++
stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/configuration/SpringBusHolder.java 2011-04-28
10:57:21 UTC (rev 14209)
@@ -1,6 +1,6 @@
/*
* JBoss, Home of Professional Open Source.
- * Copyright 2010, Red Hat Middleware LLC, and individual contributors
+ * Copyright 2011, 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.
*
@@ -32,13 +32,14 @@
import org.apache.cxf.bus.spring.BusApplicationContext;
import org.apache.cxf.configuration.Configurer;
import org.apache.cxf.resource.ResourceResolver;
-import org.apache.cxf.transport.DestinationFactory;
-import org.apache.cxf.transport.servlet.ServletTransportFactory;
+import org.apache.cxf.transport.http.HttpDestinationFactory;
+import org.apache.cxf.transport.servlet.ServletDestinationFactory;
import org.apache.ws.security.WSSConfig;
import org.jboss.logging.Logger;
import org.jboss.wsf.spi.binding.BindingCustomization;
import org.jboss.wsf.spi.deployment.Endpoint;
import org.jboss.wsf.stack.cxf.client.configuration.JBossWSSpringBusFactory;
+import org.jboss.wsf.stack.cxf.client.configuration.JBossWSSpringConfigurer;
import org.jboss.wsf.stack.cxf.deployment.WSDLFilePublisher;
import org.jboss.wsf.stack.cxf.spring.handler.NamespaceHandlerResolver;
import org.springframework.beans.factory.xml.XmlBeanDefinitionReader;
@@ -96,12 +97,8 @@
log.trace("Could not load additional config from location: " +
location, e);
}
}
- //Force servlet transport to prevent CXF from using Jetty or other transports
- DestinationFactory factory = new ServletTransportFactory(bus);
- for (String s : factory.getTransportIds())
- {
- registerTransport(factory, s);
- }
+ //Force servlet transport to prevent CXF from using Jetty / http server or other
transports
+ bus.setExtension(new ServletDestinationFactory(), HttpDestinationFactory.class);
}
/**
@@ -160,7 +157,9 @@
customizer.setBindingCustomization(customization);
customizer.setWsdlPublisher(wsdlPublisher);
customizer.setDeploymentEndpoints(depEndpoints);
- JBossWSServerSpringConfigurer serverConfigurer = new
JBossWSServerSpringConfigurer(ctx);
+ Configurer orig = bus.getExtension(Configurer.class);
+ JBossWSSpringConfigurer serverConfigurer = (orig instanceof
JBossWSSpringConfigurer) ? (JBossWSSpringConfigurer)orig : new
JBossWSSpringConfigurer(orig);
+ serverConfigurer.setApplicationContext(ctx);
serverConfigurer.setCustomizer(customizer);
return serverConfigurer;
}
Modified:
stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/security/authentication/SubjectCreatingInterceptor.java
===================================================================
---
stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/security/authentication/SubjectCreatingInterceptor.java 2011-04-27
13:09:15 UTC (rev 14208)
+++
stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/security/authentication/SubjectCreatingInterceptor.java 2011-04-28
10:57:21 UTC (rev 14209)
@@ -25,6 +25,7 @@
import java.security.Principal;
import java.util.Calendar;
import java.util.Collections;
+import java.util.HashMap;
import java.util.Map;
import javax.security.auth.Subject;
@@ -69,7 +70,7 @@
public SubjectCreatingInterceptor()
{
- this(Collections.<String, Object> emptyMap());
+ this(new HashMap<String, Object>());
}
public SubjectCreatingInterceptor(Map<String, Object> properties)
Modified:
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 2011-04-27
13:09:15 UTC (rev 14208)
+++
stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/spring/parser/JaxwsEndpointDefinitionParser.java 2011-04-28
10:57:21 UTC (rev 14209)
@@ -22,9 +22,10 @@
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.configuration.Configurer;
import org.apache.cxf.jaxws.spring.EndpointDefinitionParser;
+import org.jboss.wsf.stack.cxf.client.configuration.JBossWSSpringConfigurer;
import org.jboss.wsf.stack.cxf.deployment.EndpointImpl;
import org.springframework.beans.BeansException;
import org.springframework.context.ApplicationContext;
@@ -63,9 +64,13 @@
{
if (getBus() == null)
{
- Bus bus = BusFactory.getThreadDefaultBus();
- BusWiringBeanFactoryPostProcessor.updateBusReferencesInContext(bus, ctx);
+ Bus bus = BusWiringBeanFactoryPostProcessor.addDefaultBus(ctx);
setBus(bus);
+ Configurer configurer = bus.getExtension(Configurer.class);
+ if (configurer instanceof JBossWSSpringConfigurer)
+ {
+ ((JBossWSSpringConfigurer) configurer).addApplicationContext(ctx);
+ }
}
}
}
Modified:
stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/transport/ServletHelper.java
===================================================================
---
stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/transport/ServletHelper.java 2011-04-27
13:09:15 UTC (rev 14208)
+++
stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/transport/ServletHelper.java 2011-04-28
10:57:21 UTC (rev 14209)
@@ -73,6 +73,7 @@
ServletContext context = servletConfig.getServletContext();
String contextPath = context.getContextPath();
+ context.setAttribute(ServletConfig.class.getName(), servletConfig);
return initServiceEndpoint(epRegistry, contextPath, servletName);
}
Modified:
stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/transport/SoapTransportFactoryExt.java
===================================================================
---
stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/transport/SoapTransportFactoryExt.java 2011-04-27
13:09:15 UTC (rev 14208)
+++
stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/transport/SoapTransportFactoryExt.java 2011-04-28
10:57:21 UTC (rev 14209)
@@ -1,6 +1,6 @@
/*
* JBoss, Home of Professional Open Source.
- * Copyright 2009, Red Hat Middleware LLC, and individual contributors
+ * Copyright 2011, 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.
*
@@ -24,9 +24,8 @@
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.jms.interceptor.SoapJMSConstants;
import org.apache.cxf.binding.soap.model.SoapBindingInfo;
import org.apache.cxf.service.model.BindingInfo;
import org.apache.cxf.service.model.EndpointInfo;
@@ -50,22 +49,22 @@
public class SoapTransportFactoryExt extends SoapTransportFactory
{
private ServerConfig serverConfig;
-
- @SuppressWarnings("unchecked")
- public EndpointInfo createEndpointInfo(ServiceInfo serviceInfo, BindingInfo b, Port
port)
+
+ @Override
+ public EndpointInfo createEndpointInfo(ServiceInfo serviceInfo, BindingInfo b,
List<?> ees)
{
String transportURI = "http://schemas.xmlsoap.org/wsdl/soap/";
if (b instanceof SoapBindingInfo)
{
- SoapBindingInfo sbi = (SoapBindingInfo)b;
+ SoapBindingInfo sbi = (SoapBindingInfo) b;
transportURI = sbi.getTransportURI();
}
ServerConfig config = getServerConfig();
EndpointInfo info = new AddressRewritingEndpointInfo(serviceInfo, transportURI,
config);
- if (port != null)
+
+ if (ees != null)
{
- List ees = port.getExtensibilityElements();
- for (Iterator itr = ees.iterator(); itr.hasNext();)
+ for (@SuppressWarnings("rawtypes")Iterator itr = ees.iterator();
itr.hasNext();)
{
Object extensor = itr.next();
@@ -75,6 +74,10 @@
info.addExtensor(sa);
info.setAddress(sa.getLocationURI());
+ if (isJMSSpecAddress(sa.getLocationURI()))
+ {
+
info.setTransportId(SoapJMSConstants.SOAP_JMS_SPECIFICIATION_TRANSPORTID);
+ }
}
else
{
@@ -82,9 +85,15 @@
}
}
}
+
return info;
}
-
+
+ private boolean isJMSSpecAddress(String address)
+ {
+ return address != null && address.startsWith("jms:") &&
!"jms://".equals(address);
+ }
+
private ServerConfig getServerConfig()
{
if (serverConfig == null)
Modified:
stack/cxf/trunk/modules/testsuite/cxf-spring-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/CustomSubjectCreatingInterceptor.java
===================================================================
---
stack/cxf/trunk/modules/testsuite/cxf-spring-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/CustomSubjectCreatingInterceptor.java 2011-04-27
13:09:15 UTC (rev 14208)
+++
stack/cxf/trunk/modules/testsuite/cxf-spring-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/CustomSubjectCreatingInterceptor.java 2011-04-28
10:57:21 UTC (rev 14209)
@@ -21,7 +21,9 @@
*/
package org.jboss.test.ws.jaxws.samples.wsse;
-import java.util.Collections;
+import java.util.HashMap;
+import java.util.Map;
+
import org.jboss.wsf.stack.cxf.security.authentication.SubjectCreatingInterceptor;
import org.picketbox.config.PicketBoxConfiguration;
import org.picketbox.exceptions.ConfigurationStreamNullException;
@@ -39,7 +41,7 @@
public CustomSubjectCreatingInterceptor()
{
- super(Collections.<String, Object> singletonMap("action",
"UsernameToken"));
+ super(getInitMap());
}
public void setSecurityConfigFile(String configFilePath)
@@ -62,5 +64,10 @@
}
}
-
+ private static Map<String, Object> getInitMap()
+ {
+ Map<String, Object> map = new HashMap<String, Object>();
+ map.put("action", "UsernameToken");
+ return map;
+ }
}
Modified:
stack/cxf/trunk/modules/testsuite/cxf-spring-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/ServerUsernamePasswordCallback.java
===================================================================
---
stack/cxf/trunk/modules/testsuite/cxf-spring-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/ServerUsernamePasswordCallback.java 2011-04-27
13:09:15 UTC (rev 14208)
+++
stack/cxf/trunk/modules/testsuite/cxf-spring-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/ServerUsernamePasswordCallback.java 2011-04-28
10:57:21 UTC (rev 14209)
@@ -1,6 +1,6 @@
/*
* JBoss, Home of Professional Open Source.
- * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * Copyright 2011, 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.
*
@@ -33,7 +33,10 @@
public void handle(Callback[] callbacks) throws IOException,
UnsupportedCallbackException
{
WSPasswordCallback pc = (WSPasswordCallback)callbacks[0];
- if (!("kermit".equals(pc.getIdentifier()) &&
"thefrog".equals(pc.getPassword())))
- throw new SecurityException("User '" + pc.getIdentifier() +
"' with password '" + pc.getPassword() + "' not
allowed.");
+ //this CallbackHandler is meant for use with WSS4J 1.6, see
http://ws.apache.org/wss4j/wss4j16.html
+ if ("kermit".equals(pc.getIdentifier()))
+ {
+ pc.setPassword("thefrog");
+ }
}
}
Modified: stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/etc/log4j.xml
===================================================================
--- stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/etc/log4j.xml 2011-04-27 13:09:15
UTC (rev 14208)
+++ stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/etc/log4j.xml 2011-04-28 10:57:21
UTC (rev 14209)
@@ -60,7 +60,7 @@
</category>
<category name="org.apache.cxf">
- <priority value="DEBUG"/>
+ <priority value="INFO"/>
</category>
<category name="org.springframework">
Modified:
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/gzip/GZIPEnforcingInInterceptor.java
===================================================================
---
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/gzip/GZIPEnforcingInInterceptor.java 2011-04-27
13:09:15 UTC (rev 14208)
+++
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/gzip/GZIPEnforcingInInterceptor.java 2011-04-28
10:57:21 UTC (rev 14209)
@@ -28,7 +28,7 @@
import org.apache.cxf.helpers.HttpHeaderHelper;
import org.apache.cxf.interceptor.Fault;
import org.apache.cxf.message.Message;
-import org.apache.cxf.transport.http.gzip.GZIPInInterceptor;
+import org.apache.cxf.transport.common.gzip.GZIPInInterceptor;
public class GZIPEnforcingInInterceptor extends GZIPInInterceptor
{
Modified:
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/gzip/Helper.java
===================================================================
---
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/gzip/Helper.java 2011-04-27
13:09:15 UTC (rev 14208)
+++
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/gzip/Helper.java 2011-04-28
10:57:21 UTC (rev 14209)
@@ -31,9 +31,9 @@
import org.apache.cxf.BusFactory;
import org.apache.cxf.endpoint.Client;
import org.apache.cxf.frontend.ClientProxy;
+import org.apache.cxf.transport.common.gzip.GZIPFeature;
+import org.apache.cxf.transport.common.gzip.GZIPOutInterceptor;
import org.apache.cxf.transport.http.HTTPConduit;
-import org.apache.cxf.transport.http.gzip.GZIPFeature;
-import org.apache.cxf.transport.http.gzip.GZIPOutInterceptor;
import org.apache.cxf.transports.http.configuration.HTTPClientPolicy;
import org.jboss.wsf.test.ClientHelper;
Modified:
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsrm/service/RMCheckInterceptor.java
===================================================================
---
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsrm/service/RMCheckInterceptor.java 2011-04-27
13:09:15 UTC (rev 14208)
+++
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsrm/service/RMCheckInterceptor.java 2011-04-28
10:57:21 UTC (rev 14209)
@@ -49,6 +49,11 @@
public void handleMessage(Message message) throws Fault
{
+ String method = (String)message.get(Message.HTTP_REQUEST_METHOD);
+ if (!method.equals("POST"))
+ {
+ return;
+ }
StringBuilder sb = new StringBuilder();
InputStream is = message.getContent(InputStream.class);
if (is != null)
Modified: stack/cxf/trunk/pom.xml
===================================================================
--- stack/cxf/trunk/pom.xml 2011-04-27 13:09:15 UTC (rev 14208)
+++ stack/cxf/trunk/pom.xml 2011-04-28 10:57:21 UTC (rev 14209)
@@ -57,7 +57,7 @@
-->
<!-- END -->
<jboss700.version>7.0.0.Beta4-SNAPSHOT</jboss700.version>
- <cxf.version>2.3.4</cxf.version>
+ <cxf.version>2.4.1-SNAPSHOT</cxf.version>
<cxf.asm.version>3.3</cxf.asm.version>
<cxf.xjcplugins.version>2.3.2</cxf.xjcplugins.version>
<fastinfoset.api.version>1.2.7</fastinfoset.api.version>
@@ -81,12 +81,13 @@
<commons.logging.version>1.1.1</commons.logging.version>
<log4j.version>1.2.14</log4j.version>
<mail.version>1.4.2</mail.version>
+ <neethi.version>3.0.0</neethi.version>
<saaj.api.version>1.0.0.Final</saaj.api.version>
<stax.api.version>1.0-2</stax.api.version>
<jms.api.version>1.0.0.Final</jms.api.version>
<velocity.version>1.5</velocity.version>
<xerces.version>2.9.1</xerces.version>
- <xmlsec.version>1.4.3</xmlsec.version>
+ <xmlsec.version>1.4.4</xmlsec.version>
<wstx.version>3.2.9</wstx.version>
<spring.version>3.0.5.RELEASE</spring.version>
</properties>
@@ -176,6 +177,10 @@
<groupId>javax.xml.soap</groupId>
<artifactId>saaj-api</artifactId>
</exclusion>
+ <exclusion>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-api</artifactId>
+ </exclusion>
</exclusions>
</dependency>
<dependency>
@@ -1102,6 +1107,17 @@
<version>${mail.version}</version>
</dependency>
<dependency>
+ <groupId>org.apache.neethi</groupId>
+ <artifactId>neethi</artifactId>
+ <version>${neethi.version}</version>
+ <exclusions>
+ <exclusion>
+ <groupId>org.codehaus.woodstox</groupId>
+ <artifactId>woodstox-core-asl</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ <dependency>
<groupId>org.jboss.spec.javax.xml.bind</groupId>
<artifactId>jboss-jaxb-api_2.2_spec</artifactId>
<version>${jaxb.api.version}</version>