Author: alessio.soldano(a)jboss.com
Date: 2009-10-08 05:26:12 -0400 (Thu, 08 Oct 2009)
New Revision: 10861
Removed:
stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/configuration/JAXBBindingCustomization.java
stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/JAXBIntroDeploymentAspect.java
Modified:
stack/cxf/trunk/modules/client/pom.xml
stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/configuration/JBossWSCXFConfigurer.java
stack/cxf/trunk/modules/server/pom.xml
stack/cxf/trunk/modules/server/src/main/resources/jbossws-cxf-config.xml
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/jaxbintros/JAXBIntroTestCase.java
stack/cxf/trunk/pom.xml
Log:
[JBWS-2714] Using JAXBIntroDeploymentAspect from framework, removing direct jaxbintros
dependency and using the transitive one from jbossws-common instead, leveraging
BindingCustomizationFactory from jaxbintros
Modified: stack/cxf/trunk/modules/client/pom.xml
===================================================================
--- stack/cxf/trunk/modules/client/pom.xml 2009-10-08 09:23:42 UTC (rev 10860)
+++ stack/cxf/trunk/modules/client/pom.xml 2009-10-08 09:26:12 UTC (rev 10861)
@@ -172,10 +172,6 @@
<artifactId>jboss-common-core</artifactId>
</dependency>
<dependency>
- <groupId>jboss.jaxbintros</groupId>
- <artifactId>jboss-jaxb-intros</artifactId>
- </dependency>
- <dependency>
<groupId>apache-log4j</groupId>
<artifactId>log4j</artifactId>
</dependency>
Deleted:
stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/configuration/JAXBBindingCustomization.java
===================================================================
---
stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/configuration/JAXBBindingCustomization.java 2009-10-08
09:23:42 UTC (rev 10860)
+++
stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/configuration/JAXBBindingCustomization.java 2009-10-08
09:26:12 UTC (rev 10861)
@@ -1,38 +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.client.configuration;
-
-import com.sun.xml.bind.api.JAXBRIContext;
-
-public class JAXBBindingCustomization extends
org.jboss.wsf.spi.binding.JAXBBindingCustomization
-{
- private static final long serialVersionUID = -5922902727331798457L;
-
- // Use an alternative RuntimeAnnotationReader implementation
- public final static String ANNOTATION_READER = JAXBRIContext.ANNOTATION_READER;
-
- // Reassign the default namespace URI to something else at the runtime
- public final static String DEFAULT_NAMESPACE_REMAP =
JAXBRIContext.DEFAULT_NAMESPACE_REMAP;
-
- // Enable the c14n marshalling support in the JAXBContext.
- public final static String CANONICALIZATION_SUPPORT =
JAXBRIContext.CANONICALIZATION_SUPPORT;
-}
Modified:
stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/configuration/JBossWSCXFConfigurer.java
===================================================================
---
stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/configuration/JBossWSCXFConfigurer.java 2009-10-08
09:23:42 UTC (rev 10860)
+++
stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/configuration/JBossWSCXFConfigurer.java 2009-10-08
09:26:12 UTC (rev 10861)
@@ -26,7 +26,6 @@
import org.apache.cxf.frontend.AbstractWSDLBasedEndpointFactory;
import org.apache.cxf.frontend.ClientProxyFactoryBean;
import org.apache.cxf.jaxb.JAXBDataBinding;
-import org.apache.cxf.jaxws.JaxWsProxyFactoryBean;
import org.jboss.wsf.spi.binding.BindingCustomization;
import org.jboss.wsf.spi.binding.JAXBBindingCustomization;
Modified: stack/cxf/trunk/modules/server/pom.xml
===================================================================
--- stack/cxf/trunk/modules/server/pom.xml 2009-10-08 09:23:42 UTC (rev 10860)
+++ stack/cxf/trunk/modules/server/pom.xml 2009-10-08 09:26:12 UTC (rev 10861)
@@ -177,10 +177,6 @@
<artifactId>jaxb-api</artifactId>
</dependency>
<dependency>
- <groupId>jboss.jaxbintros</groupId>
- <artifactId>jboss-jaxb-intros</artifactId>
- </dependency>
- <dependency>
<groupId>org.jboss.jaxr</groupId>
<artifactId>juddi-service</artifactId>
<type>sar</type>
Deleted:
stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/JAXBIntroDeploymentAspect.java
===================================================================
---
stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/JAXBIntroDeploymentAspect.java 2009-10-08
09:23:42 UTC (rev 10860)
+++
stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/JAXBIntroDeploymentAspect.java 2009-10-08
09:26:12 UTC (rev 10861)
@@ -1,124 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2006, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file in the
- * distribution for a full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
- */
-package org.jboss.wsf.stack.cxf;
-
-import java.io.IOException;
-import java.io.InputStream;
-
-import org.jboss.jaxb.intros.IntroductionsAnnotationReader;
-import org.jboss.jaxb.intros.IntroductionsConfigParser;
-import org.jboss.jaxb.intros.configmodel.JaxbIntros;
-import org.jboss.logging.Logger;
-import org.jboss.wsf.spi.binding.BindingCustomization;
-import org.jboss.wsf.spi.deployment.ArchiveDeployment;
-import org.jboss.wsf.spi.deployment.Deployment;
-import org.jboss.wsf.spi.deployment.DeploymentAspect;
-import org.jboss.wsf.spi.deployment.Endpoint;
-import org.jboss.wsf.spi.deployment.UnifiedVirtualFile;
-
-import com.sun.xml.bind.api.JAXBRIContext;
-
-/**
- * A CXF version of JAXBIntroDeploymentAspect, which installs JAXB Introduction
- * metadata into the deployment for later consumption. Despite being the same as the
- * Native one, this deployment aspect is not moved to jbossws-framework as it directly
- * depends on jaxb impl and we don't really want to enforce the same jaxb impl
version
- * dependency on different stacks).
- *
- * @author Heiko.Braun(a)jboss.com
- * @author alessio.soldano(a)jboss.com
- */
-public class JAXBIntroDeploymentAspect extends DeploymentAspect
-{
- private static Logger logger = Logger.getLogger(JAXBIntroDeploymentAspect.class);
- private static final String META_INF_JAXB_INTROS_XML =
"META-INF/jaxb-intros.xml";
- private static final String WEB_INF_JAXB_INTROS_XML =
"WEB-INF/jaxb-intros.xml";
-
- public void start(Deployment deployment)
- {
- // assert ArchiveDeployment
- if(! (deployment instanceof ArchiveDeployment) )
- {
- if (log.isDebugEnabled())
- log.debug("JAXBIntroDeploymentAspect doesn't work on " +
deployment.getClass());
- return;
- }
-
- ArchiveDeployment archive = (ArchiveDeployment)deployment;
- InputStream introsConfigStream = null;
-
- try
- {
- // META-INF first
- UnifiedVirtualFile vfs =
archive.getRootFile().findChild(META_INF_JAXB_INTROS_XML);
- introsConfigStream = vfs.toURL().openStream();
- } catch (Exception e) {}
-
- if(null == introsConfigStream)
- {
- try
- {
- // WEB-INF second
- UnifiedVirtualFile vfs =
archive.getRootFile().findChild(WEB_INF_JAXB_INTROS_XML);
- introsConfigStream = vfs.toURL().openStream();
- } catch (Exception e) {
- return;
- }
- }
-
- try
- {
-
- if(introsConfigStream != null)
- {
- JaxbIntros jaxbIntros =
IntroductionsConfigParser.parseConfig(introsConfigStream);
- IntroductionsAnnotationReader annotationReader = new
IntroductionsAnnotationReader(jaxbIntros);
- String defaultNamespace = jaxbIntros.getDefaultNamespace();
- BindingCustomization jaxbCustomizations = new
org.jboss.wsf.stack.cxf.client.configuration.JAXBBindingCustomization();
-
- jaxbCustomizations.put(JAXBRIContext.ANNOTATION_READER, annotationReader);
- if(defaultNamespace != null) {
- jaxbCustomizations.put(JAXBRIContext.DEFAULT_NAMESPACE_REMAP,
defaultNamespace);
- }
-
- // JBossWSBeanConfigurer#configureService becomes the consumer later on
- for(Endpoint endpoint : deployment.getService().getEndpoints())
- {
- endpoint.addAttachment(BindingCustomization.class, jaxbCustomizations);
- }
-
- }
-
- }
- finally
- {
- if(introsConfigStream != null)
- {
- try {
- introsConfigStream.close();
- } catch (IOException e) {
- logger.error("[" + deployment.getService().getContextRoot() +
"] Error closing JAXB Introductions Configurations stream ", e);
- }
- }
- }
- }
-}
Modified: stack/cxf/trunk/modules/server/src/main/resources/jbossws-cxf-config.xml
===================================================================
--- stack/cxf/trunk/modules/server/src/main/resources/jbossws-cxf-config.xml 2009-10-08
09:23:42 UTC (rev 10860)
+++ stack/cxf/trunk/modules/server/src/main/resources/jbossws-cxf-config.xml 2009-10-08
09:26:12 UTC (rev 10861)
@@ -65,7 +65,7 @@
</property>
</bean>
- <bean name="WSCXFJAXBIntroDeploymentAspect"
class="org.jboss.wsf.stack.cxf.JAXBIntroDeploymentAspect">
+ <bean name="WSCXFJAXBIntroDeploymentAspect"
class="org.jboss.wsf.framework.deployment.JAXBIntroDeploymentAspect">
<property name="provides">JAXBIntros</property>
<property name="relativeOrder">20</property> <!--
[JBDEPLOY-201] workaround -->
</bean>
Modified:
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/jaxbintros/JAXBIntroTestCase.java
===================================================================
---
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/jaxbintros/JAXBIntroTestCase.java 2009-10-08
09:23:42 UTC (rev 10860)
+++
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/jaxbintros/JAXBIntroTestCase.java 2009-10-08
09:26:12 UTC (rev 10861)
@@ -32,19 +32,15 @@
import org.apache.cxf.Bus;
import org.apache.cxf.BusFactory;
import org.apache.cxf.configuration.Configurer;
-import org.jboss.jaxb.intros.IntroductionsAnnotationReader;
-import org.jboss.jaxb.intros.IntroductionsConfigParser;
-import org.jboss.jaxb.intros.configmodel.JaxbIntros;
+import org.jboss.jaxb.intros.BindingCustomizationFactory;
import org.jboss.wsf.common.DOMUtils;
import org.jboss.wsf.spi.binding.BindingCustomization;
-import org.jboss.wsf.stack.cxf.client.configuration.JAXBBindingCustomization;
+import org.jboss.wsf.spi.binding.JAXBBindingCustomization;
import org.jboss.wsf.stack.cxf.client.configuration.JBossWSCXFConfigurer;
import org.jboss.wsf.test.JBossWSTest;
import org.jboss.wsf.test.JBossWSTestSetup;
import org.w3c.dom.Element;
-import com.sun.xml.bind.api.JAXBRIContext;
-
/**
* Test the JAXBIntroduction features.
*
@@ -123,7 +119,6 @@
URL wsdlURL = new URL(endpointAddress + "?wsdl");
QName serviceName = new QName("http://org.jboss.ws/cxf/jaxbintros",
"EndpointBeanService");
- //setBindingCustomizationOnClientSide();
Service service = Service.create(wsdlURL, serviceName);
AnnotatedUserEndpoint port = service.getPort(AnnotatedUserEndpoint.class);
AnnotatedUserType user = new AnnotatedUserType();
@@ -142,15 +137,8 @@
*/
private void setBindingCustomizationOnClientSide() throws Exception
{
- JaxbIntros jaxbIntros =
IntroductionsConfigParser.parseConfig(getResourceURL("jaxws/cxf/jaxbintros/META-INF/jaxb-intros.xml").openStream());
- IntroductionsAnnotationReader annotationReader = new
IntroductionsAnnotationReader(jaxbIntros);
- String defaultNamespace = jaxbIntros.getDefaultNamespace();
BindingCustomization jaxbCustomizations = new JAXBBindingCustomization();
-
- jaxbCustomizations.put(JAXBRIContext.ANNOTATION_READER, annotationReader);
- if(defaultNamespace != null) {
- jaxbCustomizations.put(JAXBRIContext.DEFAULT_NAMESPACE_REMAP,
defaultNamespace);
- }
+
BindingCustomizationFactory.populateBindingCustomization(getResourceURL("jaxws/cxf/jaxbintros/META-INF/jaxb-intros.xml").openStream(),
jaxbCustomizations);
bus = BusFactory.getThreadDefaultBus();
originalConfigurer = bus.getExtension(Configurer.class);
Modified: stack/cxf/trunk/pom.xml
===================================================================
--- stack/cxf/trunk/pom.xml 2009-10-08 09:23:42 UTC (rev 10860)
+++ stack/cxf/trunk/pom.xml 2009-10-08 09:26:12 UTC (rev 10861)
@@ -62,7 +62,6 @@
<cxf.asm.version>2.2.3</cxf.asm.version>
<fastinfoset.api.version>1.2.7</fastinfoset.api.version>
<jboss.common.core.version>2.2.14.GA</jboss.common.core.version>
- <jboss.jaxbintros.version>1.0.0.GA</jboss.jaxbintros.version>
<jaxb.api.version>2.1</jaxb.api.version>
<jaxb.impl.version>2.1.12</jaxb.impl.version>
<jaxrpc.api.version>1.1</jaxrpc.api.version>
@@ -391,11 +390,6 @@
<version>${jaxb.impl.version}</version>
</dependency>
<dependency>
- <groupId>jboss.jaxbintros</groupId>
- <artifactId>jboss-jaxb-intros</artifactId>
- <version>${jboss.jaxbintros.version}</version>
- </dependency>
- <dependency>
<groupId>org.jboss.jaxr</groupId>
<artifactId>juddi-service</artifactId>
<version>${jboss.jaxr.version}</version>