Author: richard.opalka(a)jboss.com
Date: 2011-11-07 08:56:33 -0500 (Mon, 07 Nov 2011)
New Revision: 15199
Added:
spi/trunk/src/main/java/org/jboss/wsf/spi/metadata/webservices/JBossPortComponentMetaData.java
spi/trunk/src/main/java/org/jboss/wsf/spi/metadata/webservices/JBossWebserviceDescriptionMetaData.java
Modified:
spi/trunk/src/main/java/org/jboss/wsf/spi/metadata/ParserConstants.java
spi/trunk/src/main/java/org/jboss/wsf/spi/metadata/webservices/JBossWebservicesDescriptorParser.java
spi/trunk/src/main/java/org/jboss/wsf/spi/metadata/webservices/JBossWebservicesFactory.java
spi/trunk/src/main/java/org/jboss/wsf/spi/metadata/webservices/JBossWebservicesMetaData.java
spi/trunk/src/main/java/org/jboss/wsf/spi/metadata/webservices/PortComponentMetaData.java
spi/trunk/src/main/java/org/jboss/wsf/spi/metadata/webservices/WebserviceDescriptionMetaData.java
spi/trunk/src/main/java/org/jboss/wsf/spi/metadata/webservices/WebservicesFactory.java
Log:
[JBWS-3376] refactoring jboss-webservices.xml file format
Modified: spi/trunk/src/main/java/org/jboss/wsf/spi/metadata/ParserConstants.java
===================================================================
--- spi/trunk/src/main/java/org/jboss/wsf/spi/metadata/ParserConstants.java 2011-11-07
13:39:04 UTC (rev 15198)
+++ spi/trunk/src/main/java/org/jboss/wsf/spi/metadata/ParserConstants.java 2011-11-07
13:56:33 UTC (rev 15199)
@@ -45,6 +45,8 @@
public static final String CHAIN_SERVICE_PATTERN = "service-name-pattern";
+ public static final String EJB_NAME = "ejb-name";
+
public static final String HANDLER_CHAIN = "handler-chain";
public static final String HANDLER_CHAINS = "handler-chains";
Added:
spi/trunk/src/main/java/org/jboss/wsf/spi/metadata/webservices/JBossPortComponentMetaData.java
===================================================================
---
spi/trunk/src/main/java/org/jboss/wsf/spi/metadata/webservices/JBossPortComponentMetaData.java
(rev 0)
+++
spi/trunk/src/main/java/org/jboss/wsf/spi/metadata/webservices/JBossPortComponentMetaData.java 2011-11-07
13:56:33 UTC (rev 15199)
@@ -0,0 +1,85 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2011, Red Hat, Inc., 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.spi.metadata.webservices;
+
+/**
+ * @author <a href="mailto:ropalka@redhat.com">Richard Opalka</a>
+ */
+public final class JBossPortComponentMetaData {
+
+ private String ejbName;
+ private String portComponentName;
+ private String portComponentURI;
+ private String authMethod;
+ private String transportGuarantee;
+ private Boolean secureWSDLAccess;
+
+ public void setEjbName(String ejbName) {
+ this.ejbName = ejbName;
+ }
+
+ public String getEjbName() {
+ return ejbName;
+ }
+
+ public void setPortComponentName(String portComponentName) {
+ this.portComponentName = portComponentName;
+ }
+
+ public String getPortComponentName() {
+ return portComponentName;
+ }
+
+ public void setPortComponentURI(String portComponentURI) {
+ this.portComponentURI = portComponentURI;
+ }
+
+ public String getPortComponentURI() {
+ return portComponentURI;
+ }
+
+ public void setAuthMethod(String authMethod) {
+ this.authMethod = authMethod;
+ }
+
+ public String getAuthMethod() {
+ return authMethod;
+ }
+
+ public void setTransportGuarantee(String transportGuarantee) {
+ this.transportGuarantee = transportGuarantee;
+ }
+
+ public String getTransportGuarantee() {
+ return transportGuarantee;
+ }
+
+ public void setSecureWSDLAccess(Boolean secureWSDLAccess) {
+ this.secureWSDLAccess = secureWSDLAccess;
+ }
+
+ public Boolean getSecureWSDLAccess() {
+ return secureWSDLAccess;
+ }
+
+}
Added:
spi/trunk/src/main/java/org/jboss/wsf/spi/metadata/webservices/JBossWebserviceDescriptionMetaData.java
===================================================================
---
spi/trunk/src/main/java/org/jboss/wsf/spi/metadata/webservices/JBossWebserviceDescriptionMetaData.java
(rev 0)
+++
spi/trunk/src/main/java/org/jboss/wsf/spi/metadata/webservices/JBossWebserviceDescriptionMetaData.java 2011-11-07
13:56:33 UTC (rev 15199)
@@ -0,0 +1,49 @@
+/*
+ * 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.spi.metadata.webservices;
+
+/**
+ * @author <a href="mailto:ropalka@redhat.com">Richard Opalka</a>
+ */
+public final class JBossWebserviceDescriptionMetaData {
+
+ private String webserviceDescriptionName;
+ private String wsdlPublishLocation;
+
+ public void setWsdlPublishLocation(final String wsdlPublishLocation) {
+ this.wsdlPublishLocation = wsdlPublishLocation;
+ }
+
+ public String getWsdlPublishLocation() {
+ return wsdlPublishLocation;
+ }
+
+ public void setWebserviceDescriptionName(final String webserviceDescriptionName) {
+ this.webserviceDescriptionName = webserviceDescriptionName;
+ }
+
+ public String getWebserviceDescriptionName() {
+ return webserviceDescriptionName;
+ }
+
+}
Modified:
spi/trunk/src/main/java/org/jboss/wsf/spi/metadata/webservices/JBossWebservicesDescriptorParser.java
===================================================================
---
spi/trunk/src/main/java/org/jboss/wsf/spi/metadata/webservices/JBossWebservicesDescriptorParser.java 2011-11-07
13:39:04 UTC (rev 15198)
+++
spi/trunk/src/main/java/org/jboss/wsf/spi/metadata/webservices/JBossWebservicesDescriptorParser.java 2011-11-07
13:56:33 UTC (rev 15199)
@@ -1,6 +1,6 @@
/*
* JBoss, Home of Professional Open Source.
- * Copyright 2010, Red Hat Middleware LLC, and individual contributors
+ * Copyright 2011, 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.
*
@@ -19,15 +19,13 @@
* 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.spi.metadata.webservices;
import org.jboss.wsf.spi.metadata.DescriptorParser;
/**
- * Parser for WS UMDM.
- *
* @author <a href="mailto:ropalka@redhat.com">Richard Opalka</a>
*/
-public interface JBossWebservicesDescriptorParser extends
DescriptorParser<JBossWebservicesMetaData>
-{
+public interface JBossWebservicesDescriptorParser extends
DescriptorParser<JBossWebservicesMetaData> {
}
Modified:
spi/trunk/src/main/java/org/jboss/wsf/spi/metadata/webservices/JBossWebservicesFactory.java
===================================================================
---
spi/trunk/src/main/java/org/jboss/wsf/spi/metadata/webservices/JBossWebservicesFactory.java 2011-11-07
13:39:04 UTC (rev 15198)
+++
spi/trunk/src/main/java/org/jboss/wsf/spi/metadata/webservices/JBossWebservicesFactory.java 2011-11-07
13:56:33 UTC (rev 15199)
@@ -19,16 +19,27 @@
* 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.spi.metadata.webservices;
import static javax.xml.stream.XMLStreamConstants.END_ELEMENT;
import static javax.xml.stream.XMLStreamConstants.START_ELEMENT;
+import static org.jboss.wsf.spi.metadata.ParserConstants.AUTH_METHOD;
import static org.jboss.wsf.spi.metadata.ParserConstants.CONFIG_FILE;
import static org.jboss.wsf.spi.metadata.ParserConstants.CONFIG_NAME;
import static org.jboss.wsf.spi.metadata.ParserConstants.CONTEXT_ROOT;
+import static org.jboss.wsf.spi.metadata.ParserConstants.EJB_NAME;
import static org.jboss.wsf.spi.metadata.ParserConstants.JBOSSEE_NS;
+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.SECURE_WSDL_ACCESS;
+import static org.jboss.wsf.spi.metadata.ParserConstants.TRANSPORT_GUARANTEE;
import static org.jboss.wsf.spi.metadata.ParserConstants.WEBSERVICES;
import static org.jboss.wsf.spi.metadata.ParserConstants.WEBSERVICE_DESCRIPTION;
+import static org.jboss.wsf.spi.metadata.ParserConstants.WEBSERVICE_DESCRIPTION_NAME;
+import static org.jboss.wsf.spi.metadata.ParserConstants.WSDL_PUBLISH_LOCATION;
+import static org.jboss.wsf.spi.util.StAXUtils.elementAsBoolean;
import static org.jboss.wsf.spi.util.StAXUtils.elementAsString;
import static org.jboss.wsf.spi.util.StAXUtils.match;
@@ -47,182 +58,215 @@
import org.jboss.wsf.spi.util.StAXUtils;
/**
- * A JBossXB factory for {@link JBossWebservicesMetaData}
- *
* @author <a href="mailto:ropalka@redhat.com">Richard Opalka</a>
*/
-public class JBossWebservicesFactory extends WebservicesFactory
-{
- private static final ResourceBundle bundle =
BundleUtils.getBundle(JBossWebservicesFactory.class);
-
- public JBossWebservicesFactory(URL descriptorURL)
- {
- super(descriptorURL);
- }
+public class JBossWebservicesFactory {
- /**
- * Load jboss-webservices.xml from
<code>META-INF/jboss-webservices.xml</code>
- * or <code>WEB-INF/jboss-webservices.xml</code>.
- *
- * @param root virtual file root
- * @return JBossWebservicesMetaData or <code>null</code> if it cannot be
found
- */
- public static JBossWebservicesMetaData loadFromVFSRoot(UnifiedVirtualFile root)
- {
- JBossWebservicesMetaData webservices = null;
+ private static final ResourceBundle bundle =
BundleUtils.getBundle(JBossWebservicesFactory.class);
- UnifiedVirtualFile wsdd = null;
- try
- {
- wsdd = root.findChild("META-INF/jboss-webservices.xml");
- }
- catch (IOException e)
- {
- //
- }
+ // The URL to the jboss-webservices.xml descriptor
+ private URL descriptorURL;
- // Maybe a web application deployment?
- if (null == wsdd)
- {
- try
- {
- wsdd = root.findChild("WEB-INF/jboss-webservices.xml");
- }
- catch (IOException e)
- {
+ public JBossWebservicesFactory(final URL descriptorURL) {
+ this.descriptorURL = descriptorURL;
+ }
+
+ public URL getDescriptorURL() {
+ return descriptorURL;
+ }
+
+ /**
+ * Load jboss-webservices.xml from
<code>META-INF/jboss-webservices.xml</code> or
<code>WEB-INF/jboss-webservices.xml</code>
+ * .
+ *
+ * @param root virtual file root
+ * @return JBossWebservicesMetaData or <code>null</code> if it cannot be
found
+ */
+ public static JBossWebservicesMetaData loadFromVFSRoot(final UnifiedVirtualFile root)
{
+ JBossWebservicesMetaData webservices = null;
+
+ UnifiedVirtualFile wsdd = null;
+ try {
+ wsdd = root.findChild("META-INF/jboss-webservices.xml");
+ } catch (IOException e) {
//
- }
- }
+ }
- // the descriptor is optional
- if (wsdd != null)
- {
- return load(wsdd.toURL());
- }
+ // Maybe a web application deployment?
+ if (null == wsdd) {
+ try {
+ wsdd = root.findChild("WEB-INF/jboss-webservices.xml");
+ } catch (IOException e) {
+ //
+ }
+ }
- return webservices;
- }
-
- public static JBossWebservicesMetaData load(URL wsddUrl)
- {
- InputStream is = null;
- try
- {
- is = wsddUrl.openStream();
- XMLStreamReader xmlr = StAXUtils.createXMLStreamReader(is);
- return parse(xmlr, wsddUrl);
- }
- catch (Exception e)
- {
- throw new WebServiceException(BundleUtils.getMessage(bundle,
"FAILED_TO_UNMARSHALL", wsddUrl), e);
- }
- finally
- {
- try
- {
- if (is != null) is.close();
- }
- catch (IOException e) {} //ignore
- }
- }
-
- public static JBossWebservicesMetaData parse(InputStream is)
- {
- return parse(is, null);
- }
-
- public static JBossWebservicesMetaData parse(InputStream is, URL descriptorURL)
- {
- try
- {
- XMLStreamReader xmlr = StAXUtils.createXMLStreamReader(is);
- return parse(xmlr, descriptorURL);
- }
- catch (Exception e)
- {
- throw new WebServiceException(e);
- }
- }
-
- public static JBossWebservicesMetaData parse(XMLStreamReader reader) throws
XMLStreamException
- {
- return parse(reader, null);
- }
-
- private static JBossWebservicesMetaData parse(XMLStreamReader reader, URL
descriptorURL) throws XMLStreamException
- {
- int iterate;
- try
- {
- iterate = reader.nextTag();
- }
- catch (XMLStreamException e)
- {
- // skip non-tag elements
- iterate = reader.nextTag();
- }
- JBossWebservicesMetaData metadata = null;
- switch (iterate)
- {
- case END_ELEMENT : {
- // we're done
- break;
- }
- case START_ELEMENT : {
+ // the descriptor is optional
+ if (wsdd != null) {
+ return load(wsdd.toURL());
+ }
- if (match(reader, JBOSSEE_NS, WEBSERVICES))
- {
- String nsUri = reader.getNamespaceURI();
- JBossWebservicesFactory factory = new
JBossWebservicesFactory(descriptorURL);
- metadata = factory.parseWebservices(reader, nsUri, descriptorURL);
+ return webservices;
+ }
+
+ public static JBossWebservicesMetaData load(final URL wsddUrl) {
+ InputStream is = null;
+ try {
+ is = wsddUrl.openStream();
+ XMLStreamReader xmlr = StAXUtils.createXMLStreamReader(is);
+ return parse(xmlr, wsddUrl);
+ } catch (Exception e) {
+ throw new WebServiceException(BundleUtils.getMessage(bundle,
"FAILED_TO_UNMARSHALL", wsddUrl), e);
+ } finally {
+ try {
+ if (is != null)
+ is.close();
+ } catch (IOException e) {
+ } // ignore
+ }
+ }
+
+ public static JBossWebservicesMetaData parse(final InputStream is) {
+ return parse(is, null);
+ }
+
+ public static JBossWebservicesMetaData parse(final InputStream is, final URL
descriptorURL) {
+ try {
+ final XMLStreamReader xmlr = StAXUtils.createXMLStreamReader(is);
+ return parse(xmlr, descriptorURL);
+ } catch (Exception e) {
+ throw new WebServiceException(e);
+ }
+ }
+
+ public static JBossWebservicesMetaData parse(final XMLStreamReader reader) throws
XMLStreamException {
+ return parse(reader, null);
+ }
+
+ private static JBossWebservicesMetaData parse(final XMLStreamReader reader, final URL
descriptorURL)
+ throws XMLStreamException {
+ int iterate;
+ try {
+ iterate = reader.nextTag();
+ } catch (XMLStreamException e) {
+ // skip non-tag elements
+ iterate = reader.nextTag();
+ }
+ JBossWebservicesMetaData metadata = null;
+ switch (iterate) {
+ case END_ELEMENT: {
+ // we're done
+ break;
}
- else
- {
- throw new IllegalStateException(BundleUtils.getMessage(bundle,
"UNEXPECTED_ELEMENT", reader.getLocalName()));
+ case START_ELEMENT: {
+
+ if (match(reader, JBOSSEE_NS, WEBSERVICES)) {
+ String nsUri = reader.getNamespaceURI();
+ JBossWebservicesFactory factory = new
JBossWebservicesFactory(descriptorURL);
+ metadata = factory.parseWebservices(reader, nsUri, descriptorURL);
+ } else {
+ throw new IllegalStateException(BundleUtils.getMessage(bundle,
"UNEXPECTED_ELEMENT", reader.getLocalName()));
+ }
}
- }
- }
- return metadata;
- }
-
- private JBossWebservicesMetaData parseWebservices(XMLStreamReader reader, String
nsUri, URL descriptorURL) throws XMLStreamException
- {
- JBossWebservicesMetaData metadata = new JBossWebservicesMetaData(descriptorURL);
- while (reader.hasNext())
- {
- switch (reader.nextTag())
- {
- case XMLStreamConstants.END_ELEMENT : {
- if (match(reader, nsUri, WEBSERVICES))
- {
- return metadata;
- }
- else
- {
- throw new IllegalStateException(BundleUtils.getMessage(bundle,
"UNEXPECTED_END_TAG", reader.getLocalName()));
- }
+ }
+ return metadata;
+ }
+
+ private JBossWebservicesMetaData parseWebservices(final XMLStreamReader reader, final
String nsUri, final URL descriptorURL)
+ throws XMLStreamException {
+ JBossWebservicesMetaData metadata = new JBossWebservicesMetaData(descriptorURL);
+ while (reader.hasNext()) {
+ switch (reader.nextTag()) {
+ case XMLStreamConstants.END_ELEMENT: {
+ if (match(reader, nsUri, WEBSERVICES)) {
+ return metadata;
+ } else {
+ throw new IllegalStateException(BundleUtils.getMessage(bundle,
"UNEXPECTED_END_TAG",
+ reader.getLocalName()));
+ }
+ }
+ case XMLStreamConstants.START_ELEMENT: {
+ if (match(reader, nsUri, CONTEXT_ROOT)) {
+ metadata.setContextRoot(elementAsString(reader));
+ } else if (match(reader, nsUri, CONFIG_NAME)) {
+ metadata.setConfigName(elementAsString(reader));
+ } else if (match(reader, nsUri, CONFIG_FILE)) {
+ metadata.setConfigFile(elementAsString(reader));
+ } else if (match(reader, nsUri, PORT_COMPONENT)) {
+ metadata.addPortComponent(parsePortComponent(reader, nsUri));
+ } else if (match(reader, nsUri, WEBSERVICE_DESCRIPTION)) {
+
metadata.addWebserviceDescription(parseWebserviceDescription(reader, nsUri));
+ } else {
+ throw new IllegalStateException(BundleUtils.getMessage(bundle,
"UNEXPECTED_ELEMENT",
+ reader.getLocalName()));
+ }
+ }
}
- case XMLStreamConstants.START_ELEMENT : {
- if (match(reader, nsUri, CONTEXT_ROOT)) {
- metadata.setContextRoot(elementAsString(reader));
- }
- else if (match(reader, nsUri, CONFIG_NAME)) {
- metadata.setConfigName(elementAsString(reader));
- }
- else if (match(reader, nsUri, CONFIG_FILE)) {
- metadata.setConfigFile(elementAsString(reader));
- }
- else if (match(reader, nsUri, WEBSERVICE_DESCRIPTION)) {
-
metadata.addWebserviceDescription(super.parseWebserviceDescription(reader, nsUri,
metadata));
- }
- else
- {
- throw new IllegalStateException(BundleUtils.getMessage(bundle,
"UNEXPECTED_ELEMENT", reader.getLocalName()));
- }
+ }
+ throw new IllegalStateException(BundleUtils.getMessage(bundle,
"REACHED_END_OF_XML_DOCUMENT_UNEXPECTEDLY"));
+ }
+
+ private JBossPortComponentMetaData parsePortComponent(XMLStreamReader reader, String
nsUri) throws XMLStreamException {
+ JBossPortComponentMetaData pc = new JBossPortComponentMetaData();
+ while (reader.hasNext()) {
+ switch (reader.nextTag()) {
+ case XMLStreamConstants.END_ELEMENT: {
+ if (match(reader, nsUri, PORT_COMPONENT)) {
+ return pc;
+ } else {
+ throw new IllegalStateException(BundleUtils.getMessage(bundle,
"UNEXPECTED_END_TAG",
+ reader.getLocalName()));
+ }
+ }
+ case XMLStreamConstants.START_ELEMENT: {
+ if (match(reader, nsUri, EJB_NAME)) {
+ pc.setEjbName(elementAsString(reader));
+ } else if (match(reader, nsUri, PORT_COMPONENT_NAME)) {
+ pc.setPortComponentName(elementAsString(reader));
+ } else if (match(reader, nsUri, PORT_COMPONENT_URI)) {
+ pc.setPortComponentURI(elementAsString(reader));
+ } else if (match(reader, nsUri, AUTH_METHOD)) {
+ pc.setAuthMethod(elementAsString(reader));
+ } else if (match(reader, nsUri, TRANSPORT_GUARANTEE)) {
+ pc.setTransportGuarantee(elementAsString(reader));
+ } else if (match(reader, nsUri, SECURE_WSDL_ACCESS)) {
+ pc.setSecureWSDLAccess(elementAsBoolean(reader));
+ } else {
+ throw new IllegalStateException(BundleUtils.getMessage(bundle,
"UNEXPECTED_ELEMENT",
+ reader.getLocalName()));
+ }
+ }
}
- }
- }
- throw new IllegalStateException(BundleUtils.getMessage(bundle,
"REACHED_END_OF_XML_DOCUMENT_UNEXPECTEDLY"));
- }
-
+ }
+ throw new IllegalStateException(BundleUtils.getMessage(bundle,
"REACHED_END_OF_XML_DOCUMENT_UNEXPECTEDLY"));
+ }
+
+ private JBossWebserviceDescriptionMetaData parseWebserviceDescription(XMLStreamReader
reader, String nsUri)
+ throws XMLStreamException {
+ JBossWebserviceDescriptionMetaData description = new
JBossWebserviceDescriptionMetaData();
+ while (reader.hasNext()) {
+ switch (reader.nextTag()) {
+ case XMLStreamConstants.END_ELEMENT: {
+ if (match(reader, nsUri, WEBSERVICE_DESCRIPTION)) {
+ return description;
+ } else {
+ throw new IllegalStateException(BundleUtils.getMessage(bundle,
"UNEXPECTED_END_TAG",
+ reader.getLocalName()));
+ }
+ }
+ case XMLStreamConstants.START_ELEMENT: {
+ if (match(reader, nsUri, WEBSERVICE_DESCRIPTION_NAME)) {
+
description.setWebserviceDescriptionName(elementAsString(reader));
+ } else if (match(reader, nsUri, WSDL_PUBLISH_LOCATION)) {
+ description.setWsdlPublishLocation(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/trunk/src/main/java/org/jboss/wsf/spi/metadata/webservices/JBossWebservicesMetaData.java
===================================================================
---
spi/trunk/src/main/java/org/jboss/wsf/spi/metadata/webservices/JBossWebservicesMetaData.java 2011-11-07
13:39:04 UTC (rev 15198)
+++
spi/trunk/src/main/java/org/jboss/wsf/spi/metadata/webservices/JBossWebservicesMetaData.java 2011-11-07
13:56:33 UTC (rev 15199)
@@ -23,59 +23,76 @@
package org.jboss.wsf.spi.metadata.webservices;
import java.net.URL;
+import java.util.LinkedList;
+import java.util.List;
/**
- * XML Binding root element for <code>jboss-webservices.xml</code>
- *
* @author <a href="mailto:ropalka@redhat.com">Richard Opalka</a>
*/
-public class JBossWebservicesMetaData extends WebservicesMetaData
-{
+public final class JBossWebservicesMetaData {
- private String contextRoot;
+ private String contextRoot;
- private String configName;
+ private String configName;
- private String configFile;
+ private String configFile;
- public JBossWebservicesMetaData()
- {
- super();
- }
+ private List<JBossPortComponentMetaData> portComponents = new
LinkedList<JBossPortComponentMetaData>();
- public JBossWebservicesMetaData(final URL descriptorURL)
- {
- super(descriptorURL);
- }
+ private List<JBossWebserviceDescriptionMetaData> webserviceDescriptions = new
LinkedList<JBossWebserviceDescriptionMetaData>();
- public String getContextRoot()
- {
- return contextRoot;
- }
+ private URL descriptorURL;
- public void setContextRoot(String contextRoot)
- {
- this.contextRoot = contextRoot;
- }
+ public JBossWebservicesMetaData(final URL descriptorURL) {
+ this.descriptorURL = descriptorURL;
+ }
- public String getConfigName()
- {
- return configName;
- }
+ public URL getDescriptorURL() {
+ return descriptorURL;
+ }
- public void setConfigName(String configName)
- {
- this.configName = configName;
- }
+ public void setContextRoot(final String contextRoot) {
+ this.contextRoot = contextRoot;
+ }
- public String getConfigFile()
- {
- return configFile;
- }
+ public String getContextRoot() {
+ return contextRoot;
+ }
- public void setConfigFile(String configFile)
- {
- this.configFile = configFile;
- }
+ public void setConfigName(final String configName) {
+ this.configName = configName;
+ }
+ public String getConfigName() {
+ return configName;
+ }
+
+ public void setConfigFile(final String configFile) {
+ this.configFile = configFile;
+ }
+
+ public String getConfigFile() {
+ return configFile;
+ }
+
+ public void addPortComponent(final JBossPortComponentMetaData portComponent) {
+ portComponents.add(portComponent);
+ }
+
+ public JBossPortComponentMetaData[] getPortComponents() {
+ final JBossPortComponentMetaData[] array = new
JBossPortComponentMetaData[portComponents.size()];
+ portComponents.toArray(array);
+ return array;
+ }
+
+ public void addWebserviceDescription(final JBossWebserviceDescriptionMetaData
webserviceDescriptionMD) {
+ webserviceDescriptions.add(webserviceDescriptionMD);
+ }
+
+ public JBossWebserviceDescriptionMetaData[] getWebserviceDescriptions() {
+ final JBossWebserviceDescriptionMetaData[] array = new
JBossWebserviceDescriptionMetaData[webserviceDescriptions.size()];
+ webserviceDescriptions.toArray(array);
+ return array;
+ }
+
}
Modified:
spi/trunk/src/main/java/org/jboss/wsf/spi/metadata/webservices/PortComponentMetaData.java
===================================================================
---
spi/trunk/src/main/java/org/jboss/wsf/spi/metadata/webservices/PortComponentMetaData.java 2011-11-07
13:39:04 UTC (rev 15198)
+++
spi/trunk/src/main/java/org/jboss/wsf/spi/metadata/webservices/PortComponentMetaData.java 2011-11-07
13:56:33 UTC (rev 15199)
@@ -62,12 +62,6 @@
* This name must be unique amongst all port component names in a module.
*/
private String portComponentName;
- // The optional <port-component-uri>
- private String portComponentURI;
- // The optional <auth-method>
- private String authMethod;
- // The optional <transport-guarantee>
- private String transportGuarantee;
// The required <wsdl-port> element
private QName wsdlPort;
// The required <service-endpoint-interface> element
@@ -80,8 +74,6 @@
// The HTTP context root
private String contextRoot;
- // The optional secure wsdl access
- private Boolean secureWSDLAccess;
// -----------------------------------------
// JAX-WS additions
@@ -123,36 +115,6 @@
this.portComponentName = portComponentName;
}
- public String getPortComponentURI()
- {
- return portComponentURI;
- }
-
- public void setPortComponentURI(String portComponentURI)
- {
- this.portComponentURI = portComponentURI;
- }
-
- public String getAuthMethod()
- {
- return authMethod;
- }
-
- public void setAuthMethod(String authMethod)
- {
- this.authMethod = authMethod;
- }
-
- public String getTransportGuarantee()
- {
- return transportGuarantee;
- }
-
- public void setTransportGuarantee(String transportGuarantee)
- {
- this.transportGuarantee = transportGuarantee;
- }
-
public QName getWsdlPort()
{
return wsdlPort;
@@ -218,16 +180,6 @@
this.contextRoot = contextRoot;
}
- public Boolean getSecureWSDLAccess()
- {
- return secureWSDLAccess;
- }
-
- public void setSecureWSDLAccess(Boolean secureWSDLAccess)
- {
- this.secureWSDLAccess = secureWSDLAccess;
- }
-
public void setAddressingEnabled(final boolean addressingEnabled) {
this.addressingEnabled = addressingEnabled;
}
Modified:
spi/trunk/src/main/java/org/jboss/wsf/spi/metadata/webservices/WebserviceDescriptionMetaData.java
===================================================================
---
spi/trunk/src/main/java/org/jboss/wsf/spi/metadata/webservices/WebserviceDescriptionMetaData.java 2011-11-07
13:39:04 UTC (rev 15198)
+++
spi/trunk/src/main/java/org/jboss/wsf/spi/metadata/webservices/WebserviceDescriptionMetaData.java 2011-11-07
13:56:33 UTC (rev 15199)
@@ -55,19 +55,7 @@
private String jaxrpcMappingFile;
// The required <port-component> elements
private ArrayList<PortComponentMetaData> portComponents = new
ArrayList<PortComponentMetaData>();
- // The optional <wsdl-publish-location> element
- private String wsdlPublishLocation;
- public String getWsdlPublishLocation()
- {
- return wsdlPublishLocation;
- }
-
- public void setWsdlPublishLocation(String wsdlPublishLocation)
- {
- this.wsdlPublishLocation = wsdlPublishLocation;
- }
-
public WebserviceDescriptionMetaData(WebservicesMetaData webservices)
{
this.webservices = webservices;
Modified:
spi/trunk/src/main/java/org/jboss/wsf/spi/metadata/webservices/WebservicesFactory.java
===================================================================
---
spi/trunk/src/main/java/org/jboss/wsf/spi/metadata/webservices/WebservicesFactory.java 2011-11-07
13:39:04 UTC (rev 15198)
+++
spi/trunk/src/main/java/org/jboss/wsf/spi/metadata/webservices/WebservicesFactory.java 2011-11-07
13:56:33 UTC (rev 15199)
@@ -25,7 +25,6 @@
import static javax.xml.stream.XMLStreamConstants.START_ELEMENT;
import static org.jboss.wsf.spi.metadata.ParserConstants.ADDRESSING;
import static org.jboss.wsf.spi.metadata.ParserConstants.ADDRESSING_RESPONSES;
-import static org.jboss.wsf.spi.metadata.ParserConstants.AUTH_METHOD;
import static org.jboss.wsf.spi.metadata.ParserConstants.EJB_LINK;
import static org.jboss.wsf.spi.metadata.ParserConstants.ENABLED;
import static org.jboss.wsf.spi.metadata.ParserConstants.ENABLE_MTOM;
@@ -37,20 +36,16 @@
import static org.jboss.wsf.spi.metadata.ParserConstants.MTOM_THRESHOLD;
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.PROTOCOL_BINDING;
import static org.jboss.wsf.spi.metadata.ParserConstants.REQUIRED;
import static org.jboss.wsf.spi.metadata.ParserConstants.RESPECT_BINDING;
-import static org.jboss.wsf.spi.metadata.ParserConstants.SECURE_WSDL_ACCESS;
import static org.jboss.wsf.spi.metadata.ParserConstants.SERVICE_ENDPOINT_INTERFACE;
import static org.jboss.wsf.spi.metadata.ParserConstants.SERVICE_IMPL_BEAN;
import static org.jboss.wsf.spi.metadata.ParserConstants.SERVLET_LINK;
-import static org.jboss.wsf.spi.metadata.ParserConstants.TRANSPORT_GUARANTEE;
import static org.jboss.wsf.spi.metadata.ParserConstants.WEBSERVICES;
import static org.jboss.wsf.spi.metadata.ParserConstants.WEBSERVICE_DESCRIPTION;
import static org.jboss.wsf.spi.metadata.ParserConstants.WEBSERVICE_DESCRIPTION_NAME;
import static org.jboss.wsf.spi.metadata.ParserConstants.WSDL_FILE;
-import static org.jboss.wsf.spi.metadata.ParserConstants.WSDL_PUBLISH_LOCATION;
import static org.jboss.wsf.spi.metadata.ParserConstants.WSDL_PORT;
import static org.jboss.wsf.spi.metadata.ParserConstants.WSDL_SERVICE;
import static org.jboss.wsf.spi.util.StAXUtils.elementAsBoolean;
@@ -271,12 +266,9 @@
else if (match(reader, nsUri, WSDL_FILE)) {
description.setWsdlFile(elementAsString(reader));
}
- else if (match(reader, nsUri, WSDL_PUBLISH_LOCATION)) {
- description.setWsdlPublishLocation(elementAsString(reader));
- }
else if (match(reader, nsUri, JAXRPC_MAPPING_FILE)) {
description.setJaxrpcMappingFile(elementAsString(reader));
- }
+ }
else if (match(reader, nsUri, PORT_COMPONENT)) {
description.addPortComponent(parsePortComponent(reader, nsUri,
description));
}
@@ -311,24 +303,12 @@
if (match(reader, nsUri, PORT_COMPONENT_NAME)) {
pc.setPortComponentName(elementAsString(reader));
}
- else if (match(reader, nsUri, PORT_COMPONENT_URI)) {
- pc.setPortComponentURI(elementAsString(reader));
- }
- else if (match(reader, nsUri, AUTH_METHOD)) {
- pc.setAuthMethod(elementAsString(reader));
- }
- else if (match(reader, nsUri, TRANSPORT_GUARANTEE)) {
- pc.setTransportGuarantee(elementAsString(reader));
- }
else if (match(reader, nsUri, WSDL_SERVICE)) {
pc.setWsdlService(elementAsQName(reader));
}
else if (match(reader, nsUri, WSDL_PORT)) {
pc.setWsdlPort(elementAsQName(reader));
}
- else if (match(reader, nsUri, SECURE_WSDL_ACCESS)) {
- pc.setSecureWSDLAccess(elementAsBoolean(reader));
- }
else if (match(reader, nsUri, ENABLE_MTOM)) {
pc.setMtomEnabled(elementAsBoolean(reader));
}