Author: alessio.soldano(a)jboss.com
Date: 2009-10-08 05:28:27 -0400 (Thu, 08 Oct 2009)
New Revision: 10862
Removed:
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/jaxws/JAXBBindingCustomization.java
stack/native/trunk/modules/core/src/main/java/org/jboss/wsf/stack/jbws/JAXBIntroDeploymentAspect.java
Modified:
stack/native/trunk/modules/core/pom.xml
stack/native/trunk/modules/core/src/main/resources/jbossws-native-config.xml
stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jaxbcust/BindingCustomizationTestCase.java
stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jaxbintros/AnnotationReaderTestCase.java
stack/native/trunk/pom.xml
Log:
[JBWS-2714] Using JAXBIntroDeploymentAspect from framework, removing direct dependency on
jaxbintros and using the transitive one coming from jbossws-common, leveraging
BindingCustomizationFactory of jaxbintros
Modified: stack/native/trunk/modules/core/pom.xml
===================================================================
--- stack/native/trunk/modules/core/pom.xml 2009-10-08 09:26:12 UTC (rev 10861)
+++ stack/native/trunk/modules/core/pom.xml 2009-10-08 09:28:27 UTC (rev 10862)
@@ -154,10 +154,6 @@
<artifactId>mail</artifactId>
</dependency>
<dependency>
- <groupId>jboss.jaxbintros</groupId>
- <artifactId>jboss-jaxb-intros</artifactId>
- </dependency>
- <dependency>
<groupId>org.jboss.netty</groupId>
<artifactId>netty</artifactId>
</dependency>
Deleted:
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/jaxws/JAXBBindingCustomization.java
===================================================================
---
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/jaxws/JAXBBindingCustomization.java 2009-10-08
09:26:12 UTC (rev 10861)
+++
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/jaxws/JAXBBindingCustomization.java 2009-10-08
09:28:27 UTC (rev 10862)
@@ -1,44 +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.ws.core.jaxws;
-
-import com.sun.xml.bind.api.JAXBRIContext;
-
-/**
- * Supported JAXB 2.1 customizations.
- *
- * @see org.jboss.wsf.spi.deployment.Endpoint
- *
- * @author Heiko.Braun(a)jboss.com
- * Created: Jun 28, 2007
- */
-public class JAXBBindingCustomization extends
org.jboss.wsf.spi.binding.JAXBBindingCustomization
-{
- // 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;
-}
Deleted:
stack/native/trunk/modules/core/src/main/java/org/jboss/wsf/stack/jbws/JAXBIntroDeploymentAspect.java
===================================================================
---
stack/native/trunk/modules/core/src/main/java/org/jboss/wsf/stack/jbws/JAXBIntroDeploymentAspect.java 2009-10-08
09:26:12 UTC (rev 10861)
+++
stack/native/trunk/modules/core/src/main/java/org/jboss/wsf/stack/jbws/JAXBIntroDeploymentAspect.java 2009-10-08
09:28:27 UTC (rev 10862)
@@ -1,114 +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.jbws;
-
-import com.sun.xml.bind.api.JAXBRIContext;
-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.ws.core.jaxws.JAXBBindingCustomization;
-import org.jboss.wsf.spi.binding.BindingCustomization;
-import org.jboss.wsf.spi.deployment.*;
-
-import java.io.IOException;
-import java.io.InputStream;
-
-/**
- * @author Heiko.Braun(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 JAXBBindingCustomization();
-
- jaxbCustomizations.put(JAXBRIContext.ANNOTATION_READER, annotationReader);
- if(defaultNamespace != null) {
- jaxbCustomizations.put(JAXBRIContext.DEFAULT_NAMESPACE_REMAP,
defaultNamespace);
- }
-
- // ServerEndpointMetaData#getBindingCustomization 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/native/trunk/modules/core/src/main/resources/jbossws-native-config.xml
===================================================================
---
stack/native/trunk/modules/core/src/main/resources/jbossws-native-config.xml 2009-10-08
09:26:12 UTC (rev 10861)
+++
stack/native/trunk/modules/core/src/main/resources/jbossws-native-config.xml 2009-10-08
09:28:27 UTC (rev 10862)
@@ -86,7 +86,7 @@
<property name="relativeOrder">22</property> <!--
[JBDEPLOY-201] workaround -->
</bean>
- <bean name="WSJAXBIntroDeploymentAspect"
class="org.jboss.wsf.stack.jbws.JAXBIntroDeploymentAspect">
+ <bean name="WSJAXBIntroDeploymentAspect"
class="org.jboss.wsf.framework.deployment.JAXBIntroDeploymentAspect">
<property name="provides">JAXBIntros</property>
<property name="relativeOrder">21</property> <!--
[JBDEPLOY-201] workaround -->
</bean>
Modified:
stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jaxbcust/BindingCustomizationTestCase.java
===================================================================
---
stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jaxbcust/BindingCustomizationTestCase.java 2009-10-08
09:26:12 UTC (rev 10861)
+++
stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jaxbcust/BindingCustomizationTestCase.java 2009-10-08
09:28:27 UTC (rev 10862)
@@ -1,6 +1,6 @@
/*
* JBoss, Home of Professional Open Source.
- * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * 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.
*
@@ -23,10 +23,10 @@
import junit.framework.TestCase;
-import org.jboss.ws.core.jaxws.JAXBBindingCustomization;
import org.jboss.wsf.spi.SPIProvider;
import org.jboss.wsf.spi.SPIProviderResolver;
import org.jboss.wsf.spi.binding.BindingCustomization;
+import org.jboss.wsf.spi.binding.JAXBBindingCustomization;
import org.jboss.wsf.spi.deployment.DeploymentModelFactory;
import org.jboss.wsf.spi.deployment.Endpoint;
import org.jboss.wsf.spi.deployment.Endpoint.EndpointState;
@@ -50,8 +50,8 @@
public void testCustomizationWriteAccess() throws Exception
{
Endpoint endpoint = deploymentModelFactory.newEndpoint(null);
- JAXBBindingCustomization jaxbCustomization = new JAXBBindingCustomization();
- jaxbCustomization.put(JAXBBindingCustomization.DEFAULT_NAMESPACE_REMAP,
"http://org.jboss.bindingCustomization");
+ BindingCustomization jaxbCustomization = new JAXBBindingCustomization();
+ jaxbCustomization.put("com.sun.xml.bind.defaultNamespaceRemap",
"http://org.jboss.bindingCustomization");
endpoint.addAttachment(BindingCustomization.class, jaxbCustomization);
// a started endpoint should deny customizations
@@ -71,8 +71,8 @@
public void testCustomizationReadAccess() throws Exception
{
Endpoint endpoint = deploymentModelFactory.newEndpoint(null);
- JAXBBindingCustomization jaxbCustomization = new JAXBBindingCustomization();
- jaxbCustomization.put(JAXBBindingCustomization.DEFAULT_NAMESPACE_REMAP,
"http://org.jboss.bindingCustomization");
+ BindingCustomization jaxbCustomization = new JAXBBindingCustomization();
+ jaxbCustomization.put("com.sun.xml.bind.defaultNamespaceRemap",
"http://org.jboss.bindingCustomization");
endpoint.addAttachment(BindingCustomization.class, jaxbCustomization);
endpoint.setState(EndpointState.STARTED);
Modified:
stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jaxbintros/AnnotationReaderTestCase.java
===================================================================
---
stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jaxbintros/AnnotationReaderTestCase.java 2009-10-08
09:26:12 UTC (rev 10861)
+++
stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jaxbintros/AnnotationReaderTestCase.java 2009-10-08
09:28:27 UTC (rev 10862)
@@ -1,6 +1,6 @@
/*
* JBoss, Home of Professional Open Source.
- * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * 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.
*
@@ -23,7 +23,6 @@
import java.io.ByteArrayInputStream;
import java.io.FileInputStream;
-import java.util.HashMap;
import java.util.Map;
import javax.xml.bind.JAXBContext;
@@ -31,15 +30,12 @@
import javax.xml.bind.Unmarshaller;
import javax.xml.transform.stream.StreamSource;
-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.test.JBossWSTest;
-import com.sun.xml.bind.api.JAXBRIContext;
-
/**
* @author Heiko.Braun(a)jboss.com
+ * @author alessio.soldano(a)jboss.com
*/
public class AnnotationReaderTestCase extends JBossWSTest
{
@@ -50,14 +46,9 @@
" <qname>The Frog</qname>" +
" </ns1:user>";
- JaxbIntros config = IntroductionsConfigParser.parseConfig(new
FileInputStream(getResourceFile("jaxws/jaxbintros/WEB-INF/jaxb-intros.xml").getPath()));
-
- IntroductionsAnnotationReader reader = new IntroductionsAnnotationReader(config);
- Map<String, Object> jaxbConfig = new HashMap<String, Object>();
-
- jaxbConfig.put(JAXBRIContext.DEFAULT_NAMESPACE_REMAP,
"http://org.jboss.ws/provider");
- jaxbConfig.put(JAXBRIContext.ANNOTATION_READER, reader);
-
+ Map<String, Object> jaxbConfig =
BindingCustomizationFactory.getBindingCustomization(new FileInputStream(getResourceFile(
+ "jaxws/jaxbintros/WEB-INF/jaxb-intros.xml").getPath()),
"http://org.jboss.ws/provider");
+
JAXBContext jaxbContext = JAXBContext.newInstance(new Class[] { UserType.class },
jaxbConfig);
Unmarshaller unmarshaller = jaxbContext.createUnmarshaller();
Modified: stack/native/trunk/pom.xml
===================================================================
--- stack/native/trunk/pom.xml 2009-10-08 09:26:12 UTC (rev 10861)
+++ stack/native/trunk/pom.xml 2009-10-08 09:28:27 UTC (rev 10862)
@@ -68,7 +68,6 @@
<jaxb.api.version>2.1</jaxb.api.version>
<jaxb.impl.version>2.1.9</jaxb.impl.version>
<jboss.common.version>1.2.1.GA</jboss.common.version>
- <jboss.jaxbintros.version>1.0.0.GA</jboss.jaxbintros.version>
<jboss.logging.version>2.2.0.CR1</jboss.logging.version>
<jboss.jaxr.version>2.0.1</jboss.jaxr.version>
<apache.scout.version>1.1.1</apache.scout.version>
@@ -302,11 +301,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>