Author: alessio.soldano(a)jboss.com
Date: 2012-08-06 09:32:21 -0400 (Mon, 06 Aug 2012)
New Revision: 16572
Added:
spi/branches/jbossws-spi-2.0.x/src/main/resources/schema/jboss_web_services_1.2.xsd
Modified:
spi/branches/jbossws-spi-2.0.x/src/main/java/org/jboss/wsf/spi/metadata/ParserConstants.java
spi/branches/jbossws-spi-2.0.x/src/main/java/org/jboss/wsf/spi/metadata/webservices/JBossWebservicesFactory.java
spi/branches/jbossws-spi-2.0.x/src/main/java/org/jboss/wsf/spi/metadata/webservices/JBossWebservicesMetaData.java
Log:
[JBPAPP-9649] svn merge -r 16313:16314
https://svn.jboss.org/repos/jbossws/spi/trunk .
Modified:
spi/branches/jbossws-spi-2.0.x/src/main/java/org/jboss/wsf/spi/metadata/ParserConstants.java
===================================================================
---
spi/branches/jbossws-spi-2.0.x/src/main/java/org/jboss/wsf/spi/metadata/ParserConstants.java 2012-08-06
13:26:14 UTC (rev 16571)
+++
spi/branches/jbossws-spi-2.0.x/src/main/java/org/jboss/wsf/spi/metadata/ParserConstants.java 2012-08-06
13:32:21 UTC (rev 16572)
@@ -143,6 +143,10 @@
public static final String PROPERTY_VALUE = "property-value";
+ public static final String NAME = "name";
+
+ public static final String VALUE = "value";
+
public static final String SECURE_WSDL_ACCESS = "secure-wsdl-access";
public static final String TRANSPORT_GUARANTEE = "transport-guarantee";
Modified:
spi/branches/jbossws-spi-2.0.x/src/main/java/org/jboss/wsf/spi/metadata/webservices/JBossWebservicesFactory.java
===================================================================
---
spi/branches/jbossws-spi-2.0.x/src/main/java/org/jboss/wsf/spi/metadata/webservices/JBossWebservicesFactory.java 2012-08-06
13:26:14 UTC (rev 16571)
+++
spi/branches/jbossws-spi-2.0.x/src/main/java/org/jboss/wsf/spi/metadata/webservices/JBossWebservicesFactory.java 2012-08-06
13:32:21 UTC (rev 16572)
@@ -33,6 +33,9 @@
import static org.jboss.wsf.spi.metadata.ParserConstants.PORT_COMPONENT;
import static org.jboss.wsf.spi.metadata.ParserConstants.PORT_COMPONENT_NAME;
import static org.jboss.wsf.spi.metadata.ParserConstants.PORT_COMPONENT_URI;
+import static org.jboss.wsf.spi.metadata.ParserConstants.PROPERTY;
+import static org.jboss.wsf.spi.metadata.ParserConstants.NAME;
+import static org.jboss.wsf.spi.metadata.ParserConstants.VALUE;
import static org.jboss.wsf.spi.metadata.ParserConstants.SECURE_WSDL_ACCESS;
import static org.jboss.wsf.spi.metadata.ParserConstants.TRANSPORT_GUARANTEE;
import static org.jboss.wsf.spi.metadata.ParserConstants.WEBSERVICES;
@@ -59,6 +62,7 @@
/**
* @author <a href="mailto:ropalka@redhat.com">Richard Opalka</a>
+ * @author <a href="mailto:alessio.soldano@jboss.com">Alessio
Soldano</a>
*/
public class JBossWebservicesFactory {
@@ -192,6 +196,8 @@
metadata.setConfigName(elementAsString(reader));
} else if (match(reader, nsUri, CONFIG_FILE)) {
metadata.setConfigFile(elementAsString(reader));
+ } else if (match(reader, nsUri, PROPERTY)) {
+ parseProperty(reader, nsUri, metadata);
} else if (match(reader, nsUri, PORT_COMPONENT)) {
metadata.addPortComponent(parsePortComponent(reader, nsUri));
} else if (match(reader, nsUri, WEBSERVICE_DESCRIPTION)) {
@@ -268,5 +274,45 @@
}
throw new IllegalStateException(BundleUtils.getMessage(bundle,
"REACHED_END_OF_XML_DOCUMENT_UNEXPECTEDLY"));
}
+
+ private void parseProperty(XMLStreamReader reader, String nsUri,
JBossWebservicesMetaData metadata) throws XMLStreamException
+ {
+ String name = null;
+ String value = null;
+ while (reader.hasNext())
+ {
+ switch (reader.nextTag())
+ {
+ case XMLStreamConstants.END_ELEMENT : {
+ if (match(reader, nsUri, PROPERTY))
+ {
+ if (name == null)
+ {
+ throw new IllegalStateException(BundleUtils.getMessage(bundle,
"COULD_NOT_GET_PROPERTY_NAME"));
+ }
+ metadata.setProperty(name, value);
+ return;
+ }
+ else
+ {
+ throw new IllegalStateException(BundleUtils.getMessage(bundle,
"UNEXPECTED_END_TAG", reader.getLocalName()));
+ }
+ }
+ case XMLStreamConstants.START_ELEMENT : {
+ if (match(reader, nsUri, NAME)) {
+ name = elementAsString(reader);
+ }
+ else if (match(reader, nsUri, VALUE)) {
+ value = elementAsString(reader);
+ }
+ else
+ {
+ throw new IllegalStateException(BundleUtils.getMessage(bundle,
"UNEXPECTED_ELEMENT", reader.getLocalName()));
+ }
+ }
+ }
+ }
+ throw new IllegalStateException(BundleUtils.getMessage(bundle,
"REACHED_END_OF_XML_DOCUMENT_UNEXPECTEDLY"));
+ }
}
Modified:
spi/branches/jbossws-spi-2.0.x/src/main/java/org/jboss/wsf/spi/metadata/webservices/JBossWebservicesMetaData.java
===================================================================
---
spi/branches/jbossws-spi-2.0.x/src/main/java/org/jboss/wsf/spi/metadata/webservices/JBossWebservicesMetaData.java 2012-08-06
13:26:14 UTC (rev 16571)
+++
spi/branches/jbossws-spi-2.0.x/src/main/java/org/jboss/wsf/spi/metadata/webservices/JBossWebservicesMetaData.java 2012-08-06
13:32:21 UTC (rev 16572)
@@ -23,8 +23,10 @@
package org.jboss.wsf.spi.metadata.webservices;
import java.net.URL;
+import java.util.HashMap;
import java.util.LinkedList;
import java.util.List;
+import java.util.Map;
/**
* @author <a href="mailto:ropalka@redhat.com">Richard Opalka</a>
@@ -36,6 +38,8 @@
private String configName;
private String configFile;
+
+ private Map<String, String> properties = new HashMap<String, String>();
private List<JBossPortComponentMetaData> portComponents = new
LinkedList<JBossPortComponentMetaData>();
@@ -94,5 +98,17 @@
webserviceDescriptions.toArray(array);
return array;
}
+
+ public void setProperty(String name, String value) {
+ properties.put(name, value);
+ }
+ public String getProperty(String name) {
+ return properties.get(name);
+ }
+
+ public Map<String, String> getProperties() {
+ return properties;
+ }
+
}
Copied:
spi/branches/jbossws-spi-2.0.x/src/main/resources/schema/jboss_web_services_1.2.xsd (from
rev 16314, spi/trunk/src/main/resources/schema/jboss_web_services_1.2.xsd)
===================================================================
--- spi/branches/jbossws-spi-2.0.x/src/main/resources/schema/jboss_web_services_1.2.xsd
(rev 0)
+++
spi/branches/jbossws-spi-2.0.x/src/main/resources/schema/jboss_web_services_1.2.xsd 2012-08-06
13:32:21 UTC (rev 16572)
@@ -0,0 +1,49 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xsd:schema
+
targetNamespace="http://www.jboss.com/xml/ns/javaee"
+
xmlns:jboss="http://www.jboss.com/xml/ns/javaee"
+
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+ elementFormDefault="qualified"
+ attributeFormDefault="unqualified"
+ version="1.2">
+
+ <xsd:element name="webservices"
type="jboss:webservicesType"/>
+
+ <xsd:complexType name="webservicesType">
+ <xsd:sequence>
+ <xsd:element name="context-root" type="xsd:token"
minOccurs="0"/>
+ <xsd:element name="config-name" type="xsd:token"
minOccurs="0"/>
+ <xsd:element name="config-file" type="xsd:token"
minOccurs="0"/>
+ <xsd:element name="property"
type="jboss:webservicePropertyType" minOccurs="0"
maxOccurs="unbounded"/>
+ <xsd:element name="port-component"
type="jboss:portComponentType" minOccurs="0"
maxOccurs="unbounded"/>
+ <xsd:element name="webservice-description"
type="jboss:webserviceDescriptionType" minOccurs="0"
maxOccurs="unbounded"/>
+ </xsd:sequence>
+ </xsd:complexType>
+
+ <xsd:complexType name="portComponentType">
+ <xsd:sequence>
+ <xsd:element name="ejb-name" type="xsd:token"/>
+ <xsd:element name="port-component-name"
type="xsd:token"/>
+ <xsd:element name="port-component-uri" type="xsd:token"
minOccurs="0"/>
+ <xsd:element name="auth-method" type="xsd:token"
minOccurs="0"/>
+ <xsd:element name="transport-guarantee" type="xsd:token"
minOccurs="0"/>
+ <xsd:element name="secure-wsdl-access" type="xsd:boolean"
minOccurs="0"/>
+ </xsd:sequence>
+ </xsd:complexType>
+
+ <xsd:complexType name="webserviceDescriptionType">
+ <xsd:sequence>
+ <xsd:element name="webservice-description-name"
type="xsd:token"/>
+ <xsd:element name="wsdl-publish-location" type="xsd:token"
minOccurs="0"/>
+ <xsd:element name="port-component"
type="jboss:portComponentType" minOccurs="1"
maxOccurs="unbounded"/>
+ </xsd:sequence>
+ </xsd:complexType>
+
+ <xsd:complexType name="webservicePropertyType">
+ <xsd:sequence>
+ <xsd:element name="name" type="xsd:string"/>
+ <xsd:element name="value" type="xsd:string"/>
+ </xsd:sequence>
+ </xsd:complexType>
+
+</xsd:schema>