Author: alessio.soldano(a)jboss.com
Date: 2010-06-17 05:48:31 -0400 (Thu, 17 Jun 2010)
New Revision: 12494
Added:
stack/cxf/branches/no-spring-support/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/configuration/BeanCustomizer.java
stack/cxf/branches/no-spring-support/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/configuration/JBossWSBusFactory.java
stack/cxf/branches/no-spring-support/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/configuration/JBossWSConfigurer.java
stack/cxf/branches/no-spring-support/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/configuration/JBossWSNonSpringBusFactory.java
stack/cxf/branches/no-spring-support/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/configuration/JBossWSSpringConfigurer.java
stack/cxf/branches/no-spring-support/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/util/
stack/cxf/branches/no-spring-support/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/util/SpringUtils.java
stack/cxf/branches/no-spring-support/modules/server/src/main/java/org/jboss/wsf/stack/cxf/CXFNonSpringServletExt.java
stack/cxf/branches/no-spring-support/modules/server/src/main/java/org/jboss/wsf/stack/cxf/configuration/JBossWSServerSpringConfigurer.java
stack/cxf/branches/no-spring-support/modules/server/src/main/java/org/jboss/wsf/stack/cxf/configuration/NonSpringBusHolder.java
stack/cxf/branches/no-spring-support/modules/server/src/main/java/org/jboss/wsf/stack/cxf/configuration/ServerBeanCustomizer.java
stack/cxf/branches/no-spring-support/modules/server/src/main/java/org/jboss/wsf/stack/cxf/configuration/SpringBusHolder.java
stack/cxf/branches/no-spring-support/modules/server/src/main/java/org/jboss/wsf/stack/cxf/transport/ServletHelper.java
Removed:
stack/cxf/branches/no-spring-support/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/configuration/JBossWSCXFConfigurer.java
stack/cxf/branches/no-spring-support/modules/server/src/main/java/org/jboss/wsf/stack/cxf/configuration/JBossWSServerCXFConfigurer.java
Modified:
stack/cxf/branches/no-spring-support/modules/client/src/main/resources/META-INF/cxf/jbossws-cxf.xml
stack/cxf/branches/no-spring-support/modules/endorsed/src/main/resources/META-INF/services/org.apache.cxf.bus.factory
stack/cxf/branches/no-spring-support/modules/server/src/main/java/org/jboss/wsf/stack/cxf/CXFServletExt.java
stack/cxf/branches/no-spring-support/modules/server/src/main/java/org/jboss/wsf/stack/cxf/configuration/BusHolder.java
stack/cxf/branches/no-spring-support/modules/server/src/main/java/org/jboss/wsf/stack/cxf/deployment/aspect/BusDeploymentAspect.java
stack/cxf/branches/no-spring-support/modules/server/src/main/java/org/jboss/wsf/stack/cxf/deployment/aspect/DescriptorDeploymentAspect.java
stack/cxf/branches/no-spring-support/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/endorse/Helper.java
stack/cxf/branches/no-spring-support/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/jaxbintros/JAXBIntroTestCase.java
Log:
First cut; most of the basic jaxws endpoints deploy correctly on AS 6 M3 without Spring
libs (still need to manually change the endpoint servlet)
Added:
stack/cxf/branches/no-spring-support/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/configuration/BeanCustomizer.java
===================================================================
---
stack/cxf/branches/no-spring-support/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/configuration/BeanCustomizer.java
(rev 0)
+++
stack/cxf/branches/no-spring-support/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/configuration/BeanCustomizer.java 2010-06-17
09:48:31 UTC (rev 12494)
@@ -0,0 +1,160 @@
+/*
+ * 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 org.apache.cxf.configuration.jsse.TLSClientParameters;
+import org.apache.cxf.databinding.DataBinding;
+import org.apache.cxf.frontend.AbstractWSDLBasedEndpointFactory;
+import org.apache.cxf.frontend.ClientProxyFactoryBean;
+import org.apache.cxf.jaxb.JAXBDataBinding;
+import org.apache.cxf.service.factory.ReflectionServiceFactoryBean;
+import org.apache.cxf.transport.http.HTTPConduit;
+import org.jboss.wsf.spi.binding.BindingCustomization;
+import org.jboss.wsf.spi.binding.JAXBBindingCustomization;
+
+/**
+ *
+ * @author alessio.soldano(a)jboss.com
+ * @since 16-Jun-2010
+ */
+public class BeanCustomizer
+{
+ protected BindingCustomization customization;
+
+ public void customize(Object beanInstance)
+ {
+ if (beanInstance instanceof AbstractWSDLBasedEndpointFactory)
+ {
+ configureEndpointFactory((AbstractWSDLBasedEndpointFactory)beanInstance);
+ }
+ else if (beanInstance instanceof ClientProxyFactoryBean)
+ {
+ configureClientProxyFactoryBean((ClientProxyFactoryBean)beanInstance);
+ }
+ else if (beanInstance instanceof HTTPConduit)
+ {
+ configureHTTPConduit((HTTPConduit)beanInstance);
+ }
+ //add other beans configuration here below
+ }
+
+ /**
+ * Configure the endpoint factory
+ *
+ * @param factory
+ */
+ protected void configureEndpointFactory(AbstractWSDLBasedEndpointFactory factory)
+ {
+ //Configure binding customization
+ if (customization != null)
+ {
+ ReflectionServiceFactoryBean serviceFactory = factory.getServiceFactory();
+ //customize default databinding (early pulls in ServiceFactory default
databinding and configure it, as it's lazily loaded)
+ serviceFactory.reset();
+ DataBinding serviceFactoryDataBinding = serviceFactory.getDataBinding(true);
+ configureBindingCustomization(serviceFactoryDataBinding, customization);
+ serviceFactory.setDataBinding(serviceFactoryDataBinding);
+ //customize user provided databinding (CXF later overrides the ServiceFactory
databinding using the user provided one)
+ if (factory.getDataBinding() == null)
+ {
+ //set the endpoint factory's databinding to prevent CXF resetting
everything because user did not provide anything
+ factory.setDataBinding(serviceFactoryDataBinding);
+ }
+ else
+ {
+ configureBindingCustomization(factory.getDataBinding(), customization);
+ }
+ }
+ //add other configurations here below
+ }
+
+ /**
+ * Configure the client proxy factory; currently set the binding customization in the
databinding (Client Side).
+ *
+ * @param factory
+ */
+ protected void configureClientProxyFactoryBean(ClientProxyFactoryBean factory)
+ {
+ //Configure binding customization
+ if (customization != null)
+ {
+ //customize default databinding (early pulls in ServiceFactory default
databinding and configure it, as it's lazily loaded)
+ ReflectionServiceFactoryBean serviceFactory = factory.getServiceFactory();
+ serviceFactory.reset();
+ DataBinding serviceFactoryDataBinding = serviceFactory.getDataBinding(true);
+ configureBindingCustomization(serviceFactoryDataBinding, customization);
+ serviceFactory.setDataBinding(serviceFactoryDataBinding);
+ //customize user provided databinding (CXF later overrides the ServiceFactory
databinding using the user provided one)
+ if (factory.getDataBinding() == null)
+ {
+ //set the endpoint factory's databinding to prevent CXF resetting
everything because user did not provide anything
+ factory.setDataBinding(serviceFactoryDataBinding);
+ }
+ else
+ {
+ configureBindingCustomization(factory.getDataBinding(), customization);
+ }
+ }
+ //add other configurations here below
+ }
+
+ /**
+ * Configure the HTTPConduit; currently allows for setting disableCNcheck in TLS
client parameters according
+ * to the JBoss' org.jboss.security.ignoreHttpsHost system property.
+ *
+ * @param conduit
+ */
+ protected void configureHTTPConduit(HTTPConduit conduit)
+ {
+ TLSClientParameters parameters = conduit.getTlsClientParameters();
+ if (parameters == null) //don't do anything when user already provided a
configuration
+ {
+ parameters = new TLSClientParameters();
+ parameters.setUseHttpsURLConnectionDefaultSslSocketFactory(true);
+ if (Boolean.getBoolean("org.jboss.security.ignoreHttpsHost"))
+ {
+ parameters.setDisableCNCheck(true);
+ }
+ conduit.setTlsClientParameters(parameters);
+ }
+ }
+
+ @SuppressWarnings("unchecked")
+ protected static void configureBindingCustomization(DataBinding db,
BindingCustomization customization)
+ {
+ //JAXB
+ if (customization instanceof JAXBBindingCustomization)
+ {
+ if (db != null && db instanceof JAXBDataBinding)
+ {
+ ((JAXBDataBinding)db).setContextProperties(customization);
+ }
+ }
+ //add other binding customizations here below
+ }
+
+
+ public void setBindingCustomization(BindingCustomization customization)
+ {
+ this.customization = customization;
+ }
+}
Property changes on:
stack/cxf/branches/no-spring-support/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/configuration/BeanCustomizer.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added:
stack/cxf/branches/no-spring-support/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/configuration/JBossWSBusFactory.java
===================================================================
---
stack/cxf/branches/no-spring-support/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/configuration/JBossWSBusFactory.java
(rev 0)
+++
stack/cxf/branches/no-spring-support/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/configuration/JBossWSBusFactory.java 2010-06-17
09:48:31 UTC (rev 12494)
@@ -0,0 +1,134 @@
+/*
+ * 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.net.URL;
+import java.util.Map;
+
+import org.apache.cxf.Bus;
+import org.apache.cxf.BusFactory;
+import org.jboss.wsf.stack.cxf.client.util.SpringUtils;
+
+/**
+ * JBossWS version of @see{org.apache.cxf.BusFactory}. This detects if Spring is
available or not when the default
+ * createBus() method is invoked; if Spring libraries are available in the classpath, an
instance of
+ * @see{org.jboss.wsf.stack.cxf.client.configuration.JBossWSSpringBusFactory} is
internally used for
+ * creating the bus. On the contrary, an instance of
@see{org.jboss.wsf.stack.cxf.client.configuration.JBossWSNonSpringBusFactory}
+ * is internally used when Spring is not available in the classpath.
+ * Users willing to create a bus factory given a parent
@see{org.springframework.context.ApplicationContext} should
+ * directly create an instance of
@see{org.jboss.wsf.stack.cxf.client.configuration.JBossWSSpringBusFactory}.
+ *
+ * @author alessio.soldano(a)jboss.com
+ * @since 16-Jun-2010
+ *
+ */
+public class JBossWSBusFactory extends BusFactory
+{
+ private JBossWSSpringBusFactory springBusFactory;
+ private JBossWSNonSpringBusFactory nonSpringBusFactory;
+
+ @Override
+ public Bus createBus()
+ {
+ if (SpringUtils.isSpringAvailable())
+ {
+ return getSpringBusFactory().createBus();
+ }
+ else
+ {
+ return getNonSpringBusFactory().createBus();
+ }
+ }
+
+ /** JBossWSSpringBusFactory methods **/
+ public Bus createBus(String cfgFile)
+ {
+ return getSpringBusFactory().createBus(cfgFile, true);
+ }
+
+ public Bus createBus(String cfgFiles[])
+ {
+ return getSpringBusFactory().createBus(cfgFiles, true);
+ }
+
+ public Bus createBus(String cfgFile, boolean includeDefaults)
+ {
+ return getSpringBusFactory().createBus(cfgFile, includeDefaults);
+ }
+
+ public Bus createBus(String cfgFiles[], boolean includeDefaults)
+ {
+ return getSpringBusFactory().createBus(cfgFiles, includeDefaults);
+ }
+
+ public Bus createBus(URL url)
+ {
+ return getSpringBusFactory().createBus(url);
+ }
+
+ public Bus createBus(URL[] urls)
+ {
+ return getSpringBusFactory().createBus(urls);
+ }
+
+ public Bus createBus(URL url, boolean includeDefaults)
+ {
+ return getSpringBusFactory().createBus(url, includeDefaults);
+ }
+
+ public Bus createBus(URL[] urls, boolean includeDefaults)
+ {
+ return getSpringBusFactory().createBus(urls, includeDefaults);
+ }
+
+ /** JBossWSNonSpringBusFactory methods **/
+ @SuppressWarnings("unchecked")
+ public Bus createBus(Map<Class, Object> extensions)
+ {
+ return getNonSpringBusFactory().createBus(extensions);
+ }
+
+ @SuppressWarnings("unchecked")
+ public Bus createBus(Map<Class, Object> extensions, Map<String, Object>
properties)
+ {
+ return getNonSpringBusFactory().createBus(extensions, properties);
+ }
+
+
+ public JBossWSSpringBusFactory getSpringBusFactory()
+ {
+ if (springBusFactory == null)
+ {
+ springBusFactory = new JBossWSSpringBusFactory();
+ }
+ return springBusFactory;
+ }
+
+ public JBossWSNonSpringBusFactory getNonSpringBusFactory()
+ {
+ if (nonSpringBusFactory == null)
+ {
+ nonSpringBusFactory = new JBossWSNonSpringBusFactory();
+ }
+ return nonSpringBusFactory;
+ }
+}
Property changes on:
stack/cxf/branches/no-spring-support/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/configuration/JBossWSBusFactory.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Deleted:
stack/cxf/branches/no-spring-support/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/configuration/JBossWSCXFConfigurer.java
===================================================================
---
stack/cxf/branches/no-spring-support/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/configuration/JBossWSCXFConfigurer.java 2010-06-17
09:31:35 UTC (rev 12493)
+++
stack/cxf/branches/no-spring-support/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/configuration/JBossWSCXFConfigurer.java 2010-06-17
09:48:31 UTC (rev 12494)
@@ -1,175 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2009, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file in the
- * distribution for a full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
- */
-package org.jboss.wsf.stack.cxf.client.configuration;
-
-import org.apache.cxf.configuration.jsse.TLSClientParameters;
-import org.apache.cxf.configuration.spring.ConfigurerImpl;
-import org.apache.cxf.databinding.DataBinding;
-import org.apache.cxf.frontend.AbstractWSDLBasedEndpointFactory;
-import org.apache.cxf.frontend.ClientProxyFactoryBean;
-import org.apache.cxf.jaxb.JAXBDataBinding;
-import org.apache.cxf.service.factory.ReflectionServiceFactoryBean;
-import org.apache.cxf.transport.http.HTTPConduit;
-import org.jboss.wsf.spi.binding.BindingCustomization;
-import org.jboss.wsf.spi.binding.JAXBBindingCustomization;
-
-/**
- * A CXF configurer that sets JBossWS stuff / customizations / properties etc. in CXF
configurable beans
- *
- * @author alessio.soldano(a)jboss.com
- * @since 05-Oct-2009
- */
-public class JBossWSCXFConfigurer extends ConfigurerImpl
-{
- protected BindingCustomization customization;
-
- @Override
- public void configureBean(Object beanInstance)
- {
- customConfigure(beanInstance);
- super.configureBean(beanInstance);
- }
-
- @Override
- public void configureBean(String name, Object beanInstance)
- {
- customConfigure(beanInstance);
- super.configureBean(name, beanInstance);
- }
-
- protected void customConfigure(Object beanInstance)
- {
- if (beanInstance instanceof AbstractWSDLBasedEndpointFactory)
- {
- configureEndpointFactory((AbstractWSDLBasedEndpointFactory)beanInstance);
- }
- else if (beanInstance instanceof ClientProxyFactoryBean)
- {
- configureClientProxyFactoryBean((ClientProxyFactoryBean)beanInstance);
- }
- else if (beanInstance instanceof HTTPConduit)
- {
- configureHTTPConduit((HTTPConduit)beanInstance);
- }
- //add other beans configuration here below
- }
-
- /**
- * Configure the endpoint factory
- *
- * @param factory
- */
- protected synchronized void configureEndpointFactory(AbstractWSDLBasedEndpointFactory
factory)
- {
- //Configure binding customization
- if (customization != null)
- {
- ReflectionServiceFactoryBean serviceFactory = factory.getServiceFactory();
- //customize default databinding (early pulls in ServiceFactory default
databinding and configure it, as it's lazily loaded)
- serviceFactory.reset();
- DataBinding serviceFactoryDataBinding = serviceFactory.getDataBinding(true);
- configureBindingCustomization(serviceFactoryDataBinding, customization);
- serviceFactory.setDataBinding(serviceFactoryDataBinding);
- //customize user provided databinding (CXF later overrides the ServiceFactory
databinding using the user provided one)
- if (factory.getDataBinding() == null)
- {
- //set the endpoint factory's databinding to prevent CXF resetting
everything because user did not provide anything
- factory.setDataBinding(serviceFactoryDataBinding);
- }
- else
- {
- configureBindingCustomization(factory.getDataBinding(), customization);
- }
- }
- //add other configurations here below
- }
-
- /**
- * Configure the client proxy factory; currently set the binding customization in the
databinding (Client Side).
- *
- * @param factory
- */
- protected synchronized void configureClientProxyFactoryBean(ClientProxyFactoryBean
factory)
- {
- //Configure binding customization
- if (customization != null)
- {
- //customize default databinding (early pulls in ServiceFactory default
databinding and configure it, as it's lazily loaded)
- ReflectionServiceFactoryBean serviceFactory = factory.getServiceFactory();
- serviceFactory.reset();
- DataBinding serviceFactoryDataBinding = serviceFactory.getDataBinding(true);
- configureBindingCustomization(serviceFactoryDataBinding, customization);
- serviceFactory.setDataBinding(serviceFactoryDataBinding);
- //customize user provided databinding (CXF later overrides the ServiceFactory
databinding using the user provided one)
- if (factory.getDataBinding() == null)
- {
- //set the endpoint factory's databinding to prevent CXF resetting
everything because user did not provide anything
- factory.setDataBinding(serviceFactoryDataBinding);
- }
- else
- {
- configureBindingCustomization(factory.getDataBinding(), customization);
- }
- }
- //add other configurations here below
- }
-
- /**
- * Configure the HTTPConduit; currently allows for setting disableCNcheck in TLS
client parameters according
- * to the JBoss' org.jboss.security.ignoreHttpsHost system property.
- *
- * @param conduit
- */
- protected synchronized void configureHTTPConduit(HTTPConduit conduit)
- {
- TLSClientParameters parameters = conduit.getTlsClientParameters();
- if (parameters == null) //don't do anything when user already provided a
configuration
- {
- parameters = new TLSClientParameters();
- parameters.setUseHttpsURLConnectionDefaultSslSocketFactory(true);
- if (Boolean.getBoolean("org.jboss.security.ignoreHttpsHost"))
- {
- parameters.setDisableCNCheck(true);
- }
- conduit.setTlsClientParameters(parameters);
- }
- }
-
- @SuppressWarnings("unchecked")
- protected static void configureBindingCustomization(DataBinding db,
BindingCustomization customization)
- {
- //JAXB
- if (customization instanceof JAXBBindingCustomization)
- {
- if (db != null && db instanceof JAXBDataBinding)
- {
- ((JAXBDataBinding)db).setContextProperties(customization);
- }
- }
- //add other binding customizations here below
- }
-
- public void setBindingCustomization(BindingCustomization customization)
- {
- this.customization = customization;
- }
-}
Added:
stack/cxf/branches/no-spring-support/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/configuration/JBossWSConfigurer.java
===================================================================
---
stack/cxf/branches/no-spring-support/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/configuration/JBossWSConfigurer.java
(rev 0)
+++
stack/cxf/branches/no-spring-support/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/configuration/JBossWSConfigurer.java 2010-06-17
09:48:31 UTC (rev 12494)
@@ -0,0 +1,77 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2009, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.jboss.wsf.stack.cxf.client.configuration;
+
+import org.apache.cxf.configuration.Configurer;
+import org.apache.cxf.extension.BusExtension;
+
+/**
+ * A CXF configurer that sets JBossWS stuff / customizations / properties etc. in CXF
configurable beans
+ *
+ * @author alessio.soldano(a)jboss.com
+ * @since 05-Oct-2009
+ */
+public class JBossWSConfigurer implements Configurer, BusExtension
+{
+ private BeanCustomizer customizer;
+
+ public JBossWSConfigurer(BeanCustomizer customizer)
+ {
+ this.customizer = customizer;
+ }
+
+ @Override
+ public void configureBean(Object beanInstance)
+ {
+ customConfigure(beanInstance);
+ }
+
+ @Override
+ public void configureBean(String name, Object beanInstance)
+ {
+ customConfigure(beanInstance);
+ }
+
+ protected synchronized void customConfigure(Object beanInstance)
+ {
+ if (customizer != null)
+ {
+ customizer.customize(beanInstance);
+ }
+ }
+
+ public BeanCustomizer getCustomizer()
+ {
+ return customizer;
+ }
+
+ public void setCustomizer(BeanCustomizer customizer)
+ {
+ this.customizer = customizer;
+ }
+
+ @Override
+ public Class<?> getRegistrationType()
+ {
+ return Configurer.class;
+ }
+}
Property changes on:
stack/cxf/branches/no-spring-support/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/configuration/JBossWSConfigurer.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added:
stack/cxf/branches/no-spring-support/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/configuration/JBossWSNonSpringBusFactory.java
===================================================================
---
stack/cxf/branches/no-spring-support/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/configuration/JBossWSNonSpringBusFactory.java
(rev 0)
+++
stack/cxf/branches/no-spring-support/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/configuration/JBossWSNonSpringBusFactory.java 2010-06-17
09:48:31 UTC (rev 12494)
@@ -0,0 +1,62 @@
+/*
+ * 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.util.HashMap;
+import java.util.Map;
+
+import org.apache.cxf.Bus;
+import org.apache.cxf.bus.CXFBusFactory;
+import org.apache.cxf.bus.extension.ExtensionManagerBus;
+import org.apache.cxf.configuration.Configurer;
+
+/**
+ *
+ * @author alessio.soldano(a)jboss.com
+ * @since 16-Jun-2010
+ *
+ */
+public class JBossWSNonSpringBusFactory extends CXFBusFactory
+{
+ @SuppressWarnings("unchecked")
+ @Override
+ public Bus createBus(Map<Class, Object> extensions, Map<String, Object>
properties) {
+ if (extensions == null)
+ {
+ extensions = new HashMap<Class, Object>();
+ }
+ if (!extensions.containsKey(Configurer.class))
+ {
+ extensions.put(Configurer.class, new JBossWSConfigurer(new BeanCustomizer()));
+ }
+
+ Bus bus = new ExtensionManagerBus(extensions, properties);
+ possiblySetDefaultBus(bus);
+ initializeBus(bus);
+ return bus;
+ }
+
+ @Override
+ protected void initializeBus(Bus bus) {
+ super.initializeBus(bus);
+ }
+}
Property changes on:
stack/cxf/branches/no-spring-support/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/configuration/JBossWSNonSpringBusFactory.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added:
stack/cxf/branches/no-spring-support/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/configuration/JBossWSSpringConfigurer.java
===================================================================
---
stack/cxf/branches/no-spring-support/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/configuration/JBossWSSpringConfigurer.java
(rev 0)
+++
stack/cxf/branches/no-spring-support/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/configuration/JBossWSSpringConfigurer.java 2010-06-17
09:48:31 UTC (rev 12494)
@@ -0,0 +1,67 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2009, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.jboss.wsf.stack.cxf.client.configuration;
+
+import org.apache.cxf.configuration.spring.ConfigurerImpl;
+
+/**
+ * A CXF configurer (Spring based) that sets JBossWS stuff / customizations / properties
etc. in CXF configurable beans
+ *
+ * @author alessio.soldano(a)jboss.com
+ * @since 05-Oct-2009
+ */
+public class JBossWSSpringConfigurer extends ConfigurerImpl
+{
+ private BeanCustomizer customizer;
+
+ @Override
+ public void configureBean(Object beanInstance)
+ {
+ customConfigure(beanInstance);
+ super.configureBean(beanInstance);
+ }
+
+ @Override
+ public void configureBean(String name, Object beanInstance)
+ {
+ customConfigure(beanInstance);
+ super.configureBean(name, beanInstance);
+ }
+
+ protected synchronized void customConfigure(Object beanInstance)
+ {
+ if (customizer != null)
+ {
+ customizer.customize(beanInstance);
+ }
+ }
+
+ public BeanCustomizer getCustomizer()
+ {
+ return customizer;
+ }
+
+ public void setCustomizer(BeanCustomizer customizer)
+ {
+ this.customizer = customizer;
+ }
+}
Property changes on:
stack/cxf/branches/no-spring-support/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/configuration/JBossWSSpringConfigurer.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added:
stack/cxf/branches/no-spring-support/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/util/SpringUtils.java
===================================================================
---
stack/cxf/branches/no-spring-support/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/util/SpringUtils.java
(rev 0)
+++
stack/cxf/branches/no-spring-support/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/util/SpringUtils.java 2010-06-17
09:48:31 UTC (rev 12494)
@@ -0,0 +1,45 @@
+/*
+ * 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.util;
+
+
+/**
+ *
+ * @author alessio.soldano(a)jboss.com
+ * @since 16-Jun-2010
+ *
+ */
+public class SpringUtils
+{
+ public static boolean isSpringAvailable()
+ {
+ try
+ {
+
Thread.currentThread().getContextClassLoader().loadClass("org.springframework.context.ApplicationContext");
+ return true;
+ }
+ catch (Exception e)
+ {
+ return false;
+ }
+ }
+}
Property changes on:
stack/cxf/branches/no-spring-support/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/util/SpringUtils.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Modified:
stack/cxf/branches/no-spring-support/modules/client/src/main/resources/META-INF/cxf/jbossws-cxf.xml
===================================================================
---
stack/cxf/branches/no-spring-support/modules/client/src/main/resources/META-INF/cxf/jbossws-cxf.xml 2010-06-17
09:31:35 UTC (rev 12493)
+++
stack/cxf/branches/no-spring-support/modules/client/src/main/resources/META-INF/cxf/jbossws-cxf.xml 2010-06-17
09:48:31 UTC (rev 12494)
@@ -45,7 +45,11 @@
<property name="bus" ref="cxf"/>
</bean>
- <bean id="org.apache.cxf.configuration.Configurer"
class="org.jboss.wsf.stack.cxf.client.configuration.JBossWSCXFConfigurer"/>
+ <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">
<property name="mapProvider">
Modified:
stack/cxf/branches/no-spring-support/modules/endorsed/src/main/resources/META-INF/services/org.apache.cxf.bus.factory
===================================================================
---
stack/cxf/branches/no-spring-support/modules/endorsed/src/main/resources/META-INF/services/org.apache.cxf.bus.factory 2010-06-17
09:31:35 UTC (rev 12493)
+++
stack/cxf/branches/no-spring-support/modules/endorsed/src/main/resources/META-INF/services/org.apache.cxf.bus.factory 2010-06-17
09:48:31 UTC (rev 12494)
@@ -1 +1 @@
-org.jboss.wsf.stack.cxf.client.configuration.JBossWSSpringBusFactory
\ No newline at end of file
+org.jboss.wsf.stack.cxf.client.configuration.JBossWSBusFactory
\ No newline at end of file
Added:
stack/cxf/branches/no-spring-support/modules/server/src/main/java/org/jboss/wsf/stack/cxf/CXFNonSpringServletExt.java
===================================================================
---
stack/cxf/branches/no-spring-support/modules/server/src/main/java/org/jboss/wsf/stack/cxf/CXFNonSpringServletExt.java
(rev 0)
+++
stack/cxf/branches/no-spring-support/modules/server/src/main/java/org/jboss/wsf/stack/cxf/CXFNonSpringServletExt.java 2010-06-17
09:48:31 UTC (rev 12494)
@@ -0,0 +1,90 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2010, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.jboss.wsf.stack.cxf;
+
+import javax.servlet.ServletConfig;
+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.CXFNonSpringServlet;
+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.stack.cxf.configuration.BusHolder;
+import org.jboss.wsf.stack.cxf.transport.ServletHelper;
+
+/**
+ * An extension to the CXFNonSpringServlet
+ *
+ * @author alessio.soldano(a)jboss.com
+ * @since 16-Jun-2010
+ *
+ */
+public class CXFNonSpringServletExt extends CXFNonSpringServlet
+{
+ 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
+ bus = holder.getBus();
+ BusFactory.possiblySetDefaultBus(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);
+ }
+}
Property changes on:
stack/cxf/branches/no-spring-support/modules/server/src/main/java/org/jboss/wsf/stack/cxf/CXFNonSpringServletExt.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Modified:
stack/cxf/branches/no-spring-support/modules/server/src/main/java/org/jboss/wsf/stack/cxf/CXFServletExt.java
===================================================================
---
stack/cxf/branches/no-spring-support/modules/server/src/main/java/org/jboss/wsf/stack/cxf/CXFServletExt.java 2010-06-17
09:31:35 UTC (rev 12493)
+++
stack/cxf/branches/no-spring-support/modules/server/src/main/java/org/jboss/wsf/stack/cxf/CXFServletExt.java 2010-06-17
09:48:31 UTC (rev 12494)
@@ -1,6 +1,6 @@
/*
* JBoss, Home of Professional Open Source.
- * Copyright 2009, Red Hat Middleware LLC, and individual contributors
+ * 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.
*
@@ -21,36 +21,20 @@
*/
package org.jboss.wsf.stack.cxf;
-import java.io.IOException;
-import java.lang.reflect.Method;
-
-import javax.management.ObjectName;
import javax.servlet.ServletConfig;
-import javax.servlet.ServletContext;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
-import javax.xml.ws.WebServiceException;
-import org.apache.cxf.Bus;
import org.apache.cxf.BusFactory;
-import org.apache.cxf.management.InstrumentationManager;
-import org.apache.cxf.management.counters.CounterRepository;
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.common.ObjectNameFactory;
-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.EndpointAssociation;
-import org.jboss.wsf.spi.invocation.RequestHandler;
-import org.jboss.wsf.spi.management.EndpointRegistry;
-import org.jboss.wsf.spi.management.EndpointRegistryFactory;
import org.jboss.wsf.stack.cxf.configuration.BusHolder;
-import org.jboss.wsf.stack.cxf.management.InstrumentationManagerExtImpl;
+import org.jboss.wsf.stack.cxf.transport.ServletHelper;
/**
* An extension to the CXF servlet
@@ -60,8 +44,6 @@
*/
public class CXFServletExt extends CXFServlet
{
- public static final String ENABLE_CXF_MANAGEMENT = "enable.cxf.management";
-
protected Endpoint endpoint;
@Override
@@ -75,17 +57,13 @@
public void loadBus(ServletConfig servletConfig) throws ServletException
{
//Init the Endpoint
- initEndpoint(servletConfig);
+ endpoint = ServletHelper.initEndpoint(servletConfig, getServletName());
- ServletContext svCtx = getServletContext();
//keep the bus created during deployment and update it with the information coming
from the servlet config
updateAvailableBusWithServletInfo(servletConfig);
//register the InstrumentManagementImpl
- //TODO!! remove reflection use inside this by providing proper hook in CXF and move
this configuration to BusHolder
- if (svCtx.getInitParameter(ENABLE_CXF_MANAGEMENT) != null &&
"true".equalsIgnoreCase((String)svCtx.getInitParameter(ENABLE_CXF_MANAGEMENT)))
{
- registerInstrumentManger(bus);
- }
+ ServletHelper.registerInstrumentManger(bus, getServletContext());
}
private void updateAvailableBusWithServletInfo(ServletConfig servletConfig)
@@ -104,94 +82,9 @@
servletConfig.getServletContext().setAttribute(ServletController.class.getName(),
getController());
}
- private void initEndpoint(ServletConfig servletConfig)
- {
- SPIProvider spiProvider = SPIProviderResolver.getInstance().getProvider();
- EndpointRegistry epRegistry =
spiProvider.getSPI(EndpointRegistryFactory.class).getEndpointRegistry();
-
- ServletContext context = servletConfig.getServletContext();
- String contextPath = context.getContextPath();
- endpoint = initServiceEndpoint(epRegistry, contextPath);
- }
-
@Override
protected void invoke(HttpServletRequest req, HttpServletResponse res) throws
ServletException
{
- try
- {
- BusFactory.setThreadDefaultBus(getBus());
- //set the current endpoint into the threadlocal association that is later
- //used by the EndpointAssociationInterceptor for linking the message exchange
- //related to this invocation to the proper endpoint serving it (the bus, and
- //hence the interceptor, can span multiple invocation related to multiple
- //endpoints)
- EndpointAssociation.setEndpoint(endpoint);
- RequestHandler requestHandler = (RequestHandler)endpoint.getRequestHandler();
- requestHandler.handleHttpRequest(endpoint, req, res, getServletContext());
- }
- catch (IOException ioe)
- {
- throw new ServletException(ioe);
- }
- finally
- {
- EndpointAssociation.removeEndpoint();
- BusFactory.setThreadDefaultBus(null);
- }
+ ServletHelper.callRequestHandler(req, res, getServletContext(), getBus(),
endpoint);
}
-
- /** Initialize the service endpoint
- */
- private Endpoint initServiceEndpoint(EndpointRegistry epRegistry, String contextPath)
- {
- if (contextPath.startsWith("/"))
- contextPath = contextPath.substring(1);
-
- Endpoint endpoint = null;
- String servletName = getServletName();
- for (ObjectName sepId : epRegistry.getEndpoints())
- {
- String propContext = sepId.getKeyProperty(Endpoint.SEPID_PROPERTY_CONTEXT);
- String propEndpoint = sepId.getKeyProperty(Endpoint.SEPID_PROPERTY_ENDPOINT);
- if (servletName.equals(propEndpoint) &&
contextPath.equals(propContext))
- {
- endpoint = epRegistry.getEndpoint(sepId);
- break;
- }
- }
-
- if (endpoint == null)
- {
- ObjectName oname = ObjectNameFactory.create(Endpoint.SEPID_DOMAIN +
":" + Endpoint.SEPID_PROPERTY_CONTEXT + "=" + contextPath +
","
- + Endpoint.SEPID_PROPERTY_ENDPOINT + "=" + servletName);
- throw new WebServiceException("Cannot obtain endpoint for: " +
oname);
- }
-
- return endpoint;
- }
-
- private void registerInstrumentManger(Bus bus) throws ServletException
- {
- InstrumentationManagerExtImpl instrumentationManagerImpl = new
InstrumentationManagerExtImpl();
- instrumentationManagerImpl.setBus(bus);
- instrumentationManagerImpl.setEnabled(true);
- instrumentationManagerImpl.initMBeanServer();
- instrumentationManagerImpl.register();
- bus.setExtension(instrumentationManagerImpl, InstrumentationManager.class);
-
- //attach couterRepository
- CounterRepository couterRepository = new CounterRepository();
- couterRepository.setBus(bus);
-
- try
- {
- Method method =
CounterRepository.class.getDeclaredMethod("registerInterceptorsToBus", new
Class[] {});
- method.setAccessible(true);
- method.invoke(couterRepository, new Object[] {});
- }
- catch (Exception e)
- {
- throw new ServletException(e);
- }
- }
}
Modified:
stack/cxf/branches/no-spring-support/modules/server/src/main/java/org/jboss/wsf/stack/cxf/configuration/BusHolder.java
===================================================================
---
stack/cxf/branches/no-spring-support/modules/server/src/main/java/org/jboss/wsf/stack/cxf/configuration/BusHolder.java 2010-06-17
09:31:35 UTC (rev 12493)
+++
stack/cxf/branches/no-spring-support/modules/server/src/main/java/org/jboss/wsf/stack/cxf/configuration/BusHolder.java 2010-06-17
09:48:31 UTC (rev 12494)
@@ -22,32 +22,18 @@
package org.jboss.wsf.stack.cxf.configuration;
import java.io.IOException;
-import java.io.InputStream;
-import java.net.URL;
-import java.util.LinkedList;
-import java.util.List;
import org.apache.cxf.Bus;
import org.apache.cxf.binding.soap.SoapTransportFactory;
-import org.apache.cxf.bus.spring.BusApplicationContext;
import org.apache.cxf.configuration.Configurer;
import org.apache.cxf.resource.ResourceManager;
import org.apache.cxf.resource.ResourceResolver;
import org.apache.cxf.transport.DestinationFactory;
import org.apache.cxf.transport.DestinationFactoryManager;
-import org.apache.cxf.transport.servlet.ServletTransportFactory;
-import org.jboss.logging.Logger;
import org.jboss.ws.Constants;
import org.jboss.wsf.spi.binding.BindingCustomization;
-import org.jboss.wsf.stack.cxf.client.configuration.JBossWSCXFConfigurer;
-import org.jboss.wsf.stack.cxf.client.configuration.JBossWSSpringBusFactory;
import org.jboss.wsf.stack.cxf.deployment.WSDLFilePublisher;
import org.jboss.wsf.stack.cxf.interceptor.EndpointAssociationInterceptor;
-import org.jboss.wsf.stack.cxf.spring.handler.NamespaceHandlerResolver;
-import org.springframework.beans.factory.xml.XmlBeanDefinitionReader;
-import org.springframework.context.ApplicationContext;
-import org.springframework.context.support.GenericApplicationContext;
-import org.springframework.core.io.InputStreamResource;
/**
* A wrapper of the Bus for performing most of the configurations required on it by
JBossWS
@@ -56,67 +42,32 @@
* @since 25-Mar-2010
*
*/
-public class BusHolder
+public abstract class BusHolder
{
- private static final Logger log = Logger.getLogger(BusHolder.class);
public static final String PARAM_CXF_BEANS_URL = "jbossws.cxf.beans.url";
- private boolean configured = false;
- protected BusApplicationContext ctx ;
- protected List<GenericApplicationContext> additionalCtx = new
LinkedList<GenericApplicationContext>();
protected Bus bus;
- /**
- * Private constructor
- */
- private BusHolder()
+ public BusHolder()
{
- //NOP
+
}
- /**
- * Creates a new BusHolder instance; a new Bus is created using the
- * provided location for loading additional configurations
- *
- * @param location
- * @return
- */
- public static BusHolder create(URL location)
+ public BusHolder(Bus bus)
{
- BusHolder holder = new BusHolder();
- holder.createBus(location);
- return holder;
+ setBus(bus);
}
/**
- * Creates a new BusHolder instance using the provided Bus
- *
- * @param bus
- * @return
- */
- public static BusHolder create(Bus bus)
- {
- BusHolder holder = new BusHolder();
- holder.setBus(bus);
- holder.setContext(bus.getExtension(BusApplicationContext.class));
- return holder;
- }
-
- /**
* Update the Bus held by the this instance using the provided parameters.
* This basically prepares the bus for being used with JBossWS.
*
- * @param jbossCxfXml The location of the jboss-cxf.xml configuration file
* @param soapTransportFactory The SoapTransportFactory to configure, if any
* @param resolver The ResourceResolver to configure, if any
* @param configurer The JBossWSCXFConfigurer to install in the bus, if
any
* @throws IOException Throws IOException if the jboss-cxf.xml file
can't be read
*/
- public void configure(URL jbossCxfXml, SoapTransportFactory soapTransportFactory,
ResourceResolver resolver, Configurer configurer) throws IOException
+ protected void configure(SoapTransportFactory soapTransportFactory, ResourceResolver
resolver, Configurer configurer)
{
- if (configured)
- {
- throw new IllegalStateException("Underlying bus is already configured for
JBossWS use!");
- }
if (configurer != null)
{
bus.setExtension(configurer, Configurer.class);
@@ -124,73 +75,26 @@
setInterceptors(bus);
setSoapTransportFactory(bus, soapTransportFactory);
setResourceResolver(bus, resolver);
- if (jbossCxfXml != null)
- {
- additionalCtx.add(loadAdditionalConfig(ctx, jbossCxfXml));
- }
- configured = true;
}
- /**
- * A convenient method for getting a jbossws cxf server configurer delegating to the
- * cxf configurer that's currently installed in the hold bus.
- *
- * @param customization The binding customization to set in the configurer, if any
- * @param wsdlPublisher The wsdl file publisher to set in the configurer, if any
- * @return The new jbossws cxf configurer
- */
- public Configurer createServerConfigurer(BindingCustomization customization,
WSDLFilePublisher wsdlPublisher)
- {
- //the JBossWSCXFConfigurer should already be set through
cxf-extensions-jbossws.xml
- ApplicationContext ctx = bus.getExtension(BusApplicationContext.class);
- JBossWSServerCXFConfigurer serverConfigurer = new JBossWSServerCXFConfigurer(ctx);
- serverConfigurer.setBindingCustomization(customization);
- serverConfigurer.setWsdlPublisher(wsdlPublisher);
- return serverConfigurer;
- }
/**
- * Performs close operations (currently implies destroying additional contexts)
+ * Performs close operations
*
*/
public void close()
{
- for (GenericApplicationContext gac : additionalCtx)
- {
- gac.destroy();
- }
+
}
/**
- * Creates the Bus using a SpringBusFactory with no specific Spring application
context.
- * Then loads additional configurations from the provided location
+ * A convenient method for getting a jbossws cxf server configurer
*
- * @param location
- * @return
+ * @param customization The binding customization to set in the configurer, if any
+ * @param wsdlPublisher The wsdl file publisher to set in the configurer, if any
+ * @return The new jbossws cxf configurer
*/
- protected void createBus(URL location)
- {
- bus = new JBossWSSpringBusFactory().createBus();
- ctx = bus.getExtension(BusApplicationContext.class);
- //Load additional configurations from cxf-servlet.xml
- if (location != null)
- {
- try
- {
- additionalCtx.add(loadAdditionalConfig(ctx, location));
- }
- catch (IOException e)
- {
- if (log.isTraceEnabled())
- log.trace("Could not load additional config from location: " +
location, e);
- }
- }
- //Force servlet transport to prevent CXF from using Jetty as a transport
- DestinationFactory factory = new ServletTransportFactory(bus);
- for (String s : factory.getTransportIds()) {
- registerTransport(factory, s);
- }
- }
+ public abstract Configurer createServerConfigurer(BindingCustomization customization,
WSDLFilePublisher wsdlPublisher);
protected static void setInterceptors(Bus bus)
{
@@ -217,21 +121,8 @@
dfm.registerDestinationFactory(Constants.NS_SOAP12, factory);
}
}
-
- protected static GenericApplicationContext loadAdditionalConfig(ApplicationContext
ctx, URL locationUrl) throws IOException
- {
- if (locationUrl == null) throw new IllegalArgumentException("Cannot load
additional config from null location!");
- InputStream is = locationUrl.openStream();
- GenericApplicationContext childCtx = new GenericApplicationContext(ctx);
- XmlBeanDefinitionReader reader = new XmlBeanDefinitionReader(childCtx);
- reader.setValidationMode(XmlBeanDefinitionReader.VALIDATION_XSD);
- reader.setNamespaceHandlerResolver(new NamespaceHandlerResolver());
- reader.loadBeanDefinitions(new InputStreamResource(is));
- childCtx.refresh();
- return childCtx;
- }
- private void registerTransport(DestinationFactory factory, String namespace)
+ protected void registerTransport(DestinationFactory factory, String namespace)
{
bus.getExtension(DestinationFactoryManager.class).registerDestinationFactory(namespace,
factory);
}
@@ -246,13 +137,8 @@
return bus;
}
- private void setBus(Bus bus)
+ protected void setBus(Bus bus)
{
this.bus = bus;
}
-
- private void setContext(BusApplicationContext ctx)
- {
- this.ctx = ctx;
- }
}
Deleted:
stack/cxf/branches/no-spring-support/modules/server/src/main/java/org/jboss/wsf/stack/cxf/configuration/JBossWSServerCXFConfigurer.java
===================================================================
---
stack/cxf/branches/no-spring-support/modules/server/src/main/java/org/jboss/wsf/stack/cxf/configuration/JBossWSServerCXFConfigurer.java 2010-06-17
09:31:35 UTC (rev 12493)
+++
stack/cxf/branches/no-spring-support/modules/server/src/main/java/org/jboss/wsf/stack/cxf/configuration/JBossWSServerCXFConfigurer.java 2010-06-17
09:48:31 UTC (rev 12494)
@@ -1,70 +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.JBossWSCXFConfigurer;
-import org.jboss.wsf.stack.cxf.deployment.EndpointImpl;
-import org.jboss.wsf.stack.cxf.deployment.WSDLFilePublisher;
-import org.springframework.context.ApplicationContext;
-
-/**
- * A JBossWS CXF Configurer to be used on server side
- *
- * @author alessio.soldano(a)jboss.com
- * @author ema(a)redhat.com
- * @since 31-Mar-2010
- */
-public class JBossWSServerCXFConfigurer extends JBossWSCXFConfigurer
-{
- private WSDLFilePublisher wsdlPublisher;
-
- public JBossWSServerCXFConfigurer(ApplicationContext ctx)
- {
- setApplicationContext(ctx);
-
- }
-
- @Override
- protected void customConfigure(Object beanInstance)
- {
- if (beanInstance instanceof EndpointImpl)
- {
- configureEndpoint((EndpointImpl)beanInstance);
- }
- super.customConfigure(beanInstance);
- }
-
- protected synchronized void configureEndpoint(EndpointImpl endpoint)
- {
- //Configure wsdl file publisher
- if (wsdlPublisher != null)
- {
- endpoint.setWsdlPublisher(wsdlPublisher);
- }
- }
-
- public void setWsdlPublisher(WSDLFilePublisher wsdlPublisher)
- {
- this.wsdlPublisher = wsdlPublisher;
- }
-
-}
Added:
stack/cxf/branches/no-spring-support/modules/server/src/main/java/org/jboss/wsf/stack/cxf/configuration/JBossWSServerSpringConfigurer.java
===================================================================
---
stack/cxf/branches/no-spring-support/modules/server/src/main/java/org/jboss/wsf/stack/cxf/configuration/JBossWSServerSpringConfigurer.java
(rev 0)
+++
stack/cxf/branches/no-spring-support/modules/server/src/main/java/org/jboss/wsf/stack/cxf/configuration/JBossWSServerSpringConfigurer.java 2010-06-17
09:48:31 UTC (rev 12494)
@@ -0,0 +1,40 @@
+/*
+ * 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);
+ }
+}
Property changes on:
stack/cxf/branches/no-spring-support/modules/server/src/main/java/org/jboss/wsf/stack/cxf/configuration/JBossWSServerSpringConfigurer.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added:
stack/cxf/branches/no-spring-support/modules/server/src/main/java/org/jboss/wsf/stack/cxf/configuration/NonSpringBusHolder.java
===================================================================
---
stack/cxf/branches/no-spring-support/modules/server/src/main/java/org/jboss/wsf/stack/cxf/configuration/NonSpringBusHolder.java
(rev 0)
+++
stack/cxf/branches/no-spring-support/modules/server/src/main/java/org/jboss/wsf/stack/cxf/configuration/NonSpringBusHolder.java 2010-06-17
09:48:31 UTC (rev 12494)
@@ -0,0 +1,125 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2010, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.jboss.wsf.stack.cxf.configuration;
+
+import java.io.IOException;
+
+import javax.xml.ws.soap.SOAPBinding;
+
+import org.apache.cxf.binding.BindingConfiguration;
+import org.apache.cxf.binding.soap.SoapTransportFactory;
+import org.apache.cxf.configuration.Configurer;
+import org.apache.cxf.resource.ResourceResolver;
+import org.apache.cxf.service.invoker.Invoker;
+import org.apache.cxf.transport.DestinationFactory;
+import org.apache.cxf.transport.servlet.ServletTransportFactory;
+import org.jboss.wsf.spi.binding.BindingCustomization;
+import org.jboss.wsf.stack.cxf.client.configuration.JBossWSConfigurer;
+import org.jboss.wsf.stack.cxf.client.configuration.JBossWSNonSpringBusFactory;
+import org.jboss.wsf.stack.cxf.deployment.EndpointImpl;
+import org.jboss.wsf.stack.cxf.deployment.WSDLFilePublisher;
+import org.jboss.wsf.stack.cxf.metadata.services.DDBeans;
+import org.jboss.wsf.stack.cxf.metadata.services.DDEndpoint;
+
+/**
+ * A @see{org.jboss.wsf.stack.cxf.configuration.BusHolder} that
+ * does not use any Spring facilities.
+ *
+ * @author alessio.soldano(a)jboss.com
+ * @since 16-Jun-2010
+ *
+ */
+public class NonSpringBusHolder extends BusHolder
+{
+ private boolean configured = false;
+
+ public NonSpringBusHolder()
+ {
+ super();
+ bus = new JBossWSNonSpringBusFactory().createBus();
+ //Force servlet transport to prevent CXF from using Jetty as a transport
+ DestinationFactory factory = new ServletTransportFactory(bus);
+ for (String s : factory.getTransportIds()) {
+ registerTransport(factory, s);
+ }
+ }
+
+ /**
+ * Update the Bus held by the this instance using the provided parameters.
+ * This basically prepares the bus for being used with JBossWS.
+ *
+ * @param jbossCxfXml The location of the jboss-cxf.xml configuration file
+ * @param soapTransportFactory The SoapTransportFactory to configure, if any
+ * @param resolver The ResourceResolver to configure, if any
+ * @param configurer The JBossWSCXFConfigurer to install in the bus, if
any
+ * @throws IOException Throws IOException if the jboss-cxf.xml file
can't be read
+ */
+ public void configure(DDBeans metadata, SoapTransportFactory soapTransportFactory,
ResourceResolver resolver, Configurer configurer)
+ {
+ if (configured)
+ {
+ throw new IllegalStateException("Underlying bus is already configured for
JBossWS use!");
+ }
+ super.configure(soapTransportFactory, resolver, configurer);
+
+ for (DDEndpoint dde : metadata.getEndpoints())
+ {
+ EndpointImpl endpoint = new EndpointImpl(bus,
newInstance(dde.getImplementor()));
+ endpoint.setInvoker((Invoker)newInstance(dde.getInvoker()));
+ endpoint.setAddress(dde.getAddress());
+ endpoint.setEndpointName(dde.getPortName());
+ endpoint.setServiceName(dde.getServiceName());
+ endpoint.setWsdlLocation(dde.getWsdlLocation());
+ endpoint.publish();
+ if (dde.isMtomEnabled())
+ {
+ SOAPBinding binding = (SOAPBinding) endpoint.getBinding();
+ binding.setMTOMEnabled(true);
+ }
+ //TODO!! We need to stop the endpoint on undeployment
+ }
+ configured = true;
+ }
+
+ private static Object newInstance(String className)
+ {
+ try
+ {
+ Class<?> clazz =
Thread.currentThread().getContextClassLoader().loadClass(className);
+ return clazz.newInstance();
+ }
+ catch (Exception e)
+ {
+ throw new RuntimeException(e);
+ }
+ }
+
+ @Override
+ public Configurer createServerConfigurer(BindingCustomization customization,
WSDLFilePublisher wsdlPublisher)
+ {
+ ServerBeanCustomizer customizer = new ServerBeanCustomizer();
+ customizer.setBindingCustomization(customization);
+ customizer.setWsdlPublisher(wsdlPublisher);
+ return new JBossWSConfigurer(customizer);
+ }
+
+}
Property changes on:
stack/cxf/branches/no-spring-support/modules/server/src/main/java/org/jboss/wsf/stack/cxf/configuration/NonSpringBusHolder.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added:
stack/cxf/branches/no-spring-support/modules/server/src/main/java/org/jboss/wsf/stack/cxf/configuration/ServerBeanCustomizer.java
===================================================================
---
stack/cxf/branches/no-spring-support/modules/server/src/main/java/org/jboss/wsf/stack/cxf/configuration/ServerBeanCustomizer.java
(rev 0)
+++
stack/cxf/branches/no-spring-support/modules/server/src/main/java/org/jboss/wsf/stack/cxf/configuration/ServerBeanCustomizer.java 2010-06-17
09:48:31 UTC (rev 12494)
@@ -0,0 +1,61 @@
+/*
+ * 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.BeanCustomizer;
+import org.jboss.wsf.stack.cxf.deployment.EndpointImpl;
+import org.jboss.wsf.stack.cxf.deployment.WSDLFilePublisher;
+
+/**
+ *
+ * @author alessio.soldano(a)jboss.com
+ * @since 16-Jun-2010
+ */
+public class ServerBeanCustomizer extends BeanCustomizer
+{
+ private WSDLFilePublisher wsdlPublisher;
+
+ @Override
+ public void customize(Object beanInstance)
+ {
+ if (beanInstance instanceof EndpointImpl)
+ {
+ configureEndpoint((EndpointImpl)beanInstance);
+ }
+ super.customize(beanInstance);
+ }
+
+ protected void configureEndpoint(EndpointImpl endpoint)
+ {
+ //Configure wsdl file publisher
+ if (wsdlPublisher != null)
+ {
+ endpoint.setWsdlPublisher(wsdlPublisher);
+ }
+ }
+
+ public void setWsdlPublisher(WSDLFilePublisher wsdlPublisher)
+ {
+ this.wsdlPublisher = wsdlPublisher;
+ }
+
+}
Property changes on:
stack/cxf/branches/no-spring-support/modules/server/src/main/java/org/jboss/wsf/stack/cxf/configuration/ServerBeanCustomizer.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added:
stack/cxf/branches/no-spring-support/modules/server/src/main/java/org/jboss/wsf/stack/cxf/configuration/SpringBusHolder.java
===================================================================
---
stack/cxf/branches/no-spring-support/modules/server/src/main/java/org/jboss/wsf/stack/cxf/configuration/SpringBusHolder.java
(rev 0)
+++
stack/cxf/branches/no-spring-support/modules/server/src/main/java/org/jboss/wsf/stack/cxf/configuration/SpringBusHolder.java 2010-06-17
09:48:31 UTC (rev 12494)
@@ -0,0 +1,167 @@
+/*
+ * 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 java.io.IOException;
+import java.io.InputStream;
+import java.net.URL;
+import java.util.LinkedList;
+import java.util.List;
+
+import org.apache.cxf.Bus;
+import org.apache.cxf.binding.soap.SoapTransportFactory;
+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.jboss.logging.Logger;
+import org.jboss.wsf.spi.binding.BindingCustomization;
+import org.jboss.wsf.stack.cxf.client.configuration.JBossWSSpringBusFactory;
+import org.jboss.wsf.stack.cxf.deployment.WSDLFilePublisher;
+import org.jboss.wsf.stack.cxf.spring.handler.NamespaceHandlerResolver;
+import org.springframework.beans.factory.xml.XmlBeanDefinitionReader;
+import org.springframework.context.ApplicationContext;
+import org.springframework.context.support.GenericApplicationContext;
+import org.springframework.core.io.InputStreamResource;
+
+/**
+ * A Spring-enabled version of @see{org.jboss.wsf.stack.cxf.configuration.BusHolder}
+ *
+ * @author alessio.soldano(a)jboss.com
+ * @since 16-Jun-2010
+ *
+ */
+public class SpringBusHolder extends BusHolder
+{
+ private static final Logger log = Logger.getLogger(BusHolder.class);
+ private boolean configured = false;
+ protected BusApplicationContext ctx ;
+ protected List<GenericApplicationContext> additionalCtx = new
LinkedList<GenericApplicationContext>();
+
+ public SpringBusHolder(URL location)
+ {
+ super();
+ createBus(location);
+ }
+
+ /**
+ * Creates the Bus using a SpringBusFactory with no specific Spring application
context.
+ * Then loads additional configurations from the provided location
+ *
+ * @param location
+ * @return
+ */
+ protected void createBus(URL location)
+ {
+ bus = new JBossWSSpringBusFactory().createBus();
+ ctx = bus.getExtension(BusApplicationContext.class);
+ //Load additional configurations from cxf-servlet.xml
+ if (location != null)
+ {
+ try
+ {
+ additionalCtx.add(loadAdditionalConfig(ctx, location));
+ }
+ catch (IOException e)
+ {
+ if (log.isTraceEnabled())
+ log.trace("Could not load additional config from location: " +
location, e);
+ }
+ }
+ //Force servlet transport to prevent CXF from using Jetty as a transport
+ DestinationFactory factory = new ServletTransportFactory(bus);
+ for (String s : factory.getTransportIds()) {
+ registerTransport(factory, s);
+ }
+ }
+
+ /**
+ * Update the Bus held by the this instance using the provided parameters.
+ * This basically prepares the bus for being used with JBossWS.
+ *
+ * @param jbossCxfXml The location of the jboss-cxf.xml configuration file
+ * @param soapTransportFactory The SoapTransportFactory to configure, if any
+ * @param resolver The ResourceResolver to configure, if any
+ * @param configurer The JBossWSCXFConfigurer to install in the bus, if
any
+ * @throws IOException Throws IOException if the jboss-cxf.xml file
can't be read
+ */
+ public void configure(URL jbossCxfXml, SoapTransportFactory soapTransportFactory,
ResourceResolver resolver, Configurer configurer) throws IOException
+ {
+ if (configured)
+ {
+ throw new IllegalStateException("Underlying bus is already configured for
JBossWS use!");
+ }
+ super.configure(soapTransportFactory, resolver, configurer);
+ if (jbossCxfXml != null)
+ {
+ additionalCtx.add(loadAdditionalConfig(ctx, jbossCxfXml));
+ }
+ configured = true;
+ }
+
+ @Override
+ public Configurer createServerConfigurer(BindingCustomization customization,
WSDLFilePublisher wsdlPublisher)
+ {
+ ApplicationContext ctx = bus.getExtension(BusApplicationContext.class);
+ ServerBeanCustomizer customizer = new ServerBeanCustomizer();
+ customizer.setBindingCustomization(customization);
+ customizer.setWsdlPublisher(wsdlPublisher);
+ JBossWSServerSpringConfigurer serverConfigurer = new
JBossWSServerSpringConfigurer(ctx);
+ serverConfigurer.setCustomizer(customizer);
+ return serverConfigurer;
+ }
+
+ protected static GenericApplicationContext loadAdditionalConfig(ApplicationContext
ctx, URL locationUrl) throws IOException
+ {
+ if (locationUrl == null) throw new IllegalArgumentException("Cannot load
additional config from null location!");
+ InputStream is = locationUrl.openStream();
+ GenericApplicationContext childCtx = new GenericApplicationContext(ctx);
+ XmlBeanDefinitionReader reader = new XmlBeanDefinitionReader(childCtx);
+ reader.setValidationMode(XmlBeanDefinitionReader.VALIDATION_XSD);
+ reader.setNamespaceHandlerResolver(new NamespaceHandlerResolver());
+ reader.loadBeanDefinitions(new InputStreamResource(is));
+ childCtx.refresh();
+ return childCtx;
+ }
+
+ /**
+ * Performs close operations (currently implies destroying additional contexts)
+ *
+ */
+ @Override
+ public void close()
+ {
+ for (GenericApplicationContext gac : additionalCtx)
+ {
+ gac.destroy();
+ }
+ super.close();
+ }
+
+ @Override
+ protected void setBus(Bus bus)
+ {
+ super.setBus(bus);
+ ctx = (bus.getExtension(BusApplicationContext.class));
+ }
+}
Property changes on:
stack/cxf/branches/no-spring-support/modules/server/src/main/java/org/jboss/wsf/stack/cxf/configuration/SpringBusHolder.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Modified:
stack/cxf/branches/no-spring-support/modules/server/src/main/java/org/jboss/wsf/stack/cxf/deployment/aspect/BusDeploymentAspect.java
===================================================================
---
stack/cxf/branches/no-spring-support/modules/server/src/main/java/org/jboss/wsf/stack/cxf/deployment/aspect/BusDeploymentAspect.java 2010-06-17
09:31:35 UTC (rev 12493)
+++
stack/cxf/branches/no-spring-support/modules/server/src/main/java/org/jboss/wsf/stack/cxf/deployment/aspect/BusDeploymentAspect.java 2010-06-17
09:48:31 UTC (rev 12494)
@@ -34,7 +34,10 @@
import org.jboss.wsf.spi.deployment.Deployment;
import org.jboss.wsf.spi.deployment.ResourceResolver;
import org.jboss.wsf.stack.cxf.configuration.BusHolder;
+import org.jboss.wsf.stack.cxf.configuration.NonSpringBusHolder;
+import org.jboss.wsf.stack.cxf.configuration.SpringBusHolder;
import org.jboss.wsf.stack.cxf.deployment.WSDLFilePublisher;
+import org.jboss.wsf.stack.cxf.metadata.services.DDBeans;
import org.jboss.wsf.stack.cxf.resolver.JBossWSResourceResolver;
import org.jboss.wsf.stack.cxf.transport.SoapTransportFactoryExt;
@@ -50,7 +53,6 @@
@Override
public void start(Deployment dep)
{
- BusHolder holder;
ClassLoader origClassLoader = SecurityActions.getContextClassLoader();
try
{
@@ -59,30 +61,41 @@
SecurityActions.setContextClassLoader(dep.getRuntimeClassLoader());
ResourceResolver deploymentResolver = aDep.getResourceResolver();
-
- URL cxfServletURL = null;
- try
+ org.apache.cxf.resource.ResourceResolver resolver = new
JBossWSResourceResolver(deploymentResolver);
+ Map<String, String> contextParams = (Map<String,
String>)dep.getProperty(WSConstants.STACK_CONTEXT_PARAMS);
+ String jbosswsCxfXml = contextParams == null ? null :
contextParams.get(BusHolder.PARAM_CXF_BEANS_URL);
+
+ if (jbosswsCxfXml != null) // Spring available
{
- cxfServletURL =
deploymentResolver.resolve("WEB-INF/cxf-servlet.xml");
+ URL cxfServletURL = null;
+ try
+ {
+ cxfServletURL =
deploymentResolver.resolve("WEB-INF/cxf-servlet.xml");
+ }
+ catch (IOException e)
+ {
+ } //ignore, cxf-servlet.xml is optional, we might even decide not to support
this
+
+ SpringBusHolder holder = new SpringBusHolder(cxfServletURL);
+ try
+ {
+ Configurer configurer =
holder.createServerConfigurer(dep.getAttachment(BindingCustomization.class), new
WSDLFilePublisher(aDep));
+ holder.configure(deploymentResolver.resolve(jbosswsCxfXml), new
SoapTransportFactoryExt(), resolver, configurer);
+ }
+ catch (IOException e)
+ {
+ throw new RuntimeException(e); //re-throw, jboss-cxf.xml is required
+ }
+ dep.addAttachment(BusHolder.class, holder);
}
- catch (IOException e)
+ else //Spring not available
{
- } //ignore, cxf-servlet.xml is optional, we might even decide not to support
this
-
- holder = BusHolder.create(cxfServletURL);
-
- Map<String, String> contextParams = (Map<String,
String>)dep.getProperty(WSConstants.STACK_CONTEXT_PARAMS);
- try
- {
- URL jbossCxfXml =
deploymentResolver.resolve(contextParams.get(BusHolder.PARAM_CXF_BEANS_URL));
- org.apache.cxf.resource.ResourceResolver resolver = new
JBossWSResourceResolver(deploymentResolver);
+ DDBeans metadata = dep.getAttachment(DDBeans.class);
+ NonSpringBusHolder holder = new NonSpringBusHolder();
Configurer configurer =
holder.createServerConfigurer(dep.getAttachment(BindingCustomization.class), new
WSDLFilePublisher(aDep));
- holder.configure(jbossCxfXml, new SoapTransportFactoryExt(), resolver,
configurer);
+ holder.configure(metadata, new SoapTransportFactoryExt(), resolver,
configurer);
+ dep.addAttachment(BusHolder.class, holder);
}
- catch (IOException e)
- {
- throw new RuntimeException(e); //re-throw, jboss-cxf.xml is required
- }
}
finally
{
@@ -91,8 +104,6 @@
BusFactory.setThreadDefaultBus(null);
SecurityActions.setContextClassLoader(origClassLoader);
}
-
- dep.addAttachment(BusHolder.class, holder);
}
@Override
Modified:
stack/cxf/branches/no-spring-support/modules/server/src/main/java/org/jboss/wsf/stack/cxf/deployment/aspect/DescriptorDeploymentAspect.java
===================================================================
---
stack/cxf/branches/no-spring-support/modules/server/src/main/java/org/jboss/wsf/stack/cxf/deployment/aspect/DescriptorDeploymentAspect.java 2010-06-17
09:31:35 UTC (rev 12493)
+++
stack/cxf/branches/no-spring-support/modules/server/src/main/java/org/jboss/wsf/stack/cxf/deployment/aspect/DescriptorDeploymentAspect.java 2010-06-17
09:48:31 UTC (rev 12494)
@@ -32,6 +32,7 @@
import org.jboss.wsf.spi.deployment.ArchiveDeployment;
import org.jboss.wsf.spi.deployment.Deployment;
import org.jboss.wsf.spi.deployment.Deployment.DeploymentType;
+import org.jboss.wsf.stack.cxf.client.util.SpringUtils;
import org.jboss.wsf.stack.cxf.configuration.BusHolder;
import org.jboss.wsf.stack.cxf.metadata.MetadataBuilder;
import org.jboss.wsf.stack.cxf.metadata.services.DDBeans;
@@ -45,7 +46,7 @@
public class DescriptorDeploymentAspect extends AbstractDeploymentAspect
{
// provide logging
- private final Logger log = Logger.getLogger(DescriptorDeploymentAspect.class);
+ private static final Logger log = Logger.getLogger(DescriptorDeploymentAspect.class);
private String invokerEJB3;
private String invokerJSE;
@@ -63,16 +64,24 @@
@Override
public void start(Deployment dep)
{
- URL cxfURL = getCXFConfigFromClassLoader(dep);
- if (cxfURL == null)
+ if (SpringUtils.isSpringAvailable())
{
- cxfURL = getCXFConfigFromDeployment(dep);
+ URL cxfURL = getCXFConfigFromClassLoader(dep);
if (cxfURL == null)
{
- cxfURL = generateCXFConfigFromDeployment(dep);
+ cxfURL = getCXFConfigFromDeployment(dep);
+ if (cxfURL == null)
+ {
+ cxfURL = generateCXFConfigFromDeployment(dep);
+ }
+ putCXFConfigToDeployment(dep, cxfURL);
}
- putCXFConfigToDeployment(dep, cxfURL);
}
+ else
+ {
+ log.warn("Spring not available, skipping check for user provided
jbossws-cxf.xml / cxf.xml configuration files.");
+ generateMetadataFromDeployment(dep);
+ }
}
@Override
@@ -155,16 +164,26 @@
private URL generateCXFConfigFromDeployment(Deployment dep)
{
// Generate the jbossws-cxf.xml descriptor
- MetadataBuilder builder = new MetadataBuilder();
- DDBeans dd = builder.build(dep, invokerEJB3, invokerJSE);
-
+ DDBeans dd = generateMetadataFromDeployment(dep);
URL cxfURL = dd.createFileURL();
log.info("JBossWS-CXF configuration generated: " + cxfURL);
- dep.addAttachment(DDBeans.class, dd);
return cxfURL;
}
+
+ /**
+ * Generates the jbossws-cxf metadata from the deployment
+ * @param dep
+ * @return
+ */
+ private DDBeans generateMetadataFromDeployment(Deployment dep)
+ {
+ MetadataBuilder builder = new MetadataBuilder();
+ DDBeans dd = builder.build(dep, invokerEJB3, invokerJSE);
+ dep.addAttachment(DDBeans.class, dd);
+ return dd;
+ }
/**
* Puts CXF config file reference to the stack specific context properties.
Added:
stack/cxf/branches/no-spring-support/modules/server/src/main/java/org/jboss/wsf/stack/cxf/transport/ServletHelper.java
===================================================================
---
stack/cxf/branches/no-spring-support/modules/server/src/main/java/org/jboss/wsf/stack/cxf/transport/ServletHelper.java
(rev 0)
+++
stack/cxf/branches/no-spring-support/modules/server/src/main/java/org/jboss/wsf/stack/cxf/transport/ServletHelper.java 2010-06-17
09:48:31 UTC (rev 12494)
@@ -0,0 +1,150 @@
+/*
+ * 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.transport;
+
+import java.io.IOException;
+import java.lang.reflect.Method;
+
+import javax.management.ObjectName;
+import javax.servlet.ServletConfig;
+import javax.servlet.ServletContext;
+import javax.servlet.ServletException;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import javax.xml.ws.WebServiceException;
+
+import org.apache.cxf.Bus;
+import org.apache.cxf.BusFactory;
+import org.apache.cxf.management.InstrumentationManager;
+import org.apache.cxf.management.counters.CounterRepository;
+import org.jboss.wsf.common.ObjectNameFactory;
+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.EndpointAssociation;
+import org.jboss.wsf.spi.invocation.RequestHandler;
+import org.jboss.wsf.spi.management.EndpointRegistry;
+import org.jboss.wsf.spi.management.EndpointRegistryFactory;
+import org.jboss.wsf.stack.cxf.management.InstrumentationManagerExtImpl;
+
+/**
+ *
+ * @author alessio.soldano(a)jboss.com
+ * @since 16-Jun-2010
+ *
+ */
+public class ServletHelper
+{
+ public static final String ENABLE_CXF_MANAGEMENT = "enable.cxf.management";
+
+ public static Endpoint initEndpoint(ServletConfig servletConfig, String servletName)
+ {
+ SPIProvider spiProvider = SPIProviderResolver.getInstance().getProvider();
+ EndpointRegistry epRegistry =
spiProvider.getSPI(EndpointRegistryFactory.class).getEndpointRegistry();
+
+ ServletContext context = servletConfig.getServletContext();
+ String contextPath = context.getContextPath();
+ return initServiceEndpoint(epRegistry, contextPath, servletName);
+ }
+
+ /** Initialize the service endpoint
+ */
+ private static Endpoint initServiceEndpoint(EndpointRegistry epRegistry, String
contextPath, String servletName)
+ {
+ if (contextPath.startsWith("/"))
+ contextPath = contextPath.substring(1);
+
+ Endpoint endpoint = null;
+ for (ObjectName sepId : epRegistry.getEndpoints())
+ {
+ String propContext = sepId.getKeyProperty(Endpoint.SEPID_PROPERTY_CONTEXT);
+ String propEndpoint = sepId.getKeyProperty(Endpoint.SEPID_PROPERTY_ENDPOINT);
+ if (servletName.equals(propEndpoint) &&
contextPath.equals(propContext))
+ {
+ endpoint = epRegistry.getEndpoint(sepId);
+ break;
+ }
+ }
+
+ if (endpoint == null)
+ {
+ ObjectName oname = ObjectNameFactory.create(Endpoint.SEPID_DOMAIN +
":" + Endpoint.SEPID_PROPERTY_CONTEXT + "=" + contextPath +
","
+ + Endpoint.SEPID_PROPERTY_ENDPOINT + "=" + servletName);
+ throw new WebServiceException("Cannot obtain endpoint for: " +
oname);
+ }
+
+ return endpoint;
+ }
+
+ public static void callRequestHandler(HttpServletRequest req, HttpServletResponse res,
ServletContext ctx, Bus bus, Endpoint endpoint) throws ServletException
+ {
+ try
+ {
+ BusFactory.setThreadDefaultBus(bus);
+ //set the current endpoint into the threadlocal association that is later
+ //used by the EndpointAssociationInterceptor for linking the message exchange
+ //related to this invocation to the proper endpoint serving it (the bus, and
+ //hence the interceptor, can span multiple invocation related to multiple
+ //endpoints)
+ EndpointAssociation.setEndpoint(endpoint);
+ RequestHandler requestHandler = (RequestHandler)endpoint.getRequestHandler();
+ requestHandler.handleHttpRequest(endpoint, req, res, ctx);
+ }
+ catch (IOException ioe)
+ {
+ throw new ServletException(ioe);
+ }
+ finally
+ {
+ EndpointAssociation.removeEndpoint();
+ BusFactory.setThreadDefaultBus(null);
+ }
+ }
+
+ public static void registerInstrumentManger(Bus bus, ServletContext svCtx) throws
ServletException
+ {
+ //TODO!! Jim, remove reflection use inside this by providing proper hook in CXF and
move this configuration to BusHolder
+ if (svCtx.getInitParameter(ENABLE_CXF_MANAGEMENT) != null &&
"true".equalsIgnoreCase((String)svCtx.getInitParameter(ENABLE_CXF_MANAGEMENT)))
{
+ InstrumentationManagerExtImpl instrumentationManagerImpl = new
InstrumentationManagerExtImpl();
+ instrumentationManagerImpl.setBus(bus);
+ instrumentationManagerImpl.setEnabled(true);
+ instrumentationManagerImpl.initMBeanServer();
+ instrumentationManagerImpl.register();
+ bus.setExtension(instrumentationManagerImpl, InstrumentationManager.class);
+
+ //attach couterRepository
+ CounterRepository couterRepository = new CounterRepository();
+ couterRepository.setBus(bus);
+
+ try
+ {
+ Method method =
CounterRepository.class.getDeclaredMethod("registerInterceptorsToBus", new
Class[] {});
+ method.setAccessible(true);
+ method.invoke(couterRepository, new Object[] {});
+ }
+ catch (Exception e)
+ {
+ throw new ServletException(e);
+ }
+ }
+ }
+}
Property changes on:
stack/cxf/branches/no-spring-support/modules/server/src/main/java/org/jboss/wsf/stack/cxf/transport/ServletHelper.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Modified:
stack/cxf/branches/no-spring-support/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/endorse/Helper.java
===================================================================
---
stack/cxf/branches/no-spring-support/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/endorse/Helper.java 2010-06-17
09:31:35 UTC (rev 12493)
+++
stack/cxf/branches/no-spring-support/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/endorse/Helper.java 2010-06-17
09:48:31 UTC (rev 12494)
@@ -22,7 +22,7 @@
package org.jboss.test.ws.jaxws.cxf.endorse;
import org.apache.cxf.BusFactory;
-import org.jboss.wsf.stack.cxf.client.configuration.JBossWSSpringBusFactory;
+import org.jboss.wsf.stack.cxf.client.configuration.JBossWSBusFactory;
import org.jboss.wsf.test.JBossWSTestHelper;
/**
@@ -37,8 +37,8 @@
{
//check BusFactory customization; this is required by the JBWS-CXF Configurer
integration (HTTPConduit customization, JAXBIntros, ...)
BusFactory factory = BusFactory.newInstance();
- if (!(factory instanceof JBossWSSpringBusFactory))
- throw new RuntimeException("Expected " + JBossWSSpringBusFactory.class
+ " but got " + (factory == null ? null : factory.getClass()));
+ if (!(factory instanceof JBossWSBusFactory))
+ throw new RuntimeException("Expected " + JBossWSBusFactory.class +
" but got " + (factory == null ? null : factory.getClass()));
//check the Apache CXF JAXWS implementation is actually used
if (!JBossWSTestHelper.isIntegrationCXF())
Modified:
stack/cxf/branches/no-spring-support/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/jaxbintros/JAXBIntroTestCase.java
===================================================================
---
stack/cxf/branches/no-spring-support/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/jaxbintros/JAXBIntroTestCase.java 2010-06-17
09:31:35 UTC (rev 12493)
+++
stack/cxf/branches/no-spring-support/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/jaxbintros/JAXBIntroTestCase.java 2010-06-17
09:48:31 UTC (rev 12494)
@@ -36,7 +36,7 @@
import org.jboss.wsf.common.DOMUtils;
import org.jboss.wsf.spi.binding.BindingCustomization;
import org.jboss.wsf.spi.binding.JAXBBindingCustomization;
-import org.jboss.wsf.stack.cxf.client.configuration.JBossWSCXFConfigurer;
+import org.jboss.wsf.stack.cxf.client.configuration.JBossWSSpringConfigurer;
import org.jboss.wsf.test.JBossWSTest;
import org.jboss.wsf.test.JBossWSTestSetup;
import org.w3c.dom.Element;
@@ -54,7 +54,7 @@
private String endpointAddress = "http://" + getServerHost() +
":8080/jaxws-cxf-jaxbintros/EndpointService";
private Bus bus;
- private JBossWSCXFConfigurer configurer;
+ private JBossWSSpringConfigurer configurer;
public static Test suite()
{
@@ -109,7 +109,7 @@
}
/**
- * Client side uses the annotated user type class, server side uses the plain one but
has jaxintros in place
+ * Client side uses the annotated user type class, server side uses the plain one but
has jaxbintros in place
*
* @throws Exception
*/
@@ -141,13 +141,13 @@
BindingCustomizationFactory.populateBindingCustomization(getResourceURL("jaxws/cxf/jaxbintros/META-INF/jaxb-intros.xml").openStream(),
jaxbCustomizations);
bus = BusFactory.getThreadDefaultBus();
- configurer = (JBossWSCXFConfigurer)bus.getExtension(Configurer.class);
- configurer.setBindingCustomization(jaxbCustomizations);
+ configurer = (JBossWSSpringConfigurer)bus.getExtension(Configurer.class);
+ configurer.getCustomizer().setBindingCustomization(jaxbCustomizations);
}
private void unsetBindingCustomizationOnClientSide()
{
if (configurer != null)
- configurer.setBindingCustomization(null);
+ configurer.getCustomizer().setBindingCustomization(null);
}
}