Author: alessio.soldano(a)jboss.com
Date: 2010-12-02 06:08:29 -0500 (Thu, 02 Dec 2010)
New Revision: 13378
Added:
stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/deployment/jms/JMSDescriptorParserImpl.java
Modified:
stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/deployment/jms/JMSDescriptorProcessorImpl.java
stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/deployment/jms/JMSEndpointsFactory.java
stack/cxf/trunk/modules/server/src/main/resources/jbossws-cxf-config-as6.xml
Log:
[JBWS-3169] Adding stax based jms descriptor parser, updating JMSEndpointFactory
accordingly, temporarly adding the DescriptorParser declarations to stack-specific beans
xml to avoid creating a AS IL project just for this (given AS7 will be the only supported
target container of JBWS 4)
Added:
stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/deployment/jms/JMSDescriptorParserImpl.java
===================================================================
---
stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/deployment/jms/JMSDescriptorParserImpl.java
(rev 0)
+++
stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/deployment/jms/JMSDescriptorParserImpl.java 2010-12-02
11:08:29 UTC (rev 13378)
@@ -0,0 +1,58 @@
+/*
+ * 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.deployment.jms;
+
+import java.net.URL;
+
+import org.jboss.wsf.spi.metadata.jms.JMSDescriptorParser;
+import org.jboss.wsf.spi.metadata.jms.JMSEndpointsMetaData;
+
+/**
+ * JMS descriptor processor implementation.
+ *
+ * @author <a href="ropalka(a)redhat.com">Richard Opalka</a>
+ */
+public final class JMSDescriptorParserImpl implements JMSDescriptorParser
+{
+ private String descriptorName;
+
+ @Override
+ public String getDescriptorName()
+ {
+ return this.descriptorName;
+ }
+
+ /**
+ * Invoked via MC.
+ * @param descriptorName
+ */
+ public void setDescriptorName(final String descriptorName)
+ {
+ this.descriptorName = descriptorName;
+ }
+
+ @Override
+ public JMSEndpointsMetaData parse(URL url)
+ {
+ return JMSEndpointsFactory.load(url);
+ }
+}
Modified:
stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/deployment/jms/JMSDescriptorProcessorImpl.java
===================================================================
---
stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/deployment/jms/JMSDescriptorProcessorImpl.java 2010-12-02
10:46:43 UTC (rev 13377)
+++
stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/deployment/jms/JMSDescriptorProcessorImpl.java 2010-12-02
11:08:29 UTC (rev 13378)
@@ -31,6 +31,7 @@
*
* @author <a href="ropalka(a)redhat.com">Richard Opalka</a>
*/
+@Deprecated
public final class JMSDescriptorProcessorImpl implements JMSDescriptorProcessor
{
private String descriptorName;
@@ -57,7 +58,6 @@
/* (non-Javadoc)
* @see org.jboss.wsf.spi.metadata.DescriptorProcessor#getFactory(java.net.URL)
*/
- @Override
public ObjectModelFactory getFactory(final URL url)
{
if (url == null)
Modified:
stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/deployment/jms/JMSEndpointsFactory.java
===================================================================
---
stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/deployment/jms/JMSEndpointsFactory.java 2010-12-02
10:46:43 UTC (rev 13377)
+++
stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/deployment/jms/JMSEndpointsFactory.java 2010-12-02
11:08:29 UTC (rev 13378)
@@ -21,11 +21,16 @@
*/
package org.jboss.wsf.stack.cxf.deployment.jms;
+import java.io.InputStream;
import java.net.URL;
+import javax.xml.ws.WebServiceException;
+
import org.jboss.wsf.spi.metadata.jms.JMSEndpointMetaData;
import org.jboss.wsf.spi.metadata.jms.JMSEndpointsMetaData;
import org.jboss.xb.binding.ObjectModelFactory;
+import org.jboss.xb.binding.Unmarshaller;
+import org.jboss.xb.binding.UnmarshallerFactory;
import org.jboss.xb.binding.UnmarshallingContext;
import org.xml.sax.Attributes;
@@ -42,6 +47,35 @@
{
this.descriptorURL = descriptorURL;
}
+
+ public static JMSEndpointsMetaData load(URL url)
+ {
+ InputStream is = null;
+ try
+ {
+ is = url.openStream();
+ Unmarshaller unmarshaller =
UnmarshallerFactory.newInstance().newUnmarshaller();
+ ObjectModelFactory factory = new JMSEndpointsFactory(url);
+ return (JMSEndpointsMetaData) unmarshaller.unmarshal(is, factory, null);
+ }
+ catch (Exception e)
+ {
+ throw new WebServiceException(e);
+ }
+ finally
+ {
+ if (is != null)
+ {
+ try
+ {
+ is.close();
+ }
+ catch (Exception e)
+ {
+ } //ignore
+ }
+ }
+ }
/**
* This method is called on the factory by the object model builder when the parsing
starts.
Modified: stack/cxf/trunk/modules/server/src/main/resources/jbossws-cxf-config-as6.xml
===================================================================
---
stack/cxf/trunk/modules/server/src/main/resources/jbossws-cxf-config-as6.xml 2010-12-02
10:46:43 UTC (rev 13377)
+++
stack/cxf/trunk/modules/server/src/main/resources/jbossws-cxf-config-as6.xml 2010-12-02
11:08:29 UTC (rev 13378)
@@ -19,11 +19,15 @@
</property>
</bean>
- <bean name="CXFJMSDescriptorProcessor"
class="org.jboss.wsf.stack.cxf.deployment.jms.JMSDescriptorProcessorImpl">
- <property name="validating">false</property>
+ <!-- This should actually be in the stack-agnostic config file, it's here to
avoid installing a CI -->
+ <bean name="WSDescriptorParser"
class="org.jboss.wsf.framework.deployment.WebservicesDescriptorParserImpl">
+ <property name="descriptorName">webservices.xml</property>
+ </bean>
+
+ <bean name="CXFJMSDescriptorParser"
class="org.jboss.wsf.stack.cxf.deployment.jms.JMSDescriptorParserImpl">
<property name="descriptorName">jbossws-cxf.xml</property>
</bean>
-
+
<!-- Installed Record Processors-->
<bean name="WSMemoryBufferRecorder"
class="org.jboss.wsf.framework.management.recording.MemoryBufferRecorder">
<property name="recording">false</property>