Author: alessio.soldano(a)jboss.com
Date: 2011-04-19 14:37:07 -0400 (Tue, 19 Apr 2011)
New Revision: 14167
Removed:
stack/cxf/branches/cxf24/modules/client/src/main/resources/META-INF/cxf/jbossws-cxf.xml
stack/cxf/branches/cxf24/modules/server/src/main/java/org/jboss/wsf/stack/cxf/ServletControllerExt.java
Modified:
stack/cxf/branches/cxf24/modules/addons/transports/http/httpserver/src/main/java/org/jboss/wsf/stack/cxf/addons/transports/httpserver/HttpServerDestination.java
stack/cxf/branches/cxf24/modules/addons/transports/http/httpserver/src/main/java/org/jboss/wsf/stack/cxf/addons/transports/httpserver/HttpServerTransportFactory.java
stack/cxf/branches/cxf24/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/configuration/JBossWSNonSpringBusFactory.java
stack/cxf/branches/cxf24/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/configuration/JBossWSSpringBusFactory.java
stack/cxf/branches/cxf24/modules/client/src/main/resources/META-INF/cxf/aegis.xsd
stack/cxf/branches/cxf24/modules/client/src/main/resources/META-INF/cxf/java2wsbeans.xml
stack/cxf/branches/cxf24/modules/client/src/main/resources/META-INF/tools-plugin.xml
stack/cxf/branches/cxf24/modules/dist/src/main/scripts/assembly-deploy-artifacts.xml
stack/cxf/branches/cxf24/modules/resources/src/main/resources/resources/jbossws-deploy-macros.xml
stack/cxf/branches/cxf24/modules/server/src/main/java/org/jboss/wsf/stack/cxf/CXFNonSpringServletExt.java
stack/cxf/branches/cxf24/modules/server/src/main/java/org/jboss/wsf/stack/cxf/CXFServletExt.java
stack/cxf/branches/cxf24/modules/server/src/main/java/org/jboss/wsf/stack/cxf/RequestHandlerImpl.java
stack/cxf/branches/cxf24/modules/server/src/main/java/org/jboss/wsf/stack/cxf/configuration/NonSpringBusHolder.java
stack/cxf/branches/cxf24/modules/server/src/main/java/org/jboss/wsf/stack/cxf/configuration/SpringBusHolder.java
stack/cxf/branches/cxf24/modules/server/src/main/java/org/jboss/wsf/stack/cxf/transport/ServletHelper.java
stack/cxf/branches/cxf24/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/gzip/GZIPEnforcingInInterceptor.java
stack/cxf/branches/cxf24/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/gzip/Helper.java
stack/cxf/branches/cxf24/pom.xml
Log:
Initial changes - WIP
Modified:
stack/cxf/branches/cxf24/modules/addons/transports/http/httpserver/src/main/java/org/jboss/wsf/stack/cxf/addons/transports/httpserver/HttpServerDestination.java
===================================================================
---
stack/cxf/branches/cxf24/modules/addons/transports/http/httpserver/src/main/java/org/jboss/wsf/stack/cxf/addons/transports/httpserver/HttpServerDestination.java 2011-04-19
17:25:14 UTC (rev 14166)
+++
stack/cxf/branches/cxf24/modules/addons/transports/http/httpserver/src/main/java/org/jboss/wsf/stack/cxf/addons/transports/httpserver/HttpServerDestination.java 2011-04-19
18:37:07 UTC (rev 14167)
@@ -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;
@@ -58,9 +59,9 @@
private HttpServerEngine engine;
private URL url;
- public HttpServerDestination(Bus b, HttpServerTransportFactory factory, EndpointInfo
ei) throws IOException
+ public HttpServerDestination(Bus b, DestinationRegistry registry,
HttpServerTransportFactory factory, EndpointInfo ei) throws IOException
{
- super(b, ei);
+ super(b, registry, ei);
this.factory = factory;
this.serverEngineFactory = factory.getServerEngineFactory();
getAddressValue(ei, true); //generate address if not specified
@@ -73,12 +74,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()))
{
Modified:
stack/cxf/branches/cxf24/modules/addons/transports/http/httpserver/src/main/java/org/jboss/wsf/stack/cxf/addons/transports/httpserver/HttpServerTransportFactory.java
===================================================================
---
stack/cxf/branches/cxf24/modules/addons/transports/http/httpserver/src/main/java/org/jboss/wsf/stack/cxf/addons/transports/httpserver/HttpServerTransportFactory.java 2011-04-19
17:25:14 UTC (rev 14166)
+++
stack/cxf/branches/cxf24/modules/addons/transports/http/httpserver/src/main/java/org/jboss/wsf/stack/cxf/addons/transports/httpserver/HttpServerTransportFactory.java 2011-04-19
18:37:07 UTC (rev 14167)
@@ -32,7 +32,7 @@
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;
+import org.apache.cxf.transport.http.HTTPTransportFactory;
/**
* A Destination/Transport factory for the JDK6 httpserver
@@ -41,7 +41,7 @@
* @since 19-Aug-2010
*
*/
-public class HttpServerTransportFactory extends AbstractHTTPTransportFactory implements
DestinationFactory
+public class HttpServerTransportFactory extends HTTPTransportFactory implements
DestinationFactory
{
private Map<String, HttpServerDestination> destinations = new
ConcurrentHashMap<String, HttpServerDestination>();
@@ -99,7 +99,7 @@
HttpServerDestination destination = addr == null ? null : destinations.get(addr);
if (destination == null)
{
- destination = new HttpServerDestination(getBus(), this, endpointInfo);
+ destination = new HttpServerDestination(getBus(), this.registry, this,
endpointInfo);
destinations.put(endpointInfo.getAddress(), destination);
configure(destination);
destination.finalizeConfig();
Modified:
stack/cxf/branches/cxf24/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/configuration/JBossWSNonSpringBusFactory.java
===================================================================
---
stack/cxf/branches/cxf24/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/configuration/JBossWSNonSpringBusFactory.java 2011-04-19
17:25:14 UTC (rev 14166)
+++
stack/cxf/branches/cxf24/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/configuration/JBossWSNonSpringBusFactory.java 2011-04-19
18:37:07 UTC (rev 14167)
@@ -21,40 +21,40 @@
*/
package org.jboss.wsf.stack.cxf.client.configuration;
-import java.lang.ref.WeakReference;
-import java.util.Collection;
+//import java.lang.ref.WeakReference;
+//import java.util.Collection;
import java.util.HashMap;
-import java.util.LinkedList;
+//import java.util.LinkedList;
import java.util.Map;
-import javax.xml.bind.JAXBException;
-import javax.xml.namespace.QName;
+//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.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 +77,86 @@
extensions.put(Configurer.class, new JBossWSNonSpringConfigurer(new
BeanCustomizer()));
}
- preparePolicyEngine(extensions);
+// 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;
+
+// initPolicyEngine((PolicyEngineImpl)extensions.get(PolicyEngine.class), bus);
+//
+// possiblySetDefaultBus(bus);
+// initializeBus(bus);
+// 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);
- }
+// @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/branches/cxf24/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/configuration/JBossWSSpringBusFactory.java
===================================================================
---
stack/cxf/branches/cxf24/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/configuration/JBossWSSpringBusFactory.java 2011-04-19
17:25:14 UTC (rev 14166)
+++
stack/cxf/branches/cxf24/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/configuration/JBossWSSpringBusFactory.java 2011-04-19
18:37:07 UTC (rev 14167)
@@ -22,16 +22,16 @@
package org.jboss.wsf.stack.cxf.client.configuration;
import java.net.URL;
-import java.util.logging.Level;
-import java.util.logging.Logger;
+//import java.util.logging.Level;
+//import java.util.logging.Logger;
import org.apache.cxf.Bus;
import org.apache.cxf.bus.spring.BusApplicationContext;
import org.apache.cxf.bus.spring.SpringBusFactory;
import org.apache.cxf.buslifecycle.BusLifeCycleListener;
import org.apache.cxf.buslifecycle.BusLifeCycleManager;
-import org.apache.cxf.common.logging.LogUtils;
-import org.springframework.beans.BeansException;
+//import org.apache.cxf.common.logging.LogUtils;
+//import org.springframework.beans.BeansException;
import org.springframework.context.ApplicationContext;
/**
@@ -44,7 +44,7 @@
*/
public class JBossWSSpringBusFactory extends SpringBusFactory
{
- private static final Logger LOG =
LogUtils.getL7dLogger(JBossWSSpringBusFactory.class);
+// private static final Logger LOG =
LogUtils.getL7dLogger(JBossWSSpringBusFactory.class);
public JBossWSSpringBusFactory()
{
@@ -59,75 +59,88 @@
@Override
public Bus createBus(String cfgFiles[], boolean includeDefaults)
{
- try
- {
- return finishCreatingBus(createApplicationContext(cfgFiles, includeDefaults));
- }
- catch (BeansException ex)
- {
- LogUtils.log(LOG, Level.WARNING, "APP_CONTEXT_CREATION_FAILED_MSG",
ex, (Object[]) null);
- throw new RuntimeException(ex);
- }
+// try
+// {
+// return finishCreatingBus(createApplicationContext(cfgFiles,
includeDefaults));
+// }
+// catch (BeansException ex)
+// {
+// LogUtils.log(LOG, Level.WARNING, "APP_CONTEXT_CREATION_FAILED_MSG",
ex, (Object[]) null);
+// throw new RuntimeException(ex);
+// }
+ Bus bus = super.createBus(cfgFiles, includeDefaults);
+ finalizeBusCreation(bus);
+ return bus;
}
@Override
public Bus createBus(URL[] urls, boolean includeDefaults)
{
- try
- {
- return finishCreatingBus(new JBossWSBusApplicationContext(urls, includeDefaults,
getApplicationContext()));
- }
- catch (BeansException ex)
- {
- LogUtils.log(LOG, Level.WARNING, "APP_CONTEXT_CREATION_FAILED_MSG",
ex, (Object[]) null);
- throw new RuntimeException(ex);
- }
+// try
+// {
+// return finishCreatingBus(new JBossWSBusApplicationContext(urls,
includeDefaults, getApplicationContext()));
+// }
+// catch (BeansException ex)
+// {
+// LogUtils.log(LOG, Level.WARNING, "APP_CONTEXT_CREATION_FAILED_MSG",
ex, (Object[]) null);
+// throw new RuntimeException(ex);
+// }
+ Bus bus = super.createBus(urls, includeDefaults);
+ finalizeBusCreation(bus);
+ return bus;
}
-
- private Bus finishCreatingBus(BusApplicationContext bac)
+
+ private static void finalizeBusCreation(Bus bus)
{
- final Bus bus = (Bus) bac.getBean(Bus.DEFAULT_BUS_ID);
-
- bus.setExtension(bac, BusApplicationContext.class);
-
- possiblySetDefaultBus(bus);
-
- initializeBus(bus);
-
+ //TODO!! also set our custom configurer
+ BusApplicationContext bac = bus.getExtension(BusApplicationContext.class);
registerAppContextLifeCycleListener(bus, bac);
- return bus;
}
- private BusApplicationContext createApplicationContext(String cfgFiles[], boolean
includeDefaults)
- {
- try
- {
- return new JBossWSBusApplicationContext(cfgFiles, includeDefaults,
getApplicationContext());
- }
- catch (BeansException ex)
- {
- LogUtils.log(LOG, Level.WARNING,
"INITIAL_APP_CONTEXT_CREATION_FAILED_MSG", ex, (Object[]) null);
- ClassLoader contextLoader = Thread.currentThread().getContextClassLoader();
- if (contextLoader != BusApplicationContext.class.getClassLoader())
- {
-
Thread.currentThread().setContextClassLoader(BusApplicationContext.class.getClassLoader());
- try
- {
- return new JBossWSBusApplicationContext(cfgFiles, includeDefaults,
getApplicationContext());
- }
- finally
- {
- Thread.currentThread().setContextClassLoader(contextLoader);
- }
- }
- else
- {
- throw ex;
- }
- }
- }
+// private Bus finishCreatingBus(BusApplicationContext bac)
+// {
+// final Bus bus = (Bus) bac.getBean(Bus.DEFAULT_BUS_ID);
+//
+// bus.setExtension(bac, BusApplicationContext.class);
+//
+// possiblySetDefaultBus(bus);
+//
+// initializeBus(bus);
+//
+// registerAppContextLifeCycleListener(bus, bac);
+// return bus;
+// }
+//
+// private BusApplicationContext createApplicationContext(String cfgFiles[], boolean
includeDefaults)
+// {
+// try
+// {
+// return new JBossWSBusApplicationContext(cfgFiles, includeDefaults,
getApplicationContext());
+// }
+// catch (BeansException ex)
+// {
+// LogUtils.log(LOG, Level.WARNING,
"INITIAL_APP_CONTEXT_CREATION_FAILED_MSG", ex, (Object[]) null);
+// ClassLoader contextLoader = Thread.currentThread().getContextClassLoader();
+// if (contextLoader != BusApplicationContext.class.getClassLoader())
+// {
+//
Thread.currentThread().setContextClassLoader(BusApplicationContext.class.getClassLoader());
+// try
+// {
+// return new JBossWSBusApplicationContext(cfgFiles, includeDefaults,
getApplicationContext());
+// }
+// finally
+// {
+// Thread.currentThread().setContextClassLoader(contextLoader);
+// }
+// }
+// else
+// {
+// throw ex;
+// }
+// }
+// }
- void registerAppContextLifeCycleListener(final Bus bus, final BusApplicationContext
bac)
+ static void registerAppContextLifeCycleListener(final Bus bus, final
BusApplicationContext bac)
{
BusLifeCycleManager lm = bus.getExtension(BusLifeCycleManager.class);
if (null != lm)
Modified:
stack/cxf/branches/cxf24/modules/client/src/main/resources/META-INF/cxf/aegis.xsd
===================================================================
---
stack/cxf/branches/cxf24/modules/client/src/main/resources/META-INF/cxf/aegis.xsd 2011-04-19
17:25:14 UTC (rev 14166)
+++
stack/cxf/branches/cxf24/modules/client/src/main/resources/META-INF/cxf/aegis.xsd 2011-04-19
18:37:07 UTC (rev 14167)
@@ -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/branches/cxf24/modules/client/src/main/resources/META-INF/cxf/java2wsbeans.xml
===================================================================
---
stack/cxf/branches/cxf24/modules/client/src/main/resources/META-INF/cxf/java2wsbeans.xml 2011-04-19
17:25:14 UTC (rev 14166)
+++
stack/cxf/branches/cxf24/modules/client/src/main/resources/META-INF/cxf/java2wsbeans.xml 2011-04-19
18:37:07 UTC (rev 14167)
@@ -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/branches/cxf24/modules/client/src/main/resources/META-INF/cxf/jbossws-cxf.xml
===================================================================
---
stack/cxf/branches/cxf24/modules/client/src/main/resources/META-INF/cxf/jbossws-cxf.xml 2011-04-19
17:25:14 UTC (rev 14166)
+++
stack/cxf/branches/cxf24/modules/client/src/main/resources/META-INF/cxf/jbossws-cxf.xml 2011-04-19
18:37:07 UTC (rev 14167)
@@ -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/branches/cxf24/modules/client/src/main/resources/META-INF/tools-plugin.xml
===================================================================
---
stack/cxf/branches/cxf24/modules/client/src/main/resources/META-INF/tools-plugin.xml 2011-04-19
17:25:14 UTC (rev 14166)
+++
stack/cxf/branches/cxf24/modules/client/src/main/resources/META-INF/tools-plugin.xml 2011-04-19
18:37:07 UTC (rev 14167)
@@ -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/branches/cxf24/modules/dist/src/main/scripts/assembly-deploy-artifacts.xml
===================================================================
---
stack/cxf/branches/cxf24/modules/dist/src/main/scripts/assembly-deploy-artifacts.xml 2011-04-19
17:25:14 UTC (rev 14166)
+++
stack/cxf/branches/cxf24/modules/dist/src/main/scripts/assembly-deploy-artifacts.xml 2011-04-19
18:37:07 UTC (rev 14167)
@@ -61,7 +61,8 @@
<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.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/branches/cxf24/modules/resources/src/main/resources/resources/jbossws-deploy-macros.xml
===================================================================
---
stack/cxf/branches/cxf24/modules/resources/src/main/resources/resources/jbossws-deploy-macros.xml 2011-04-19
17:25:14 UTC (rev 14166)
+++
stack/cxf/branches/cxf24/modules/resources/src/main/resources/resources/jbossws-deploy-macros.xml 2011-04-19
18:37:07 UTC (rev 14167)
@@ -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"/>
@@ -384,7 +384,7 @@
</copy>
<copy todir="@{targetdir}/org/apache/ws/commons/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/branches/cxf24/modules/server/src/main/java/org/jboss/wsf/stack/cxf/CXFNonSpringServletExt.java
===================================================================
---
stack/cxf/branches/cxf24/modules/server/src/main/java/org/jboss/wsf/stack/cxf/CXFNonSpringServletExt.java 2011-04-19
17:25:14 UTC (rev 14166)
+++
stack/cxf/branches/cxf24/modules/server/src/main/java/org/jboss/wsf/stack/cxf/CXFNonSpringServletExt.java 2011-04-19
18:37:07 UTC (rev 14167)
@@ -29,12 +29,14 @@
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.CXFNonSpringServlet;
import org.apache.cxf.transport.servlet.ServletContextResourceResolver;
-import org.apache.cxf.transport.servlet.ServletController;
-import org.apache.cxf.transport.servlet.ServletTransportFactory;
+//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 +49,24 @@
* @since 16-Jun-2010
*
*/
-public class CXFNonSpringServletExt extends CXFNonSpringServlet implements
ServletDelegate
+public class CXFNonSpringServletExt extends AbstractHTTPServlet implements
ServletDelegate
{
protected Endpoint endpoint;
+ protected Bus bus;
+// private ServletController createServletController(ServletConfig servletConfig)
+// {
+// ServletTransportFactory stf = (ServletTransportFactory)
createServletTransportFactory();
+// return new ServletControllerExt(stf, servletConfig,
servletConfig.getServletContext(), 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 +76,6 @@
//register the InstrumentManagementImpl
ServletHelper.registerInstrumentManger(bus, getServletContext());
-
}
private void updateAvailableBusWithServletInfo(ServletConfig servletConfig)
@@ -81,17 +87,17 @@
//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());
+ //TODO!!! 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/branches/cxf24/modules/server/src/main/java/org/jboss/wsf/stack/cxf/CXFServletExt.java
===================================================================
---
stack/cxf/branches/cxf24/modules/server/src/main/java/org/jboss/wsf/stack/cxf/CXFServletExt.java 2011-04-19
17:25:14 UTC (rev 14166)
+++
stack/cxf/branches/cxf24/modules/server/src/main/java/org/jboss/wsf/stack/cxf/CXFServletExt.java 2011-04-19
18:37:07 UTC (rev 14167)
@@ -21,24 +21,24 @@
*/
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 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;
+//import org.jboss.wsf.stack.cxf.configuration.BusHolder;
+//import org.jboss.wsf.stack.cxf.transport.ServletHelper;
/**
* An extension to the CXF servlet
@@ -48,97 +48,97 @@
*
* @since 21-Apr-2007
*/
-public class CXFServletExt extends CXFServlet implements ServletDelegate
+//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);
- }
+// protected Endpoint endpoint;
+//
+// private 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/branches/cxf24/modules/server/src/main/java/org/jboss/wsf/stack/cxf/RequestHandlerImpl.java
===================================================================
---
stack/cxf/branches/cxf24/modules/server/src/main/java/org/jboss/wsf/stack/cxf/RequestHandlerImpl.java 2011-04-19
17:25:14 UTC (rev 14166)
+++
stack/cxf/branches/cxf24/modules/server/src/main/java/org/jboss/wsf/stack/cxf/RequestHandlerImpl.java 2011-04-19
18:37:07 UTC (rev 14167)
@@ -24,17 +24,41 @@
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.BusFactory;
+import org.apache.cxf.service.model.EndpointInfo;
+//import org.apache.cxf.transport.Destination;
+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.transport.http.HttpDestinationFactory;
+//import org.apache.cxf.transport.servlet.ServletController;
+//import org.apache.cxf.transport.servlet.ServletDestination;
+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 +68,48 @@
*/
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);
+// 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 +121,142 @@
{
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();
+ 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;
+ }
+
+ 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/branches/cxf24/modules/server/src/main/java/org/jboss/wsf/stack/cxf/ServletControllerExt.java
===================================================================
---
stack/cxf/branches/cxf24/modules/server/src/main/java/org/jboss/wsf/stack/cxf/ServletControllerExt.java 2011-04-19
17:25:14 UTC (rev 14166)
+++
stack/cxf/branches/cxf24/modules/server/src/main/java/org/jboss/wsf/stack/cxf/ServletControllerExt.java 2011-04-19
18:37:07 UTC (rev 14167)
@@ -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);
- }
-
-}
Modified:
stack/cxf/branches/cxf24/modules/server/src/main/java/org/jboss/wsf/stack/cxf/configuration/NonSpringBusHolder.java
===================================================================
---
stack/cxf/branches/cxf24/modules/server/src/main/java/org/jboss/wsf/stack/cxf/configuration/NonSpringBusHolder.java 2011-04-19
17:25:14 UTC (rev 14166)
+++
stack/cxf/branches/cxf24/modules/server/src/main/java/org/jboss/wsf/stack/cxf/configuration/NonSpringBusHolder.java 2011-04-19
18:37:07 UTC (rev 14167)
@@ -34,7 +34,10 @@
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.HTTPTransportFactory;
+import org.apache.cxf.transport.http.HttpDestinationFactory;
+import org.apache.cxf.transport.servlet.ServletDestinationFactory;
+//import org.apache.cxf.transport.servlet.ServletTransportFactory;
import org.apache.cxf.ws.addressing.WSAddressingFeature;
import org.apache.cxf.ws.rm.RMManager;
import org.jboss.wsf.spi.binding.BindingCustomization;
@@ -67,13 +70,16 @@
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);
- }
+ new HTTPTransportFactory(bus);
+ bus.setExtension(new ServletDestinationFactory(), HttpDestinationFactory.class);
+// //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);
+// }
}
/**
Modified:
stack/cxf/branches/cxf24/modules/server/src/main/java/org/jboss/wsf/stack/cxf/configuration/SpringBusHolder.java
===================================================================
---
stack/cxf/branches/cxf24/modules/server/src/main/java/org/jboss/wsf/stack/cxf/configuration/SpringBusHolder.java 2011-04-19
17:25:14 UTC (rev 14166)
+++
stack/cxf/branches/cxf24/modules/server/src/main/java/org/jboss/wsf/stack/cxf/configuration/SpringBusHolder.java 2011-04-19
18:37:07 UTC (rev 14167)
@@ -33,7 +33,10 @@
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.HTTPTransportFactory;
+import org.apache.cxf.transport.http.HttpDestinationFactory;
+import org.apache.cxf.transport.servlet.ServletDestinationFactory;
+//import org.apache.cxf.transport.servlet.ServletTransportFactory;
import org.apache.ws.security.WSSConfig;
import org.jboss.logging.Logger;
import org.jboss.wsf.spi.binding.BindingCustomization;
@@ -97,11 +100,14 @@
}
}
//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);
- }
+ new HTTPTransportFactory(bus);
+ bus.setExtension(new ServletDestinationFactory(), HttpDestinationFactory.class);
+// //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);
+// }
}
/**
Modified:
stack/cxf/branches/cxf24/modules/server/src/main/java/org/jboss/wsf/stack/cxf/transport/ServletHelper.java
===================================================================
---
stack/cxf/branches/cxf24/modules/server/src/main/java/org/jboss/wsf/stack/cxf/transport/ServletHelper.java 2011-04-19
17:25:14 UTC (rev 14166)
+++
stack/cxf/branches/cxf24/modules/server/src/main/java/org/jboss/wsf/stack/cxf/transport/ServletHelper.java 2011-04-19
18:37:07 UTC (rev 14167)
@@ -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/branches/cxf24/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/gzip/GZIPEnforcingInInterceptor.java
===================================================================
---
stack/cxf/branches/cxf24/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/gzip/GZIPEnforcingInInterceptor.java 2011-04-19
17:25:14 UTC (rev 14166)
+++
stack/cxf/branches/cxf24/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/gzip/GZIPEnforcingInInterceptor.java 2011-04-19
18:37:07 UTC (rev 14167)
@@ -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/branches/cxf24/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/gzip/Helper.java
===================================================================
---
stack/cxf/branches/cxf24/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/gzip/Helper.java 2011-04-19
17:25:14 UTC (rev 14166)
+++
stack/cxf/branches/cxf24/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/gzip/Helper.java 2011-04-19
18:37:07 UTC (rev 14167)
@@ -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/branches/cxf24/pom.xml
===================================================================
--- stack/cxf/branches/cxf24/pom.xml 2011-04-19 17:25:14 UTC (rev 14166)
+++ stack/cxf/branches/cxf24/pom.xml 2011-04-19 18:37:07 UTC (rev 14167)
@@ -57,10 +57,10 @@
-->
<!-- END -->
<jboss700.version>7.0.0.Beta3-SNAPSHOT</jboss700.version>
- <cxf.version>2.3.4</cxf.version>
+ <cxf.version>2.4.0</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>
+ <fastinfoset.api.version>1.2.9</fastinfoset.api.version>
<jboss.common.core.version>2.2.16.GA</jboss.common.core.version>
<jboss.logging.version>3.0.0.Beta3</jboss.logging.version>
<jboss.security.spi.version>2.0.4.SP4</jboss.security.spi.version>
@@ -86,7 +86,7 @@
<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>