JBossWS SVN: r14095 - in common/trunk: src/main/java/org/jboss/ws/core/utils and 7 other directories.
by jbossws-commits@lists.jboss.org
Author: alessio.soldano(a)jboss.com
Date: 2011-04-14 11:30:44 -0400 (Thu, 14 Apr 2011)
New Revision: 14095
Added:
common/trunk/src/main/java/org/jboss/ws/core/utils/DelegateClassLoader.java
Removed:
common/trunk/src/main/java/org/jboss/wsf/common/addressing/AddressingConstants.java
common/trunk/src/main/java/org/jboss/wsf/common/addressing/MAP.java
common/trunk/src/main/java/org/jboss/wsf/common/addressing/MAPBuilder.java
common/trunk/src/main/java/org/jboss/wsf/common/addressing/MAPBuilderFactory.java
common/trunk/src/main/java/org/jboss/wsf/common/addressing/MAPConstants.java
common/trunk/src/main/java/org/jboss/wsf/common/addressing/MAPEndpoint.java
common/trunk/src/main/java/org/jboss/wsf/common/addressing/MAPRelatesTo.java
common/trunk/src/main/java/org/jboss/wsf/common/handler/GenericHandler.java
common/trunk/src/main/java/org/jboss/wsf/common/handler/GenericLogicalHandler.java
common/trunk/src/main/java/org/jboss/wsf/common/handler/GenericSOAPHandler.java
Modified:
common/trunk/
common/trunk/src/main/java/org/jboss/wsf/common/DOMUtils.java
common/trunk/src/main/java/org/jboss/wsf/common/invocation/InvocationHandlerJAXWS.java
common/trunk/src/main/java/org/jboss/wsf/common/servlet/AbstractEndpointServlet.java
common/trunk/src/main/java/org/jboss/wsf/framework/DefaultSPIProvider.java
common/trunk/src/main/java/org/jboss/wsf/framework/management/DefaultEndpointRegistryFactory.java
Log:
[JBWS-3224][JBWS-3265] Isolate deployment classloader from ws server integration
Property changes on: common/trunk
___________________________________________________________________
Added: svn:mergeinfo
+ /common/branches/asoldano:14028-14056
Copied: common/trunk/src/main/java/org/jboss/ws/core/utils/DelegateClassLoader.java (from rev 14056, common/branches/asoldano/src/main/java/org/jboss/ws/core/utils/DelegateClassLoader.java)
===================================================================
--- common/trunk/src/main/java/org/jboss/ws/core/utils/DelegateClassLoader.java (rev 0)
+++ common/trunk/src/main/java/org/jboss/ws/core/utils/DelegateClassLoader.java 2011-04-14 15:30:44 UTC (rev 14095)
@@ -0,0 +1,145 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * 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.
+ *
+ * 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.utils;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.net.URL;
+import java.security.SecureClassLoader;
+import java.util.ArrayList;
+import java.util.Enumeration;
+import java.util.NoSuchElementException;
+
+/**
+ * A delegate classloader
+ *
+ * @author alessio.soldano(a)jboss.com
+ *
+ */
+public class DelegateClassLoader extends SecureClassLoader
+{
+ private ClassLoader delegate;
+
+ private ClassLoader parent;
+
+ public DelegateClassLoader(final ClassLoader delegate, final ClassLoader parent)
+ {
+ super(parent);
+ this.delegate = delegate;
+ this.parent = parent;
+ }
+
+ /** {@inheritDoc} */
+ @Override
+ public Class<?> loadClass(final String className) throws ClassNotFoundException
+ {
+ if (parent != null)
+ {
+ try
+ {
+ return parent.loadClass(className);
+ }
+ catch (ClassNotFoundException cnfe)
+ {
+ //NOOP, use delegate
+ }
+ }
+ return delegate.loadClass(className);
+ }
+
+ /** {@inheritDoc} */
+ @Override
+ public URL getResource(final String name)
+ {
+ URL url = null;
+ if (parent != null)
+ {
+ url = parent.getResource(name);
+ }
+ return (url == null) ? delegate.getResource(name) : url;
+ }
+
+ /** {@inheritDoc} */
+ @Override
+ public Enumeration<URL> getResources(final String name) throws IOException
+ {
+ final ArrayList<Enumeration<URL>> foundResources = new ArrayList<Enumeration<URL>>();
+
+ foundResources.add(delegate.getResources(name));
+ if (parent != null)
+ {
+ foundResources.add(parent.getResources(name));
+ }
+
+ return new Enumeration<URL>()
+ {
+ private int position = foundResources.size() - 1;
+
+ public boolean hasMoreElements()
+ {
+ while (position >= 0)
+ {
+ if (foundResources.get(position).hasMoreElements())
+ {
+ return true;
+ }
+ position--;
+ }
+ return false;
+ }
+
+ public URL nextElement()
+ {
+ while (position >= 0)
+ {
+ try
+ {
+ return (foundResources.get(position)).nextElement();
+ }
+ catch (NoSuchElementException e)
+ {
+ }
+ position--;
+ }
+ throw new NoSuchElementException();
+ }
+ };
+ }
+
+ /** {@inheritDoc} */
+ @Override
+ public InputStream getResourceAsStream(final String name)
+ {
+ URL foundResource = getResource(name);
+ if (foundResource != null)
+ {
+ try
+ {
+ return foundResource.openStream();
+ }
+ catch (IOException e)
+ {
+ }
+ }
+ return null;
+ }
+}
\ No newline at end of file
Modified: common/trunk/src/main/java/org/jboss/wsf/common/DOMUtils.java
===================================================================
--- common/trunk/src/main/java/org/jboss/wsf/common/DOMUtils.java 2011-04-14 15:28:36 UTC (rev 14094)
+++ common/trunk/src/main/java/org/jboss/wsf/common/DOMUtils.java 2011-04-14 15:30:44 UTC (rev 14095)
@@ -1,6 +1,6 @@
/*
* JBoss, Home of Professional Open Source.
- * Copyright 2009, 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.
*
@@ -28,11 +28,6 @@
import java.io.PrintWriter;
import java.io.Reader;
import java.io.UnsupportedEncodingException;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.LinkedList;
-import java.util.List;
-import java.util.Map;
import javax.xml.XMLConstants;
import javax.xml.namespace.QName;
@@ -52,24 +47,23 @@
import org.jboss.logging.Logger;
import org.jboss.ws.Constants;
import org.jboss.ws.core.utils.JBossWSEntityResolver;
-import org.w3c.dom.Attr;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
-import org.w3c.dom.NamedNodeMap;
import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
import org.w3c.dom.Text;
import org.xml.sax.EntityResolver;
import org.xml.sax.InputSource;
import org.xml.sax.SAXException;
/**
- * DOM2 utilites
+ * DOM2 utilities: this extends the {@link org.jboss.wsf.util.DOMUtils} adding parse and creation methods.
+ * These leverage static thread-local instances of {@link org.w3c.dom.Document} and {@link javax.xml.parsers.DocumentBuilder}.
+ * The ThreadLocal attributes can be reset using the clearThreadLocals() method.
*
* @author Thomas.Diesler(a)jboss.org
* @author alessio.soldano(a)jboss.com
*/
-public final class DOMUtils
+public final class DOMUtils extends org.jboss.wsf.util.DOMUtils
{
private static Logger log = Logger.getLogger(DOMUtils.class);
@@ -187,14 +181,17 @@
{
}
- /** Initialize the DocumentBuilder
+ /**
+ * Initialize the DocumentBuilder, set the current thread association and returns it
*/
public static DocumentBuilder getDocumentBuilder()
{
return builderThreadLocal.get();
}
- /** Parse the given XML string and return the root Element
+ /**
+ * Parse the given XML string and return the root Element
+ * This uses the document builder associated with the current thread.
*/
public static Element parse(String xmlString) throws IOException
{
@@ -209,7 +206,9 @@
}
}
- /** Parse the given XML stream and return the root Element
+ /**
+ * Parse the given XML stream and return the root Element
+ * This uses the document builder associated with the current thread.
*/
public static Element parse(InputStream xmlStream) throws IOException
{
@@ -233,7 +232,9 @@
}
}
- /** Parse the given input source and return the root Element
+ /**
+ * Parse the given input source and return the root Element.
+ * This uses the document builder associated with the current thread.
*/
public static Element parse(InputSource source) throws IOException
{
@@ -266,7 +267,9 @@
}
}
- /** Create an Element for a given name
+ /**
+ * Create an Element for a given name.
+ * This uses the document builder associated with the current thread.
*/
public static Element createElement(String localPart)
{
@@ -275,7 +278,9 @@
return doc.createElement(localPart);
}
- /** Create an Element for a given name and prefix
+ /**
+ * Create an Element for a given name and prefix.
+ * This uses the document builder associated with the current thread.
*/
public static Element createElement(String localPart, String prefix)
{
@@ -284,7 +289,9 @@
return doc.createElement(prefix + ":" + localPart);
}
- /** Create an Element for a given name, prefix and uri
+ /**
+ * Create an Element for a given name, prefix and uri.
+ * This uses the document builder associated with the current thread.
*/
public static Element createElement(String localPart, String prefix, String uri)
{
@@ -301,14 +308,18 @@
}
}
- /** Create an Element for a given QName
+ /**
+ * Create an Element for a given QName.
+ * This uses the document builder associated with the current thread.
*/
public static Element createElement(QName qname)
{
return createElement(qname.getLocalPart(), qname.getPrefix(), qname.getNamespaceURI());
}
- /** Create a org.w3c.dom.Text node
+ /**
+ * Create a org.w3c.dom.Text node.
+ * This uses the document builder associated with the current thread.
*/
public static Text createTextNode(String value)
{
@@ -316,430 +327,6 @@
return doc.createTextNode(value);
}
- /** Get the qname of the given node.
- */
- public static QName getElementQName(Element el)
- {
- String qualifiedName = el.getNodeName();
- return resolveQName(el, qualifiedName);
- }
-
- /** Transform the given qualified name into a QName
- */
- public static QName resolveQName(Element el, String qualifiedName)
- {
- QName qname;
- String prefix = "";
- String namespaceURI = "";
- String localPart = qualifiedName;
-
- int colIndex = qualifiedName.indexOf(":");
- if (colIndex > 0)
- {
- prefix = qualifiedName.substring(0, colIndex);
- localPart = qualifiedName.substring(colIndex + 1);
-
- if ("xmlns".equals(prefix))
- {
- namespaceURI = "URI:XML_PREDEFINED_NAMESPACE";
- }
- else
- {
- Element nsElement = el;
- while (namespaceURI.equals("") && nsElement != null)
- {
- namespaceURI = nsElement.getAttribute("xmlns:" + prefix);
- if (namespaceURI.equals(""))
- nsElement = getParentElement(nsElement);
- }
- }
-
- if (namespaceURI.equals("") && el.getNamespaceURI() != null)
- {
- namespaceURI = el.getNamespaceURI();
- }
-
- if (namespaceURI.equals(""))
- throw new IllegalArgumentException("Cannot find namespace uri for: " + qualifiedName);
- }
- else
- {
- Element nsElement = el;
- while (namespaceURI.equals("") && nsElement != null)
- {
- namespaceURI = nsElement.getAttribute("xmlns");
- if (namespaceURI.equals(""))
- nsElement = getParentElement(nsElement);
- }
- }
-
- qname = new QName(namespaceURI, localPart, prefix);
- return qname;
- }
-
- /** Get the value from the given attribute
- *
- * @return null if the attribute value is empty or the attribute is not present
- */
- public static String getAttributeValue(Element el, String attrName)
- {
- return getAttributeValue(el, new QName(attrName));
- }
-
- /** Get the value from the given attribute
- *
- * @return null if the attribute value is empty or the attribute is not present
- */
- public static String getAttributeValue(Element el, QName attrName)
- {
- String attr = null;
- if ("".equals(attrName.getNamespaceURI()))
- attr = el.getAttribute(attrName.getLocalPart());
- else
- attr = el.getAttributeNS(attrName.getNamespaceURI(), attrName.getLocalPart());
-
- if ("".equals(attr))
- attr = null;
-
- return attr;
- }
-
- /** Get the qname value from the given attribute
- */
- public static QName getAttributeValueAsQName(Element el, String attrName)
- {
- return getAttributeValueAsQName(el, new QName(attrName));
-
- }
-
- /** Get the qname value from the given attribute
- */
- public static QName getAttributeValueAsQName(Element el, QName attrName)
- {
- QName qname = null;
-
- String qualifiedName = getAttributeValue(el, attrName);
- if (qualifiedName != null)
- {
- qname = resolveQName(el, qualifiedName);
- }
-
- return qname;
- }
-
- /** Get the boolean value from the given attribute
- */
- public static boolean getAttributeValueAsBoolean(Element el, String attrName)
- {
- return getAttributeValueAsBoolean(el, new QName(attrName));
- }
-
- /** Get the boolean value from the given attribute
- */
- public static boolean getAttributeValueAsBoolean(Element el, QName attrName)
- {
- String attrVal = getAttributeValue(el, attrName);
- boolean ret = "true".equalsIgnoreCase(attrVal) || "1".equalsIgnoreCase(attrVal);
- return ret;
- }
-
- /** Get the integer value from the given attribute
- */
- public static Integer getAttributeValueAsInteger(Element el, String attrName)
- {
- return getAttributeValueAsInteger(el, new QName(attrName));
- }
-
- /** Get the integer value from the given attribute
- */
- public static Integer getAttributeValueAsInteger(Element el, QName attrName)
- {
- String attrVal = getAttributeValue(el, attrName);
- return (attrVal != null ? new Integer(attrVal) : null);
- }
-
- /** Get the attributes as Map<QName, String>
- */
- public static Map<QName, String> getAttributes(Element el)
- {
- Map<QName, String> attmap = new HashMap<QName, String>();
- NamedNodeMap attribs = el.getAttributes();
- int len = attribs.getLength();
- for (int i = 0; i < len; i++)
- {
- Attr attr = (Attr)attribs.item(i);
- String name = attr.getName();
- QName qname = resolveQName(el, name);
- String value = attr.getNodeValue();
- attmap.put(qname, value);
- }
- return attmap;
- }
-
- /** Copy attributes between elements
- */
- public static void copyAttributes(Element destElement, Element srcElement)
- {
- NamedNodeMap attribs = srcElement.getAttributes();
- int len = attribs.getLength();
- for (int i = 0; i < len; i++)
- {
- Attr attr = (Attr)attribs.item(i);
- String uri = attr.getNamespaceURI();
- String qname = attr.getName();
- String value = attr.getNodeValue();
-
- // Prevent DOMException: NAMESPACE_ERR: An attempt is made to create or
- // change an object in a way which is incorrect with regard to namespaces.
- if (uri == null && qname.startsWith("xmlns"))
- {
- if (log.isTraceEnabled()) log.trace("Ignore attribute: [uri=" + uri + ",qname=" + qname + ",value=" + value + "]");
- }
- else
- {
- destElement.setAttributeNS(uri, qname, value);
- }
- }
- }
-
- /** True if the node has text child elements only
- */
- public static boolean hasTextChildNodesOnly(Node node)
- {
- NodeList nodeList = node.getChildNodes();
- int len = nodeList.getLength();
- if (len == 0)
- return false;
-
- for (int i = 0; i < len; i++)
- {
- Node acksToChildNode = nodeList.item(i);
- if (acksToChildNode.getNodeType() != Node.TEXT_NODE)
- return false;
- }
-
- return true;
- }
-
- /** True if the node has child elements
- */
- public static boolean hasChildElements(Node node)
- {
- NodeList nlist = node.getChildNodes();
- int len = nlist.getLength();
- for (int i = 0; i < len; i++)
- {
- Node child = nlist.item(i);
- if (child.getNodeType() == Node.ELEMENT_NODE)
- return true;
- }
- return false;
- }
-
- /** Gets child elements
- */
- public static Iterator<Element> getChildElements(Node node)
- {
- List<Element> list = new LinkedList<Element>();
- NodeList nlist = node.getChildNodes();
- int len = nlist.getLength();
- for (int i = 0; i < len; i++)
- {
- Node child = nlist.item(i);
- if (child.getNodeType() == Node.ELEMENT_NODE)
- list.add((Element)child);
- }
- return list.iterator();
- }
-
- /** Get the concatenated text content, or null.
- */
- public static String getTextContent(Node node)
- {
- boolean hasTextContent = false;
- StringBuilder buffer = new StringBuilder();
- NodeList nlist = node.getChildNodes();
- int len = nlist.getLength();
- for (int i = 0; i < len; i++)
- {
- Node child = nlist.item(i);
- if (child.getNodeType() == Node.TEXT_NODE)
- {
- buffer.append(child.getNodeValue());
- hasTextContent = true;
- }
- }
- return (hasTextContent ? buffer.toString() : null);
- }
-
- /** Gets the first child element
- */
- public static Element getFirstChildElement(Node node)
- {
- return getFirstChildElement(node, false);
- }
-
- /** Gets the first child element
- */
- public static Element getFirstChildElement(Node node, boolean recursive)
- {
- return getFirstChildElementIntern(node, null, recursive);
- }
-
- /** Gets the first child element for a given local name without namespace
- */
- public static Element getFirstChildElement(Node node, String nodeName)
- {
- return getFirstChildElement(node, nodeName, false);
- }
-
- /** Gets the first child element for a given local name without namespace
- */
- public static Element getFirstChildElement(Node node, String nodeName, boolean recursive)
- {
- return getFirstChildElementIntern(node, new QName(nodeName), recursive);
- }
-
- /** Gets the first child element for a given qname
- */
- public static Element getFirstChildElement(Node node, QName nodeName)
- {
- return getFirstChildElement(node, nodeName, false);
- }
-
- /** Gets the first child element for a given qname
- */
- public static Element getFirstChildElement(Node node, QName nodeName, boolean recursive)
- {
- return getFirstChildElementIntern(node, nodeName, recursive);
- }
-
- private static Element getFirstChildElementIntern(Node node, QName nodeName, boolean recursive)
- {
- Element childElement = null;
- Iterator<Element> it = getChildElementsIntern(node, nodeName, recursive);
- if (it.hasNext())
- {
- childElement = (Element)it.next();
- }
- return childElement;
- }
-
- /** Gets the child elements for a given local name without namespace
- */
- public static Iterator<Element> getChildElements(Node node, String nodeName)
- {
- return getChildElements(node, nodeName, false);
- }
-
- /** Gets the child elements for a given local name without namespace
- */
- public static Iterator<Element> getChildElements(Node node, String nodeName, boolean recursive)
- {
- return getChildElementsIntern(node, new QName(nodeName), recursive);
- }
-
- /** Gets the child element for a given qname
- */
- public static Iterator<Element> getChildElements(Node node, QName nodeName)
- {
- return getChildElements(node, nodeName, false);
- }
-
- /** Gets the child element for a given qname
- */
- public static Iterator<Element> getChildElements(Node node, QName nodeName, boolean recursive)
- {
- return getChildElementsIntern(node, nodeName, recursive);
- }
-
- public static List<Element> getChildElementsAsList(Node node, String nodeName)
- {
- return getChildElementsAsList(node, nodeName, false);
- }
-
- public static List<Element> getChildElementsAsList(Node node, String nodeName, boolean recursive)
- {
- return getChildElementsAsListIntern(node, new QName(nodeName), recursive);
- }
-
- public static List<Element> getChildElementsAsList(Node node, QName nodeName)
- {
- return getChildElementsAsList(node, nodeName, false);
- }
-
- public static List<Element> getChildElementsAsList(Node node, QName nodeName, boolean recursive)
- {
- return getChildElementsAsListIntern(node, nodeName, recursive);
- }
-
- private static List<Element> getChildElementsAsListIntern(Node node, QName nodeName, boolean recursive)
- {
- List<Element> list = new LinkedList<Element>();
-
- NodeList nlist = node.getChildNodes();
- int len = nlist.getLength();
- for (int i = 0; i < len; i++)
- {
- Node child = nlist.item(i);
- if (child.getNodeType() == Node.ELEMENT_NODE)
- {
- search(list, (Element)child, nodeName, recursive);
- }
- }
- return list;
- }
-
- private static void search(List<Element> list, Element baseElement, QName nodeName, boolean recursive)
- {
- if (nodeName == null)
- {
- list.add(baseElement);
- }
- else
- {
- QName qname;
- if (nodeName.getNamespaceURI().length() > 0)
- {
- qname = new QName(baseElement.getNamespaceURI(), baseElement.getLocalName());
- }
- else
- {
- qname = new QName(baseElement.getLocalName());
- }
- if (qname.equals(nodeName))
- {
- list.add(baseElement);
- }
- }
- if (recursive)
- {
- NodeList nlist = baseElement.getChildNodes();
- int len = nlist.getLength();
- for (int i = 0; i < len; i++)
- {
- Node child = nlist.item(i);
- if (child.getNodeType() == Node.ELEMENT_NODE)
- {
- search(list, (Element)child, nodeName, recursive);
- }
- }
- }
- }
-
- private static Iterator<Element> getChildElementsIntern(Node node, QName nodeName, boolean recursive)
- {
- return getChildElementsAsListIntern(node, nodeName, recursive).iterator();
- }
-
- /** Gets parent element or null if there is none
- */
- public static Element getParentElement(Node node)
- {
- Node parent = node.getParentNode();
- return (parent instanceof Element ? (Element)parent : null);
- }
-
/** Peek at the owner document without creating a new one if not set. */
public static Document peekOwnerDocument()
{
@@ -763,6 +350,14 @@
return doc;
}
+ /**
+ * Parse the contents of the provided source into an element.
+ * This uses the document builder associated with the current thread.
+ *
+ * @param source
+ * @return
+ * @throws IOException
+ */
public static Element sourceToElement(Source source) throws IOException
{
Element retElement = null;
Deleted: common/trunk/src/main/java/org/jboss/wsf/common/addressing/AddressingConstants.java
===================================================================
--- common/trunk/src/main/java/org/jboss/wsf/common/addressing/AddressingConstants.java 2011-04-14 15:28:36 UTC (rev 14094)
+++ common/trunk/src/main/java/org/jboss/wsf/common/addressing/AddressingConstants.java 2011-04-14 15:30:44 UTC (rev 14095)
@@ -1,272 +0,0 @@
-/*
- * 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.common.addressing;
-
-import javax.xml.namespace.QName;
-
-/**
- * TODO: see javax.xml.ws.addressing - merge it properly
- * Addressing constants.
- *
- * @author <a href="mailto:ropalka@redhat.com">Richard Opalka</a>
- */
-public final class AddressingConstants
-{
- /**
- * Constructor.
- */
- private AddressingConstants()
- {
- // forbidden inheritance
- }
-
- /**
- * <a href="http://www.w3.org/2005/08/addressing">WSA</a> constants.
- */
- public static final class Core
- {
- /**
- * Constructor.
- */
- private Core()
- {
- // forbidden inheritance
- }
-
- // WSA namespace
- public static final String NS = "http://www.w3.org/2005/08/addressing";
-
- // WSA prefix
- public static final String NS_PREFIX = "wsa";
-
- public static final class Elements
- {
- /**
- * Constructor.
- */
- private Elements()
- {
- // forbidden inheritance
- }
-
- // WSA 'EndpointReference' element
- public static final String ENDPOINTREFERENCE = "EndpointReference";
- public static final QName ENDPOINTREFERENCE_QNAME = new QName(NS, ENDPOINTREFERENCE, NS_PREFIX);
-
- // WSA 'ReferenceParameters' element
- public static final String REFERENCEPARAMETERS = "ReferenceParameters";
- public static final QName REFERENCEPARAMETERS_QNAME = new QName(NS, REFERENCEPARAMETERS, NS_PREFIX);
-
- // WSA 'Metadata' element
- public static final String METADATA = "Metadata";
- public static final QName METADATA_QNAME = new QName(NS, METADATA, NS_PREFIX);
-
- // WSA 'Address' element
- public static final String ADDRESS = "Address";
- public static final QName ADDRESS_QNAME = new QName(NS, ADDRESS, NS_PREFIX);
-
- // WSA 'MessageID' element
- public static final String MESSAGEID = "MessageID";
- public static final QName MESSAGEID_QNAME = new QName(NS, MESSAGEID, NS_PREFIX);
-
- // WSA 'RelatesTo' element
- public static final String RELATESTO = "RelatesTo";
- public static final QName RELATESTO_QNAME = new QName(NS, RELATESTO, NS_PREFIX);
-
- // WSA 'ReplyTo' element
- public static final String REPLYTO = "ReplyTo";
- public static final QName REPLYTO_QNAME = new QName(NS, REPLYTO, NS_PREFIX);
-
- // WSA 'From' element
- public static final String FROM = "From";
- public static final QName FROM_QNAME = new QName(NS, FROM, NS_PREFIX);
-
- // WSA 'FaultTo' element
- public static final String FAULTTO = "FaultTo";
- public static final QName FAULTTO_QNAME = new QName(NS, FAULTTO, NS_PREFIX);
-
- // WSA 'To' element
- public static final String TO = "To";
- public static final QName TO_QNAME = new QName(NS, TO, NS_PREFIX);
-
- // WSA 'Action' element
- public static final String ACTION = "Action";
- public static final QName ACTION_QNAME = new QName(NS, ACTION, NS_PREFIX);
-
- // WSA 'RetryAfter' element
- public static final String RETRYAFTER = "RetryAfter";
- public static final QName RETRYAFTER_QNAME = new QName(NS, RETRYAFTER, NS_PREFIX);
-
- // WSA 'ProblemHeaderQName' element
- public static final String PROBLEMHEADERQNAME = "ProblemHeaderQName";
- public static final QName PROBLEMHEADERQNAME_QNAME = new QName(NS, PROBLEMHEADERQNAME, NS_PREFIX);
-
- // WSA 'ProblemIRI' element
- public static final String PROBLEMIRI = "ProblemIRI";
- public static final QName PROBLEMIRI_QNAME = new QName(NS, PROBLEMIRI, NS_PREFIX);
-
- // WSA 'ProblemAction' element
- public static final String PROBLEMACTION = "ProblemAction";
- public static final QName PROBLEMACTION_QNAME = new QName(NS, PROBLEMACTION, NS_PREFIX);
-
- // WSA 'SoapAction' element
- public static final String SOAPACTION = "SoapAction";
- public static final QName SOAPACTION_QNAME = new QName(NS, SOAPACTION, NS_PREFIX);
- }
-
- public static final class Attributes
- {
- /**
- * Constructor.
- */
- private Attributes()
- {
- // forbidden inheritance
- }
-
- // WSA 'RelationshipType' attribute
- public static final String RELATIONSHIPTYPE = "RelationshipType";
- public static final QName RELATIONSHIPTYPE_QNAME = new QName(NS, RELATIONSHIPTYPE, NS_PREFIX);
-
- // WSA 'IsReferenceParameter' attribute
- public static final String ISREFERENCEPARAMETER = "IsReferenceParameter";
- public static final QName ISREFERENCEPARAMETER_QNAME = new QName(NS, ISREFERENCEPARAMETER, NS_PREFIX);
-
- }
-
- public static final class Faults
- {
- /**
- * Constructor.
- */
- private Faults()
- {
- // forbidden inheritance
- }
-
- // WSA 'InvalidAddressingHeader' fault
- public static final QName INVALIDADDRESSINGHEADER_QNAME = new QName(NS, "InvalidAddressingHeader", NS_PREFIX);
-
- // WSA 'InvalidAddress' fault
- public static final QName INVALIDADDRESS_QNAME = new QName(NS, "InvalidAddress", NS_PREFIX);
-
- // WSA 'InvalidEPR' fault
- public static final QName INVALIDEPR_QNAME = new QName(NS, "InvalidEPR", NS_PREFIX);
-
- // WSA 'InvalidCardinality' fault
- public static final QName INVALIDCARDINALITY_QNAME = new QName(NS, "InvalidCardinality", NS_PREFIX);
-
- // WSA 'MissingAddressInEPR' fault
- public static final QName MISSINGADDRESSINEPR_QNAME = new QName(NS, "MissingAddressInEPR", NS_PREFIX);
-
- // WSA 'DuplicateMessageID' fault
- public static final QName DUPLICATEMESSAGEID_QNAME = new QName(NS, "DuplicateMessageID", NS_PREFIX);
-
- // WSA 'ActionMismatch' fault
- public static final QName ACTIONMISMATCH_QNAME = new QName(NS, "ActionMismatch", NS_PREFIX);
-
- // WSA 'MessageAddressingHeaderRequired' fault
- public static final QName MESSAGEADDRESSINGHEADERREQUIRED_QNAME = new QName(NS, "MessageAddressingHeaderRequired", NS_PREFIX);
-
- // WSA 'DestinationUnreachable' fault
- public static final QName DESTINATIONUNREACHABLE_QNAME = new QName(NS, "DestinationUnreachable", NS_PREFIX);
-
- // WSA 'ActionNotSupported' fault
- public static final QName ACTIONNOTSUPPORTED_QNAME = new QName(NS, "ActionNotSupported", NS_PREFIX);
-
- // WSA 'EndpointUnavailable' fault
- public static final QName ENDPOINTUNAVAILABLE_QNAME = new QName(NS, "EndpointUnavailable", NS_PREFIX);
- }
- }
-
- /**
- * <a href="http://www.w3.org/2007/05/addressing/metadata">WSAM</a> constants.
- */
- public static final class Metadata
- {
- /**
- * Constructor.
- */
- private Metadata()
- {
- // forbidden inheritance
- }
-
- // WSAM namespace
- public static final String NS = "http://www.w3.org/2007/05/addressing/metadata";
-
- // WSAM prefix
- public static final String NS_PREFIX = "wsam";
-
- public static final class Elements
- {
- /**
- * Constructor.
- */
- private Elements()
- {
- // forbidden inheritance
- }
-
- // WSAM 'ServiceName' element
- public static final String SERVICENAME = "ServiceName";
- public static final QName SERVICENAME_QNAME = new QName(NS, SERVICENAME, NS_PREFIX);
-
- // WSAM 'InterfaceName' element
- public static final String INTERFACENAME = "InterfaceName";
- public static final QName INTERFACENAME_QNAME = new QName(NS, INTERFACENAME, NS_PREFIX);
-
- // WSAM 'Addressing' element
- public static final String ADDRESSING = "Addressing";
- public static final QName ADDRESSING_QNAME = new QName(NS, ADDRESSING, NS_PREFIX);
-
- // WSAM 'AnonymousResponses' element
- public static final String ANONYMOUSRESPONSES = "AnonymousResponses";
- public static final QName ANONYMOUSRESPONSES_QNAME = new QName(NS, ANONYMOUSRESPONSES, NS_PREFIX);
-
- // WSAM 'NonAnonymousResponses' element
- public static final String NONANONYMOUSRESPONSES = "NonAnonymousResponses";
- public static final QName NONANONYMOUSRESPONSES_QNAME = new QName(NS, NONANONYMOUSRESPONSES, NS_PREFIX);
- }
-
- public static final class Attributes
- {
- /**
- * Constructor.
- */
- private Attributes()
- {
- // forbidden inheritance
- }
-
- // WSAM 'EndpointName' attribute
- public static final String ENDPOINTNAME = "EndpointName";
- public static final QName ENDPOINTNAME_QNAME = new QName(NS, ENDPOINTNAME, NS_PREFIX);
-
- // WSAM 'Action' attribute
- public static final String ACTION = "Action";
- public static final QName ACTION_QNAME = new QName(NS, ACTION, NS_PREFIX);
-
- }
- }
-
-}
Deleted: common/trunk/src/main/java/org/jboss/wsf/common/addressing/MAP.java
===================================================================
--- common/trunk/src/main/java/org/jboss/wsf/common/addressing/MAP.java 2011-04-14 15:28:36 UTC (rev 14094)
+++ common/trunk/src/main/java/org/jboss/wsf/common/addressing/MAP.java 2011-04-14 15:30:44 UTC (rev 14095)
@@ -1,78 +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.common.addressing;
-
-import java.util.List;
-import java.util.Map;
-
-import org.w3c.dom.Element;
-
-/**
- * Message Addressing Properties is a wrapper for the stack-specific JSR-261 addressing properties
- * classes implemented by JBossWS Native and CXF. It is used to localize dependence upon the WS
- * stack.
- *
- * @author Andrew Dinn (adinn(a)redhat.com)
- * @author alessio.soldano(a)jboss.com
- *
- */
-public interface MAP
-{
- public String getTo();
-
- public MAPEndpoint getFrom();
-
- public String getMessageID();
-
- public String getAction();
-
- public MAPEndpoint getFaultTo();
-
- public MAPEndpoint getReplyTo();
-
- public MAPRelatesTo getRelatesTo();
-
- public void setTo(String address);
-
- public void setFrom(MAPEndpoint epref);
-
- public void setMessageID(String messageID);
-
- public void setAction(String action);
-
- public void setReplyTo(MAPEndpoint epref);
-
- public void setFaultTo(MAPEndpoint epref);
-
- public void setRelatesTo(MAPRelatesTo relatesTo);
-
- public void addReferenceParameter(Element refParam);
-
- public List<Object> getReferenceParameters();
-
- public void initializeAsDestination(MAPEndpoint epref);
-
- public void installOutboundMapOnServerSide(Map<String, Object> requestContext, MAP map);
-
- public void installOutboundMapOnClientSide(Map<String, Object> requestContext, MAP map);
-
-}
Deleted: common/trunk/src/main/java/org/jboss/wsf/common/addressing/MAPBuilder.java
===================================================================
--- common/trunk/src/main/java/org/jboss/wsf/common/addressing/MAPBuilder.java 2011-04-14 15:28:36 UTC (rev 14094)
+++ common/trunk/src/main/java/org/jboss/wsf/common/addressing/MAPBuilder.java 2011-04-14 15:30:44 UTC (rev 14095)
@@ -1,60 +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.common.addressing;
-
-import java.util.Map;
-
-import javax.xml.namespace.QName;
-import javax.xml.ws.handler.MessageContext;
-
-/**
- * MAPBuilder is a helper used to create objects used with class MAP.
- *
- * @author Andrew Dinn (adinn(a)redhat.com)
- * @author alessio.soldano(a)jboss.com
- *
- */
-public interface MAPBuilder
-{
- public MAP newMap();
-
- /**
- * retrieve the inbound server message address properties attached to a message context
- * @param ctx the server message context
- * @return
- */
- public MAP inboundMap(Map<String, Object> ctx);
-
- /**
- * retrieve the outbound client message address properties attached to a message request map
- * @param ctx the client request properties map
- * @return
- */
- public MAP outboundMap(Map<String, Object> ctx);
-
- public MAPConstants newConstants();
-
- public MAPEndpoint newEndpoint(String address);
-
- public MAPRelatesTo newRelatesTo(String id, QName type);
-
-}
Deleted: common/trunk/src/main/java/org/jboss/wsf/common/addressing/MAPBuilderFactory.java
===================================================================
--- common/trunk/src/main/java/org/jboss/wsf/common/addressing/MAPBuilderFactory.java 2011-04-14 15:28:36 UTC (rev 14094)
+++ common/trunk/src/main/java/org/jboss/wsf/common/addressing/MAPBuilderFactory.java 2011-04-14 15:30:44 UTC (rev 14095)
@@ -1,40 +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.common.addressing;
-
-import org.jboss.wsf.spi.util.ServiceLoader;
-
-/**
- *
- * @author alessio.soldano(a)jboss.com
- * @since 25-May-2009
- *
- */
-public abstract class MAPBuilderFactory
-{
- public static MAPBuilderFactory getInstance()
- {
- return (MAPBuilderFactory)ServiceLoader.loadService(MAPBuilderFactory.class.getName(), null);
- }
-
- public abstract MAPBuilder getBuilderInstance();
-}
Deleted: common/trunk/src/main/java/org/jboss/wsf/common/addressing/MAPConstants.java
===================================================================
--- common/trunk/src/main/java/org/jboss/wsf/common/addressing/MAPConstants.java 2011-04-14 15:28:36 UTC (rev 14094)
+++ common/trunk/src/main/java/org/jboss/wsf/common/addressing/MAPConstants.java 2011-04-14 15:30:44 UTC (rev 14095)
@@ -1,47 +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.common.addressing;
-
-/**
- * MAPConstants is a wrapper which works with class MAP
- *
- * @author Andrew Dinn (adinn(a)redhat.com)
- * @author alessio.soldano(a)jboss.com
- *
- */
-public interface MAPConstants
-{
- public String getAnonymousURI();
-
- public String getNoneURI();
-
- public String getClientAddressingProperties();
-
- public String getClientAddressingPropertiesInbound();
-
- public String getClientAddressingPropertiesOutbound();
-
- public String getServerAddressingPropertiesInbound();
-
- public String getServerAddressingPropertiesOutbound();
-
-}
Deleted: common/trunk/src/main/java/org/jboss/wsf/common/addressing/MAPEndpoint.java
===================================================================
--- common/trunk/src/main/java/org/jboss/wsf/common/addressing/MAPEndpoint.java 2011-04-14 15:28:36 UTC (rev 14094)
+++ common/trunk/src/main/java/org/jboss/wsf/common/addressing/MAPEndpoint.java 2011-04-14 15:30:44 UTC (rev 14095)
@@ -1,43 +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.common.addressing;
-
-import java.util.List;
-
-import org.w3c.dom.Element;
-
-/**
- * MAPEndpoint is a wrapper which works with class MAP.
- *
- * @author Andrew Dinn (adinn(a)redhat.com)
- * @author alessio.soldano(a)jboss.com
- *
- */
-public interface MAPEndpoint
-{
- public String getAddress();
-
- public void addReferenceParameter(Element element);
-
- public List<Object> getReferenceParameters();
-
-}
Deleted: common/trunk/src/main/java/org/jboss/wsf/common/addressing/MAPRelatesTo.java
===================================================================
--- common/trunk/src/main/java/org/jboss/wsf/common/addressing/MAPRelatesTo.java 2011-04-14 15:28:36 UTC (rev 14094)
+++ common/trunk/src/main/java/org/jboss/wsf/common/addressing/MAPRelatesTo.java 2011-04-14 15:30:44 UTC (rev 14095)
@@ -1,41 +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.common.addressing;
-
-import javax.xml.namespace.QName;
-
-/**
- * MAPRelationship is a wrapper which works with class MAP.
- *
- * @author Andrew Dinn (adinn(a)redhat.com)
- * @author alessio.soldano(a)jboss.com
- *
- */
-public interface MAPRelatesTo
-{
- public String getRelatesTo();
-
- public QName getType();
-
- public void setType(QName type);
-
-}
Deleted: common/trunk/src/main/java/org/jboss/wsf/common/handler/GenericHandler.java
===================================================================
--- common/trunk/src/main/java/org/jboss/wsf/common/handler/GenericHandler.java 2011-04-14 15:28:36 UTC (rev 14094)
+++ common/trunk/src/main/java/org/jboss/wsf/common/handler/GenericHandler.java 2011-04-14 15:30:44 UTC (rev 14095)
@@ -1,79 +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.common.handler;
-
-import javax.xml.ws.handler.Handler;
-import javax.xml.ws.handler.MessageContext;
-
-/**
- * A generic jaxws handler
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 13-Aug-2006
- */
-public abstract class GenericHandler implements Handler
-{
- private String handlerName;
-
- public String getHandlerName()
- {
- return handlerName;
- }
-
- public void setHandlerName(String handlerName)
- {
- this.handlerName = handlerName;
- }
-
- public boolean handleMessage(MessageContext msgContext)
- {
- Boolean outbound = (Boolean)msgContext.get(MessageContext.MESSAGE_OUTBOUND_PROPERTY);
- if (outbound == null)
- throw new IllegalStateException("Cannot obtain required property: " + MessageContext.MESSAGE_OUTBOUND_PROPERTY);
-
- return outbound ? handleOutbound(msgContext) : handleInbound(msgContext);
- }
-
- protected boolean handleOutbound(MessageContext msgContext)
- {
- return true;
- }
-
- protected boolean handleInbound(MessageContext msgContext)
- {
- return true;
- }
-
- public boolean handleFault(MessageContext messagecontext)
- {
- return true;
- }
-
- public void close(MessageContext messageContext)
- {
- }
-
- public String toString()
- {
- return (handlerName != null ? handlerName : super.toString());
- }
-}
Deleted: common/trunk/src/main/java/org/jboss/wsf/common/handler/GenericLogicalHandler.java
===================================================================
--- common/trunk/src/main/java/org/jboss/wsf/common/handler/GenericLogicalHandler.java 2011-04-14 15:28:36 UTC (rev 14094)
+++ common/trunk/src/main/java/org/jboss/wsf/common/handler/GenericLogicalHandler.java 2011-04-14 15:30:44 UTC (rev 14095)
@@ -1,35 +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.common.handler;
-
-import javax.xml.ws.handler.LogicalHandler;
-import javax.xml.ws.handler.LogicalMessageContext;
-
-/**
- * A generic jaxws logical handler
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 13-Aug-2006
- */
-public class GenericLogicalHandler<C extends LogicalMessageContext> extends GenericHandler implements LogicalHandler
-{
-}
Deleted: common/trunk/src/main/java/org/jboss/wsf/common/handler/GenericSOAPHandler.java
===================================================================
--- common/trunk/src/main/java/org/jboss/wsf/common/handler/GenericSOAPHandler.java 2011-04-14 15:28:36 UTC (rev 14094)
+++ common/trunk/src/main/java/org/jboss/wsf/common/handler/GenericSOAPHandler.java 2011-04-14 15:30:44 UTC (rev 14095)
@@ -1,55 +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.common.handler;
-
-import java.util.HashSet;
-import java.util.Set;
-
-import javax.xml.namespace.QName;
-import javax.xml.ws.handler.LogicalMessageContext;
-import javax.xml.ws.handler.soap.SOAPHandler;
-
-/**
- * A generic jaxws soap handler
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 13-Aug-2006
- */
-public abstract class GenericSOAPHandler<C extends LogicalMessageContext> extends GenericHandler implements SOAPHandler
-{
- // The header blocks that can be processed by this Handler instance
- private Set<QName> headers = new HashSet<QName>();
-
- /** Gets the header blocks that can be processed by this Handler instance.
- */
- public Set<QName> getHeaders()
- {
- return headers;
- }
-
- /** Sets the header blocks that can be processed by this Handler instance.
- */
- public void setHeaders(Set<QName> headers)
- {
- this.headers = headers;
- }
-}
Modified: common/trunk/src/main/java/org/jboss/wsf/common/invocation/InvocationHandlerJAXWS.java
===================================================================
--- common/trunk/src/main/java/org/jboss/wsf/common/invocation/InvocationHandlerJAXWS.java 2011-04-14 15:28:36 UTC (rev 14094)
+++ common/trunk/src/main/java/org/jboss/wsf/common/invocation/InvocationHandlerJAXWS.java 2011-04-14 15:30:44 UTC (rev 14095)
@@ -26,13 +26,9 @@
import org.jboss.wsf.common.injection.InjectionHelper;
import org.jboss.wsf.common.injection.PreDestroyHolder;
import org.jboss.wsf.common.injection.ThreadLocalAwareWebServiceContext;
-import org.jboss.wsf.spi.SPIProvider;
-import org.jboss.wsf.spi.SPIProviderResolver;
import org.jboss.wsf.spi.deployment.Endpoint;
import org.jboss.wsf.spi.invocation.Invocation;
import org.jboss.wsf.spi.invocation.InvocationContext;
-import org.jboss.wsf.spi.invocation.ResourceInjector;
-import org.jboss.wsf.spi.invocation.ResourceInjectorFactory;
import org.jboss.wsf.spi.metadata.injection.InjectionsMetaData;
/**
@@ -69,10 +65,7 @@
if (injectionsMD != null)
InjectionHelper.injectResources(targetBean, injectionsMD, endpoint.getJNDIContext());
- final SPIProvider spiProvider = SPIProviderResolver.getInstance().getProvider();
- final ResourceInjectorFactory resourceInjectorFactory = spiProvider.getSPI(ResourceInjectorFactory.class);
- final ResourceInjector wsContextInjector = resourceInjectorFactory.newResourceInjector();
- wsContextInjector.inject(targetBean, ThreadLocalAwareWebServiceContext.getInstance());
+ InjectionHelper.injectWebServiceContext(targetBean, ThreadLocalAwareWebServiceContext.getInstance());
this.log.debug("Calling postConstruct method on JAXWS JSE endpoint: " + targetBean);
InjectionHelper.callPostConstructMethod(targetBean);
Modified: common/trunk/src/main/java/org/jboss/wsf/common/servlet/AbstractEndpointServlet.java
===================================================================
--- common/trunk/src/main/java/org/jboss/wsf/common/servlet/AbstractEndpointServlet.java 2011-04-14 15:28:36 UTC (rev 14094)
+++ common/trunk/src/main/java/org/jboss/wsf/common/servlet/AbstractEndpointServlet.java 2011-04-14 15:30:44 UTC (rev 14095)
@@ -35,6 +35,7 @@
import org.jboss.wsf.common.ObjectNameFactory;
import org.jboss.wsf.spi.SPIProvider;
import org.jboss.wsf.spi.SPIProviderResolver;
+import org.jboss.wsf.spi.classloading.ClassLoaderProvider;
import org.jboss.wsf.spi.deployment.Deployment;
import org.jboss.wsf.spi.deployment.Endpoint;
import org.jboss.wsf.spi.invocation.EndpointAssociation;
@@ -54,7 +55,6 @@
public abstract class AbstractEndpointServlet extends HttpServlet
{
- private final SPIProvider spiProvider = SPIProviderResolver.getInstance().getProvider();
protected Endpoint endpoint;
private EndpointRegistry epRegistry;
@@ -133,7 +133,9 @@
*/
private void initRegistry()
{
- epRegistry = spiProvider.getSPI(EndpointRegistryFactory.class).getEndpointRegistry();
+ ClassLoader cl = ClassLoaderProvider.getDefaultProvider().getServerIntegrationClassLoader();
+ SPIProvider spiProvider = SPIProviderResolver.getInstance(cl).getProvider();
+ epRegistry = spiProvider.getSPI(EndpointRegistryFactory.class, cl).getEndpointRegistry();
}
/**
Modified: common/trunk/src/main/java/org/jboss/wsf/framework/DefaultSPIProvider.java
===================================================================
--- common/trunk/src/main/java/org/jboss/wsf/framework/DefaultSPIProvider.java 2011-04-14 15:28:36 UTC (rev 14094)
+++ common/trunk/src/main/java/org/jboss/wsf/framework/DefaultSPIProvider.java 2011-04-14 15:30:44 UTC (rev 14095)
@@ -49,55 +49,55 @@
*/
class DefaultSPIProvider extends SPIProvider
{
-
/**
- * Gets the specified SPI.
+ * Gets the specified SPI, using the provided classloader
*/
- public <T> T getSPI(Class<T> spiType)
+ @Override
+ public <T> T getSPI(Class<T> spiType, ClassLoader loader)
{
T returnType = null;
// SPIs provided by framework, defaults can be overridden
if (DeploymentModelFactory.class.equals(spiType))
{
- returnType = loadService(spiType, DefaultDeploymentModelFactory.class);
+ returnType = loadService(spiType, DefaultDeploymentModelFactory.class, loader);
}
else if (EndpointMetricsFactory.class.equals(spiType))
{
- returnType = loadService(spiType, DefaultEndpointMetricsFactory.class);
+ returnType = loadService(spiType, DefaultEndpointMetricsFactory.class, loader);
}
else if (LifecycleHandlerFactory.class.equals(spiType))
{
- returnType = loadService(spiType, DefaultLifecycleHandlerFactory.class);
+ returnType = loadService(spiType, DefaultLifecycleHandlerFactory.class, loader);
}
else if (ResourceInjectorFactory.class.equals(spiType))
{
- returnType = loadService(spiType, DefaultResourceInjectorFactory.class);
+ returnType = loadService(spiType, DefaultResourceInjectorFactory.class, loader);
}
else if (ServiceRefHandlerFactory.class.equals(spiType))
{
- returnType = loadService(spiType, DefaultServiceRefHandlerFactory.class);
+ returnType = loadService(spiType, DefaultServiceRefHandlerFactory.class, loader);
}
else if (SecurityAdaptorFactory.class.equals(spiType))
{
- returnType = loadService(spiType, DefaultSecurityAdapterFactory.class);
+ returnType = loadService(spiType, DefaultSecurityAdapterFactory.class, loader);
}
else if (EndpointRegistryFactory.class.equals(spiType))
{
- returnType = loadService(spiType, DefaultEndpointRegistryFactory.class);
+ returnType = loadService(spiType, DefaultEndpointRegistryFactory.class, loader);
}
else if (Deployer.class.equals(spiType))
{
- returnType = loadService(spiType, DeployerJBoss6.class);
+ returnType = loadService(spiType, DeployerJBoss6.class, loader);
}
else if (JMSEndpointResolver.class.equals(spiType))
{
- returnType = loadService(spiType, DefaultJMSEndpointResolver.class);
+ returnType = loadService(spiType, DefaultJMSEndpointResolver.class, loader);
}
else
{
// SPI provided by either container or stack integration that has no default implementation
- returnType = (T)loadService(spiType, null);
+ returnType = (T)loadService(spiType, null, loader);
}
if (returnType == null)
@@ -108,10 +108,10 @@
// Load SPI implementation through ServiceLoader
@SuppressWarnings("unchecked")
- private <T> T loadService(Class<T> spiType, Class<?> defaultImpl)
+ private <T> T loadService(Class<T> spiType, Class<?> defaultImpl, ClassLoader loader)
{
final String defaultImplName = defaultImpl != null ? defaultImpl.getName() : null;
- return (T)ServiceLoader.loadService(spiType.getName(), defaultImplName);
+ return (T)ServiceLoader.loadService(spiType.getName(), defaultImplName, loader);
}
}
Modified: common/trunk/src/main/java/org/jboss/wsf/framework/management/DefaultEndpointRegistryFactory.java
===================================================================
--- common/trunk/src/main/java/org/jboss/wsf/framework/management/DefaultEndpointRegistryFactory.java 2011-04-14 15:28:36 UTC (rev 14094)
+++ common/trunk/src/main/java/org/jboss/wsf/framework/management/DefaultEndpointRegistryFactory.java 2011-04-14 15:30:44 UTC (rev 14095)
@@ -25,6 +25,7 @@
import org.jboss.wsf.spi.SPIProvider;
import org.jboss.wsf.spi.SPIProviderResolver;
import org.jboss.wsf.spi.WSFException;
+import org.jboss.wsf.spi.classloading.ClassLoaderProvider;
import org.jboss.wsf.spi.ioc.IoCContainerProxy;
import org.jboss.wsf.spi.ioc.IoCContainerProxyFactory;
import org.jboss.wsf.spi.management.EndpointRegistry;
@@ -62,8 +63,9 @@
{
try
{
- final SPIProvider spiProvider = SPIProviderResolver.getInstance().getProvider();
- final IoCContainerProxyFactory iocContainerFactory = spiProvider.getSPI(IoCContainerProxyFactory.class);
+ final ClassLoader cl = ClassLoaderProvider.getDefaultProvider().getServerIntegrationClassLoader();
+ final SPIProvider spiProvider = SPIProviderResolver.getInstance(cl).getProvider();
+ final IoCContainerProxyFactory iocContainerFactory = spiProvider.getSPI(IoCContainerProxyFactory.class, cl);
final IoCContainerProxy iocContainer = iocContainerFactory.getContainer();
EndpointRegistry registry = null;
13 years
JBossWS SVN: r14094 - in spi/trunk: src/main/java/org/jboss/wsf/spi and 2 other directories.
by jbossws-commits@lists.jboss.org
Author: alessio.soldano(a)jboss.com
Date: 2011-04-14 11:28:36 -0400 (Thu, 14 Apr 2011)
New Revision: 14094
Added:
spi/trunk/src/main/java/org/jboss/wsf/spi/SecurityActions.java
spi/trunk/src/main/java/org/jboss/wsf/spi/classloading/
spi/trunk/src/main/java/org/jboss/wsf/spi/classloading/ClassLoaderProvider.java
spi/trunk/src/main/java/org/jboss/wsf/spi/deployment/ServletDelegate.java
spi/trunk/src/main/java/org/jboss/wsf/spi/deployment/ServletDelegateFactory.java
spi/trunk/src/main/java/org/jboss/wsf/spi/deployment/WSFServlet.java
Removed:
spi/trunk/src/main/java/org/jboss/wsf/spi/classloading/ClassLoaderProvider.java
Modified:
spi/trunk/
spi/trunk/src/main/java/org/jboss/wsf/spi/SPIProvider.java
spi/trunk/src/main/java/org/jboss/wsf/spi/SPIProviderResolver.java
Log:
[JBWS-3224][JBWS-3265] Isolate deployment classloader from ws server integration
Property changes on: spi/trunk
___________________________________________________________________
Added: svn:mergeinfo
+ /spi/branches/asoldano:14017-14042
Modified: spi/trunk/src/main/java/org/jboss/wsf/spi/SPIProvider.java
===================================================================
--- spi/trunk/src/main/java/org/jboss/wsf/spi/SPIProvider.java 2011-04-14 15:25:34 UTC (rev 14093)
+++ spi/trunk/src/main/java/org/jboss/wsf/spi/SPIProvider.java 2011-04-14 15:28:36 UTC (rev 14094)
@@ -29,8 +29,25 @@
*/
public abstract class SPIProvider
{
- /*
- * Gets the specified SPI.
- */
- public abstract <T> T getSPI(java.lang.Class<T> spiType);
+ /**
+ * Gets the specified SPI, using the current thread context classloader
+ *
+ * @param <T>
+ * @param spiType
+ * @return
+ */
+ public <T> T getSPI(Class<T> spiType)
+ {
+ return getSPI(spiType, SecurityActions.getContextClassLoader());
+ }
+
+ /**
+ * Gets the specified SPI, using the provided classloader
+ *
+ * @param <T>
+ * @param spiType
+ * @param loader
+ * @return
+ */
+ public abstract <T> T getSPI(Class<T> spiType, ClassLoader loader);
}
Modified: spi/trunk/src/main/java/org/jboss/wsf/spi/SPIProviderResolver.java
===================================================================
--- spi/trunk/src/main/java/org/jboss/wsf/spi/SPIProviderResolver.java 2011-04-14 15:25:34 UTC (rev 14093)
+++ spi/trunk/src/main/java/org/jboss/wsf/spi/SPIProviderResolver.java 2011-04-14 15:28:36 UTC (rev 14094)
@@ -32,13 +32,28 @@
public abstract class SPIProviderResolver
{
public final static String DEFAULT_SPI_PROVIDER_RESOLVER = "org.jboss.wsf.framework.DefaultSPIProviderResolver";
-
+
+ /**
+ * Get the SPIProviderResolver instance using the thread context classloader for lookup
+ *
+ * @return
+ */
public static SPIProviderResolver getInstance()
{
- SPIProviderResolver resolver = (SPIProviderResolver)ServiceLoader.loadService(SPIProviderResolver.class.getName(), DEFAULT_SPI_PROVIDER_RESOLVER);
+ return getInstance(SecurityActions.getContextClassLoader());
+ }
+
+ /**
+ * Get the SPIProviderResolver instance using the provided classloader for lookup
+ *
+ * @return
+ */
+ public static SPIProviderResolver getInstance(ClassLoader cl)
+ {
+ SPIProviderResolver resolver = (SPIProviderResolver)ServiceLoader.loadService(SPIProviderResolver.class.getName(), DEFAULT_SPI_PROVIDER_RESOLVER, cl);
return resolver;
}
public abstract SPIProvider getProvider();
-
+
}
Copied: spi/trunk/src/main/java/org/jboss/wsf/spi/SecurityActions.java (from rev 14042, spi/branches/asoldano/src/main/java/org/jboss/wsf/spi/SecurityActions.java)
===================================================================
--- spi/trunk/src/main/java/org/jboss/wsf/spi/SecurityActions.java (rev 0)
+++ spi/trunk/src/main/java/org/jboss/wsf/spi/SecurityActions.java 2011-04-14 15:28:36 UTC (rev 14094)
@@ -0,0 +1,69 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * 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.
+ *
+ * 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;
+
+import java.security.AccessController;
+import java.security.PrivilegedAction;
+
+/**
+ * Security actions helper.
+ *
+ * @author alessio.soldano(a)jboss.com
+ * @since 17-Feb-2010
+ */
+class SecurityActions {
+ /**
+ * Get context classloader.
+ *
+ * @return the current context classloader
+ */
+ static ClassLoader getContextClassLoader() {
+ SecurityManager sm = System.getSecurityManager();
+ if (sm == null) {
+ return Thread.currentThread().getContextClassLoader();
+ } else {
+ return AccessController.doPrivileged(new PrivilegedAction<ClassLoader>() {
+ public ClassLoader run() {
+ return Thread.currentThread().getContextClassLoader();
+ }
+ });
+ }
+ }
+
+ /**
+ * Set context classloader.
+ *
+ * @param classLoader the classloader
+ */
+ static void setContextClassLoader(final ClassLoader classLoader) {
+ if (System.getSecurityManager() == null) {
+ Thread.currentThread().setContextClassLoader(classLoader);
+ } else {
+ AccessController.doPrivileged(new PrivilegedAction<Object>() {
+ public Object run() {
+ Thread.currentThread().setContextClassLoader(classLoader);
+ return null;
+ }
+ });
+ }
+ }
+}
Deleted: spi/trunk/src/main/java/org/jboss/wsf/spi/classloading/ClassLoaderProvider.java
===================================================================
--- spi/branches/asoldano/src/main/java/org/jboss/wsf/spi/classloading/ClassLoaderProvider.java 2011-04-08 15:49:09 UTC (rev 14042)
+++ spi/trunk/src/main/java/org/jboss/wsf/spi/classloading/ClassLoaderProvider.java 2011-04-14 15:28:36 UTC (rev 14094)
@@ -1,92 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * 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.
- *
- * 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.classloading;
-
-import java.security.AccessController;
-import java.security.PrivilegedAction;
-
-/**
- * SPI for getting AS classloaders
- *
- * @author alessio.soldano(a)jboss.com
- * @since 06-Apr-2011
- *
- */
-public abstract class ClassLoaderProvider
-{
- private static ClassLoaderProvider provider = new ClassLoaderProvider()
- {
- @Override
- public ClassLoader getWebServiceSubsystemClassLoader()
- {
- return getContextClassLoader();
- }
-
- @Override
- public ClassLoader getServerIntegrationClassLoader()
- {
- return getContextClassLoader();
- }
- };
-
- public static void setDefaultProvider(ClassLoaderProvider p)
- {
- provider = p;
- }
-
- public static ClassLoaderProvider getDefaultProvider()
- {
- return provider;
- }
-
- /**
- * Return the ClassLoader instance having visibility over the application server ws subsystem only
- *
- * @return
- */
- public abstract ClassLoader getWebServiceSubsystemClassLoader();
-
- /**
- * Return the ClassLoader instance having visibility over the all server side ws libraries
- *
- * @return
- */
- public abstract ClassLoader getServerIntegrationClassLoader();
-
- static ClassLoader getContextClassLoader()
- {
- if (System.getSecurityManager() == null)
- {
- return Thread.currentThread().getContextClassLoader();
- }
- else
- {
- return AccessController.doPrivileged(new PrivilegedAction<ClassLoader>()
- {
- public ClassLoader run()
- {
- return Thread.currentThread().getContextClassLoader();
- }
- });
- }
- }
-}
Copied: spi/trunk/src/main/java/org/jboss/wsf/spi/classloading/ClassLoaderProvider.java (from rev 14042, spi/branches/asoldano/src/main/java/org/jboss/wsf/spi/classloading/ClassLoaderProvider.java)
===================================================================
--- spi/trunk/src/main/java/org/jboss/wsf/spi/classloading/ClassLoaderProvider.java (rev 0)
+++ spi/trunk/src/main/java/org/jboss/wsf/spi/classloading/ClassLoaderProvider.java 2011-04-14 15:28:36 UTC (rev 14094)
@@ -0,0 +1,92 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * 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.
+ *
+ * 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.classloading;
+
+import java.security.AccessController;
+import java.security.PrivilegedAction;
+
+/**
+ * SPI for getting AS classloaders
+ *
+ * @author alessio.soldano(a)jboss.com
+ * @since 06-Apr-2011
+ *
+ */
+public abstract class ClassLoaderProvider
+{
+ private static ClassLoaderProvider provider = new ClassLoaderProvider()
+ {
+ @Override
+ public ClassLoader getWebServiceSubsystemClassLoader()
+ {
+ return getContextClassLoader();
+ }
+
+ @Override
+ public ClassLoader getServerIntegrationClassLoader()
+ {
+ return getContextClassLoader();
+ }
+ };
+
+ public static void setDefaultProvider(ClassLoaderProvider p)
+ {
+ provider = p;
+ }
+
+ public static ClassLoaderProvider getDefaultProvider()
+ {
+ return provider;
+ }
+
+ /**
+ * Return the ClassLoader instance having visibility over the application server ws subsystem only
+ *
+ * @return
+ */
+ public abstract ClassLoader getWebServiceSubsystemClassLoader();
+
+ /**
+ * Return the ClassLoader instance having visibility over the all server side ws libraries
+ *
+ * @return
+ */
+ public abstract ClassLoader getServerIntegrationClassLoader();
+
+ static ClassLoader getContextClassLoader()
+ {
+ if (System.getSecurityManager() == null)
+ {
+ return Thread.currentThread().getContextClassLoader();
+ }
+ else
+ {
+ return AccessController.doPrivileged(new PrivilegedAction<ClassLoader>()
+ {
+ public ClassLoader run()
+ {
+ return Thread.currentThread().getContextClassLoader();
+ }
+ });
+ }
+ }
+}
Copied: spi/trunk/src/main/java/org/jboss/wsf/spi/deployment/ServletDelegate.java (from rev 14042, spi/branches/asoldano/src/main/java/org/jboss/wsf/spi/deployment/ServletDelegate.java)
===================================================================
--- spi/trunk/src/main/java/org/jboss/wsf/spi/deployment/ServletDelegate.java (rev 0)
+++ spi/trunk/src/main/java/org/jboss/wsf/spi/deployment/ServletDelegate.java 2011-04-14 15:28:36 UTC (rev 14094)
@@ -0,0 +1,61 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * 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.
+ *
+ * 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.deployment;
+
+import java.io.IOException;
+
+import javax.servlet.ServletConfig;
+import javax.servlet.ServletContext;
+import javax.servlet.ServletException;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+/**
+ *
+ * @author alessio.soldano(a)jboss.com
+ * @since 06-Apr-2011
+ *
+ */
+public interface ServletDelegate
+{
+ public void init(ServletConfig servletConfig) throws ServletException;
+
+ public void destroy();
+
+ public void doHead(HttpServletRequest request, HttpServletResponse response, ServletContext context)
+ throws ServletException, IOException;
+
+ public void doGet(HttpServletRequest request, HttpServletResponse response, ServletContext context)
+ throws ServletException, IOException;
+
+ public void doPost(HttpServletRequest request, HttpServletResponse response, ServletContext context)
+ throws ServletException, IOException;
+
+ public void doPut(HttpServletRequest request, HttpServletResponse response, ServletContext context)
+ throws ServletException, IOException;
+
+ public void doDelete(HttpServletRequest request, HttpServletResponse response, ServletContext context)
+ throws ServletException, IOException;
+
+ public void service(HttpServletRequest request, HttpServletResponse response, ServletContext context)
+ throws ServletException, IOException;
+}
Copied: spi/trunk/src/main/java/org/jboss/wsf/spi/deployment/ServletDelegateFactory.java (from rev 14042, spi/branches/asoldano/src/main/java/org/jboss/wsf/spi/deployment/ServletDelegateFactory.java)
===================================================================
--- spi/trunk/src/main/java/org/jboss/wsf/spi/deployment/ServletDelegateFactory.java (rev 0)
+++ spi/trunk/src/main/java/org/jboss/wsf/spi/deployment/ServletDelegateFactory.java 2011-04-14 15:28:36 UTC (rev 14094)
@@ -0,0 +1,34 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * 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.
+ *
+ * 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.deployment;
+
+
+/**
+ *
+ * @author alessio.soldano(a)jboss.com
+ * @since 06-Apr-2011
+ *
+ */
+public interface ServletDelegateFactory
+{
+ public ServletDelegate newServletDelegate(String delegateClassName);
+}
Copied: spi/trunk/src/main/java/org/jboss/wsf/spi/deployment/WSFServlet.java (from rev 14042, spi/branches/asoldano/src/main/java/org/jboss/wsf/spi/deployment/WSFServlet.java)
===================================================================
--- spi/trunk/src/main/java/org/jboss/wsf/spi/deployment/WSFServlet.java (rev 0)
+++ spi/trunk/src/main/java/org/jboss/wsf/spi/deployment/WSFServlet.java 2011-04-14 15:28:36 UTC (rev 14094)
@@ -0,0 +1,153 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * 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.
+ *
+ * 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.deployment;
+
+import java.io.IOException;
+import java.security.AccessController;
+import java.security.PrivilegedAction;
+import java.util.ServiceLoader;
+
+import javax.servlet.ServletConfig;
+import javax.servlet.ServletException;
+import javax.servlet.http.HttpServlet;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+import org.jboss.wsf.spi.classloading.ClassLoaderProvider;
+
+/**
+ *
+ * @author alessio.soldano(a)jboss.com
+ * @since 06-Apr-2011
+ *
+ */
+public class WSFServlet extends HttpServlet
+{
+ public static final String STACK_SERVLET_DELEGATE_CLASS = "org.jboss.wsf.spi.deployment.stackServletDelegateClass";
+
+ private ServletDelegate delegate = null;
+
+ @Override
+ public void init(ServletConfig servletConfig) throws ServletException
+ {
+ super.init(servletConfig);
+ delegate = getDelegate(servletConfig);
+ if (delegate != null)
+ {
+ delegate.init(servletConfig);
+ }
+ }
+
+ /**
+ * Creates a ServletDelegate instance according to the STACK_SERVLET_DELEGATE_CLASS init parameter.
+ * The class is loaded through a ServletDelegateFactory that's retrieved as follows:
+ * - if a default ClassLoaderProvider is available, the webservice subsystem classloader from it
+ * is used to lookup the factory
+ * - otherwise the current thread context classloader is used to lookup the factory.
+ *
+ * @param servletConfig
+ * @return the servlet delegate
+ */
+ protected ServletDelegate getDelegate(ServletConfig servletConfig)
+ {
+ ClassLoaderProvider clProvider = ClassLoaderProvider.getDefaultProvider();
+ ClassLoader cl = clProvider.getWebServiceSubsystemClassLoader();
+ ServiceLoader<ServletDelegateFactory> sl = ServiceLoader.load(ServletDelegateFactory.class, cl);
+ ServletDelegateFactory factory = sl.iterator().next();
+ return factory.newServletDelegate(servletConfig.getInitParameter(STACK_SERVLET_DELEGATE_CLASS));
+ }
+
+ @Override
+ public void destroy()
+ {
+ if (delegate != null)
+ {
+ delegate.destroy();
+ }
+ }
+
+ @Override
+ protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException
+ {
+ if (delegate != null)
+ {
+ delegate.doPost(request, response, getServletContext());
+ }
+ }
+
+ @Override
+ protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException
+ {
+ if (delegate != null)
+ {
+ delegate.doGet(request, response, getServletContext());
+ }
+ }
+
+ @Override
+ protected void doPut(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException
+ {
+ if (delegate != null)
+ {
+ delegate.doPut(request, response, getServletContext());
+ }
+ }
+
+ @Override
+ protected void doDelete(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException
+ {
+ if (delegate != null)
+ {
+ delegate.doDelete(request, response, getServletContext());
+ }
+ }
+
+ @Override
+ protected void doHead(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException
+ {
+ if (delegate != null)
+ {
+ delegate.doHead(request, response, getServletContext());
+ }
+ }
+
+ @Override
+ public void service(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException
+ {
+ if (delegate != null)
+ {
+ delegate.service(request, response, getServletContext());
+ }
+ }
+
+ static ClassLoader getContextClassLoader() {
+ if (System.getSecurityManager() == null) {
+ return Thread.currentThread().getContextClassLoader();
+ } else {
+ return AccessController.doPrivileged(new PrivilegedAction<ClassLoader>() {
+ public ClassLoader run() {
+ return Thread.currentThread().getContextClassLoader();
+ }
+ });
+ }
+ }
+}
13 years
JBossWS SVN: r14093 - in api/trunk: src/main/java/org/jboss/wsf and 5 other directories.
by jbossws-commits@lists.jboss.org
Author: alessio.soldano(a)jboss.com
Date: 2011-04-14 11:25:34 -0400 (Thu, 14 Apr 2011)
New Revision: 14093
Added:
api/trunk/src/main/java/org/jboss/wsf/common/
api/trunk/src/main/java/org/jboss/wsf/common/addressing/
api/trunk/src/main/java/org/jboss/wsf/common/addressing/AddressingConstants.java
api/trunk/src/main/java/org/jboss/wsf/common/addressing/MAP.java
api/trunk/src/main/java/org/jboss/wsf/common/addressing/MAPBuilder.java
api/trunk/src/main/java/org/jboss/wsf/common/addressing/MAPBuilderFactory.java
api/trunk/src/main/java/org/jboss/wsf/common/addressing/MAPConstants.java
api/trunk/src/main/java/org/jboss/wsf/common/addressing/MAPEndpoint.java
api/trunk/src/main/java/org/jboss/wsf/common/addressing/MAPRelatesTo.java
api/trunk/src/main/java/org/jboss/wsf/common/handler/
api/trunk/src/main/java/org/jboss/wsf/common/handler/GenericHandler.java
api/trunk/src/main/java/org/jboss/wsf/common/handler/GenericLogicalHandler.java
api/trunk/src/main/java/org/jboss/wsf/common/handler/GenericSOAPHandler.java
api/trunk/src/main/java/org/jboss/wsf/util/
api/trunk/src/main/java/org/jboss/wsf/util/DOMUtils.java
Removed:
api/trunk/src/main/java/org/jboss/wsf/common/addressing/
api/trunk/src/main/java/org/jboss/wsf/common/addressing/AddressingConstants.java
api/trunk/src/main/java/org/jboss/wsf/common/addressing/MAP.java
api/trunk/src/main/java/org/jboss/wsf/common/addressing/MAPBuilder.java
api/trunk/src/main/java/org/jboss/wsf/common/addressing/MAPBuilderFactory.java
api/trunk/src/main/java/org/jboss/wsf/common/addressing/MAPConstants.java
api/trunk/src/main/java/org/jboss/wsf/common/addressing/MAPEndpoint.java
api/trunk/src/main/java/org/jboss/wsf/common/addressing/MAPRelatesTo.java
api/trunk/src/main/java/org/jboss/wsf/common/handler/
api/trunk/src/main/java/org/jboss/wsf/common/handler/GenericHandler.java
api/trunk/src/main/java/org/jboss/wsf/common/handler/GenericLogicalHandler.java
api/trunk/src/main/java/org/jboss/wsf/common/handler/GenericSOAPHandler.java
api/trunk/src/main/java/org/jboss/wsf/util/DOMUtils.java
Modified:
api/trunk/
api/trunk/src/main/java/org/jboss/wsf/spi/util/ServiceLoader.java
Log:
[JBWS-3224][JBWS-3265] Isolate deployment classloader from ws server integration
Property changes on: api/trunk
___________________________________________________________________
Added: svn:mergeinfo
+ /api/branches/asoldano:14023-14041
Deleted: api/trunk/src/main/java/org/jboss/wsf/common/addressing/AddressingConstants.java
===================================================================
--- api/branches/asoldano/src/main/java/org/jboss/wsf/common/addressing/AddressingConstants.java 2011-04-08 15:48:56 UTC (rev 14041)
+++ api/trunk/src/main/java/org/jboss/wsf/common/addressing/AddressingConstants.java 2011-04-14 15:25:34 UTC (rev 14093)
@@ -1,272 +0,0 @@
-/*
- * 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.common.addressing;
-
-import javax.xml.namespace.QName;
-
-/**
- * TODO: see javax.xml.ws.addressing - merge it properly
- * Addressing constants.
- *
- * @author <a href="mailto:ropalka@redhat.com">Richard Opalka</a>
- */
-public final class AddressingConstants
-{
- /**
- * Constructor.
- */
- private AddressingConstants()
- {
- // forbidden inheritance
- }
-
- /**
- * <a href="http://www.w3.org/2005/08/addressing">WSA</a> constants.
- */
- public static final class Core
- {
- /**
- * Constructor.
- */
- private Core()
- {
- // forbidden inheritance
- }
-
- // WSA namespace
- public static final String NS = "http://www.w3.org/2005/08/addressing";
-
- // WSA prefix
- public static final String NS_PREFIX = "wsa";
-
- public static final class Elements
- {
- /**
- * Constructor.
- */
- private Elements()
- {
- // forbidden inheritance
- }
-
- // WSA 'EndpointReference' element
- public static final String ENDPOINTREFERENCE = "EndpointReference";
- public static final QName ENDPOINTREFERENCE_QNAME = new QName(NS, ENDPOINTREFERENCE, NS_PREFIX);
-
- // WSA 'ReferenceParameters' element
- public static final String REFERENCEPARAMETERS = "ReferenceParameters";
- public static final QName REFERENCEPARAMETERS_QNAME = new QName(NS, REFERENCEPARAMETERS, NS_PREFIX);
-
- // WSA 'Metadata' element
- public static final String METADATA = "Metadata";
- public static final QName METADATA_QNAME = new QName(NS, METADATA, NS_PREFIX);
-
- // WSA 'Address' element
- public static final String ADDRESS = "Address";
- public static final QName ADDRESS_QNAME = new QName(NS, ADDRESS, NS_PREFIX);
-
- // WSA 'MessageID' element
- public static final String MESSAGEID = "MessageID";
- public static final QName MESSAGEID_QNAME = new QName(NS, MESSAGEID, NS_PREFIX);
-
- // WSA 'RelatesTo' element
- public static final String RELATESTO = "RelatesTo";
- public static final QName RELATESTO_QNAME = new QName(NS, RELATESTO, NS_PREFIX);
-
- // WSA 'ReplyTo' element
- public static final String REPLYTO = "ReplyTo";
- public static final QName REPLYTO_QNAME = new QName(NS, REPLYTO, NS_PREFIX);
-
- // WSA 'From' element
- public static final String FROM = "From";
- public static final QName FROM_QNAME = new QName(NS, FROM, NS_PREFIX);
-
- // WSA 'FaultTo' element
- public static final String FAULTTO = "FaultTo";
- public static final QName FAULTTO_QNAME = new QName(NS, FAULTTO, NS_PREFIX);
-
- // WSA 'To' element
- public static final String TO = "To";
- public static final QName TO_QNAME = new QName(NS, TO, NS_PREFIX);
-
- // WSA 'Action' element
- public static final String ACTION = "Action";
- public static final QName ACTION_QNAME = new QName(NS, ACTION, NS_PREFIX);
-
- // WSA 'RetryAfter' element
- public static final String RETRYAFTER = "RetryAfter";
- public static final QName RETRYAFTER_QNAME = new QName(NS, RETRYAFTER, NS_PREFIX);
-
- // WSA 'ProblemHeaderQName' element
- public static final String PROBLEMHEADERQNAME = "ProblemHeaderQName";
- public static final QName PROBLEMHEADERQNAME_QNAME = new QName(NS, PROBLEMHEADERQNAME, NS_PREFIX);
-
- // WSA 'ProblemIRI' element
- public static final String PROBLEMIRI = "ProblemIRI";
- public static final QName PROBLEMIRI_QNAME = new QName(NS, PROBLEMIRI, NS_PREFIX);
-
- // WSA 'ProblemAction' element
- public static final String PROBLEMACTION = "ProblemAction";
- public static final QName PROBLEMACTION_QNAME = new QName(NS, PROBLEMACTION, NS_PREFIX);
-
- // WSA 'SoapAction' element
- public static final String SOAPACTION = "SoapAction";
- public static final QName SOAPACTION_QNAME = new QName(NS, SOAPACTION, NS_PREFIX);
- }
-
- public static final class Attributes
- {
- /**
- * Constructor.
- */
- private Attributes()
- {
- // forbidden inheritance
- }
-
- // WSA 'RelationshipType' attribute
- public static final String RELATIONSHIPTYPE = "RelationshipType";
- public static final QName RELATIONSHIPTYPE_QNAME = new QName(NS, RELATIONSHIPTYPE, NS_PREFIX);
-
- // WSA 'IsReferenceParameter' attribute
- public static final String ISREFERENCEPARAMETER = "IsReferenceParameter";
- public static final QName ISREFERENCEPARAMETER_QNAME = new QName(NS, ISREFERENCEPARAMETER, NS_PREFIX);
-
- }
-
- public static final class Faults
- {
- /**
- * Constructor.
- */
- private Faults()
- {
- // forbidden inheritance
- }
-
- // WSA 'InvalidAddressingHeader' fault
- public static final QName INVALIDADDRESSINGHEADER_QNAME = new QName(NS, "InvalidAddressingHeader", NS_PREFIX);
-
- // WSA 'InvalidAddress' fault
- public static final QName INVALIDADDRESS_QNAME = new QName(NS, "InvalidAddress", NS_PREFIX);
-
- // WSA 'InvalidEPR' fault
- public static final QName INVALIDEPR_QNAME = new QName(NS, "InvalidEPR", NS_PREFIX);
-
- // WSA 'InvalidCardinality' fault
- public static final QName INVALIDCARDINALITY_QNAME = new QName(NS, "InvalidCardinality", NS_PREFIX);
-
- // WSA 'MissingAddressInEPR' fault
- public static final QName MISSINGADDRESSINEPR_QNAME = new QName(NS, "MissingAddressInEPR", NS_PREFIX);
-
- // WSA 'DuplicateMessageID' fault
- public static final QName DUPLICATEMESSAGEID_QNAME = new QName(NS, "DuplicateMessageID", NS_PREFIX);
-
- // WSA 'ActionMismatch' fault
- public static final QName ACTIONMISMATCH_QNAME = new QName(NS, "ActionMismatch", NS_PREFIX);
-
- // WSA 'MessageAddressingHeaderRequired' fault
- public static final QName MESSAGEADDRESSINGHEADERREQUIRED_QNAME = new QName(NS, "MessageAddressingHeaderRequired", NS_PREFIX);
-
- // WSA 'DestinationUnreachable' fault
- public static final QName DESTINATIONUNREACHABLE_QNAME = new QName(NS, "DestinationUnreachable", NS_PREFIX);
-
- // WSA 'ActionNotSupported' fault
- public static final QName ACTIONNOTSUPPORTED_QNAME = new QName(NS, "ActionNotSupported", NS_PREFIX);
-
- // WSA 'EndpointUnavailable' fault
- public static final QName ENDPOINTUNAVAILABLE_QNAME = new QName(NS, "EndpointUnavailable", NS_PREFIX);
- }
- }
-
- /**
- * <a href="http://www.w3.org/2007/05/addressing/metadata">WSAM</a> constants.
- */
- public static final class Metadata
- {
- /**
- * Constructor.
- */
- private Metadata()
- {
- // forbidden inheritance
- }
-
- // WSAM namespace
- public static final String NS = "http://www.w3.org/2007/05/addressing/metadata";
-
- // WSAM prefix
- public static final String NS_PREFIX = "wsam";
-
- public static final class Elements
- {
- /**
- * Constructor.
- */
- private Elements()
- {
- // forbidden inheritance
- }
-
- // WSAM 'ServiceName' element
- public static final String SERVICENAME = "ServiceName";
- public static final QName SERVICENAME_QNAME = new QName(NS, SERVICENAME, NS_PREFIX);
-
- // WSAM 'InterfaceName' element
- public static final String INTERFACENAME = "InterfaceName";
- public static final QName INTERFACENAME_QNAME = new QName(NS, INTERFACENAME, NS_PREFIX);
-
- // WSAM 'Addressing' element
- public static final String ADDRESSING = "Addressing";
- public static final QName ADDRESSING_QNAME = new QName(NS, ADDRESSING, NS_PREFIX);
-
- // WSAM 'AnonymousResponses' element
- public static final String ANONYMOUSRESPONSES = "AnonymousResponses";
- public static final QName ANONYMOUSRESPONSES_QNAME = new QName(NS, ANONYMOUSRESPONSES, NS_PREFIX);
-
- // WSAM 'NonAnonymousResponses' element
- public static final String NONANONYMOUSRESPONSES = "NonAnonymousResponses";
- public static final QName NONANONYMOUSRESPONSES_QNAME = new QName(NS, NONANONYMOUSRESPONSES, NS_PREFIX);
- }
-
- public static final class Attributes
- {
- /**
- * Constructor.
- */
- private Attributes()
- {
- // forbidden inheritance
- }
-
- // WSAM 'EndpointName' attribute
- public static final String ENDPOINTNAME = "EndpointName";
- public static final QName ENDPOINTNAME_QNAME = new QName(NS, ENDPOINTNAME, NS_PREFIX);
-
- // WSAM 'Action' attribute
- public static final String ACTION = "Action";
- public static final QName ACTION_QNAME = new QName(NS, ACTION, NS_PREFIX);
-
- }
- }
-
-}
Copied: api/trunk/src/main/java/org/jboss/wsf/common/addressing/AddressingConstants.java (from rev 14041, api/branches/asoldano/src/main/java/org/jboss/wsf/common/addressing/AddressingConstants.java)
===================================================================
--- api/trunk/src/main/java/org/jboss/wsf/common/addressing/AddressingConstants.java (rev 0)
+++ api/trunk/src/main/java/org/jboss/wsf/common/addressing/AddressingConstants.java 2011-04-14 15:25:34 UTC (rev 14093)
@@ -0,0 +1,272 @@
+/*
+ * 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.common.addressing;
+
+import javax.xml.namespace.QName;
+
+/**
+ * TODO: see javax.xml.ws.addressing - merge it properly
+ * Addressing constants.
+ *
+ * @author <a href="mailto:ropalka@redhat.com">Richard Opalka</a>
+ */
+public final class AddressingConstants
+{
+ /**
+ * Constructor.
+ */
+ private AddressingConstants()
+ {
+ // forbidden inheritance
+ }
+
+ /**
+ * <a href="http://www.w3.org/2005/08/addressing">WSA</a> constants.
+ */
+ public static final class Core
+ {
+ /**
+ * Constructor.
+ */
+ private Core()
+ {
+ // forbidden inheritance
+ }
+
+ // WSA namespace
+ public static final String NS = "http://www.w3.org/2005/08/addressing";
+
+ // WSA prefix
+ public static final String NS_PREFIX = "wsa";
+
+ public static final class Elements
+ {
+ /**
+ * Constructor.
+ */
+ private Elements()
+ {
+ // forbidden inheritance
+ }
+
+ // WSA 'EndpointReference' element
+ public static final String ENDPOINTREFERENCE = "EndpointReference";
+ public static final QName ENDPOINTREFERENCE_QNAME = new QName(NS, ENDPOINTREFERENCE, NS_PREFIX);
+
+ // WSA 'ReferenceParameters' element
+ public static final String REFERENCEPARAMETERS = "ReferenceParameters";
+ public static final QName REFERENCEPARAMETERS_QNAME = new QName(NS, REFERENCEPARAMETERS, NS_PREFIX);
+
+ // WSA 'Metadata' element
+ public static final String METADATA = "Metadata";
+ public static final QName METADATA_QNAME = new QName(NS, METADATA, NS_PREFIX);
+
+ // WSA 'Address' element
+ public static final String ADDRESS = "Address";
+ public static final QName ADDRESS_QNAME = new QName(NS, ADDRESS, NS_PREFIX);
+
+ // WSA 'MessageID' element
+ public static final String MESSAGEID = "MessageID";
+ public static final QName MESSAGEID_QNAME = new QName(NS, MESSAGEID, NS_PREFIX);
+
+ // WSA 'RelatesTo' element
+ public static final String RELATESTO = "RelatesTo";
+ public static final QName RELATESTO_QNAME = new QName(NS, RELATESTO, NS_PREFIX);
+
+ // WSA 'ReplyTo' element
+ public static final String REPLYTO = "ReplyTo";
+ public static final QName REPLYTO_QNAME = new QName(NS, REPLYTO, NS_PREFIX);
+
+ // WSA 'From' element
+ public static final String FROM = "From";
+ public static final QName FROM_QNAME = new QName(NS, FROM, NS_PREFIX);
+
+ // WSA 'FaultTo' element
+ public static final String FAULTTO = "FaultTo";
+ public static final QName FAULTTO_QNAME = new QName(NS, FAULTTO, NS_PREFIX);
+
+ // WSA 'To' element
+ public static final String TO = "To";
+ public static final QName TO_QNAME = new QName(NS, TO, NS_PREFIX);
+
+ // WSA 'Action' element
+ public static final String ACTION = "Action";
+ public static final QName ACTION_QNAME = new QName(NS, ACTION, NS_PREFIX);
+
+ // WSA 'RetryAfter' element
+ public static final String RETRYAFTER = "RetryAfter";
+ public static final QName RETRYAFTER_QNAME = new QName(NS, RETRYAFTER, NS_PREFIX);
+
+ // WSA 'ProblemHeaderQName' element
+ public static final String PROBLEMHEADERQNAME = "ProblemHeaderQName";
+ public static final QName PROBLEMHEADERQNAME_QNAME = new QName(NS, PROBLEMHEADERQNAME, NS_PREFIX);
+
+ // WSA 'ProblemIRI' element
+ public static final String PROBLEMIRI = "ProblemIRI";
+ public static final QName PROBLEMIRI_QNAME = new QName(NS, PROBLEMIRI, NS_PREFIX);
+
+ // WSA 'ProblemAction' element
+ public static final String PROBLEMACTION = "ProblemAction";
+ public static final QName PROBLEMACTION_QNAME = new QName(NS, PROBLEMACTION, NS_PREFIX);
+
+ // WSA 'SoapAction' element
+ public static final String SOAPACTION = "SoapAction";
+ public static final QName SOAPACTION_QNAME = new QName(NS, SOAPACTION, NS_PREFIX);
+ }
+
+ public static final class Attributes
+ {
+ /**
+ * Constructor.
+ */
+ private Attributes()
+ {
+ // forbidden inheritance
+ }
+
+ // WSA 'RelationshipType' attribute
+ public static final String RELATIONSHIPTYPE = "RelationshipType";
+ public static final QName RELATIONSHIPTYPE_QNAME = new QName(NS, RELATIONSHIPTYPE, NS_PREFIX);
+
+ // WSA 'IsReferenceParameter' attribute
+ public static final String ISREFERENCEPARAMETER = "IsReferenceParameter";
+ public static final QName ISREFERENCEPARAMETER_QNAME = new QName(NS, ISREFERENCEPARAMETER, NS_PREFIX);
+
+ }
+
+ public static final class Faults
+ {
+ /**
+ * Constructor.
+ */
+ private Faults()
+ {
+ // forbidden inheritance
+ }
+
+ // WSA 'InvalidAddressingHeader' fault
+ public static final QName INVALIDADDRESSINGHEADER_QNAME = new QName(NS, "InvalidAddressingHeader", NS_PREFIX);
+
+ // WSA 'InvalidAddress' fault
+ public static final QName INVALIDADDRESS_QNAME = new QName(NS, "InvalidAddress", NS_PREFIX);
+
+ // WSA 'InvalidEPR' fault
+ public static final QName INVALIDEPR_QNAME = new QName(NS, "InvalidEPR", NS_PREFIX);
+
+ // WSA 'InvalidCardinality' fault
+ public static final QName INVALIDCARDINALITY_QNAME = new QName(NS, "InvalidCardinality", NS_PREFIX);
+
+ // WSA 'MissingAddressInEPR' fault
+ public static final QName MISSINGADDRESSINEPR_QNAME = new QName(NS, "MissingAddressInEPR", NS_PREFIX);
+
+ // WSA 'DuplicateMessageID' fault
+ public static final QName DUPLICATEMESSAGEID_QNAME = new QName(NS, "DuplicateMessageID", NS_PREFIX);
+
+ // WSA 'ActionMismatch' fault
+ public static final QName ACTIONMISMATCH_QNAME = new QName(NS, "ActionMismatch", NS_PREFIX);
+
+ // WSA 'MessageAddressingHeaderRequired' fault
+ public static final QName MESSAGEADDRESSINGHEADERREQUIRED_QNAME = new QName(NS, "MessageAddressingHeaderRequired", NS_PREFIX);
+
+ // WSA 'DestinationUnreachable' fault
+ public static final QName DESTINATIONUNREACHABLE_QNAME = new QName(NS, "DestinationUnreachable", NS_PREFIX);
+
+ // WSA 'ActionNotSupported' fault
+ public static final QName ACTIONNOTSUPPORTED_QNAME = new QName(NS, "ActionNotSupported", NS_PREFIX);
+
+ // WSA 'EndpointUnavailable' fault
+ public static final QName ENDPOINTUNAVAILABLE_QNAME = new QName(NS, "EndpointUnavailable", NS_PREFIX);
+ }
+ }
+
+ /**
+ * <a href="http://www.w3.org/2007/05/addressing/metadata">WSAM</a> constants.
+ */
+ public static final class Metadata
+ {
+ /**
+ * Constructor.
+ */
+ private Metadata()
+ {
+ // forbidden inheritance
+ }
+
+ // WSAM namespace
+ public static final String NS = "http://www.w3.org/2007/05/addressing/metadata";
+
+ // WSAM prefix
+ public static final String NS_PREFIX = "wsam";
+
+ public static final class Elements
+ {
+ /**
+ * Constructor.
+ */
+ private Elements()
+ {
+ // forbidden inheritance
+ }
+
+ // WSAM 'ServiceName' element
+ public static final String SERVICENAME = "ServiceName";
+ public static final QName SERVICENAME_QNAME = new QName(NS, SERVICENAME, NS_PREFIX);
+
+ // WSAM 'InterfaceName' element
+ public static final String INTERFACENAME = "InterfaceName";
+ public static final QName INTERFACENAME_QNAME = new QName(NS, INTERFACENAME, NS_PREFIX);
+
+ // WSAM 'Addressing' element
+ public static final String ADDRESSING = "Addressing";
+ public static final QName ADDRESSING_QNAME = new QName(NS, ADDRESSING, NS_PREFIX);
+
+ // WSAM 'AnonymousResponses' element
+ public static final String ANONYMOUSRESPONSES = "AnonymousResponses";
+ public static final QName ANONYMOUSRESPONSES_QNAME = new QName(NS, ANONYMOUSRESPONSES, NS_PREFIX);
+
+ // WSAM 'NonAnonymousResponses' element
+ public static final String NONANONYMOUSRESPONSES = "NonAnonymousResponses";
+ public static final QName NONANONYMOUSRESPONSES_QNAME = new QName(NS, NONANONYMOUSRESPONSES, NS_PREFIX);
+ }
+
+ public static final class Attributes
+ {
+ /**
+ * Constructor.
+ */
+ private Attributes()
+ {
+ // forbidden inheritance
+ }
+
+ // WSAM 'EndpointName' attribute
+ public static final String ENDPOINTNAME = "EndpointName";
+ public static final QName ENDPOINTNAME_QNAME = new QName(NS, ENDPOINTNAME, NS_PREFIX);
+
+ // WSAM 'Action' attribute
+ public static final String ACTION = "Action";
+ public static final QName ACTION_QNAME = new QName(NS, ACTION, NS_PREFIX);
+
+ }
+ }
+
+}
Deleted: api/trunk/src/main/java/org/jboss/wsf/common/addressing/MAP.java
===================================================================
--- api/branches/asoldano/src/main/java/org/jboss/wsf/common/addressing/MAP.java 2011-04-08 15:48:56 UTC (rev 14041)
+++ api/trunk/src/main/java/org/jboss/wsf/common/addressing/MAP.java 2011-04-14 15:25:34 UTC (rev 14093)
@@ -1,78 +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.common.addressing;
-
-import java.util.List;
-import java.util.Map;
-
-import org.w3c.dom.Element;
-
-/**
- * Message Addressing Properties is a wrapper for the stack-specific JSR-261 addressing properties
- * classes implemented by JBossWS Native and CXF. It is used to localize dependence upon the WS
- * stack.
- *
- * @author Andrew Dinn (adinn(a)redhat.com)
- * @author alessio.soldano(a)jboss.com
- *
- */
-public interface MAP
-{
- public String getTo();
-
- public MAPEndpoint getFrom();
-
- public String getMessageID();
-
- public String getAction();
-
- public MAPEndpoint getFaultTo();
-
- public MAPEndpoint getReplyTo();
-
- public MAPRelatesTo getRelatesTo();
-
- public void setTo(String address);
-
- public void setFrom(MAPEndpoint epref);
-
- public void setMessageID(String messageID);
-
- public void setAction(String action);
-
- public void setReplyTo(MAPEndpoint epref);
-
- public void setFaultTo(MAPEndpoint epref);
-
- public void setRelatesTo(MAPRelatesTo relatesTo);
-
- public void addReferenceParameter(Element refParam);
-
- public List<Object> getReferenceParameters();
-
- public void initializeAsDestination(MAPEndpoint epref);
-
- public void installOutboundMapOnServerSide(Map<String, Object> requestContext, MAP map);
-
- public void installOutboundMapOnClientSide(Map<String, Object> requestContext, MAP map);
-
-}
Copied: api/trunk/src/main/java/org/jboss/wsf/common/addressing/MAP.java (from rev 14041, api/branches/asoldano/src/main/java/org/jboss/wsf/common/addressing/MAP.java)
===================================================================
--- api/trunk/src/main/java/org/jboss/wsf/common/addressing/MAP.java (rev 0)
+++ api/trunk/src/main/java/org/jboss/wsf/common/addressing/MAP.java 2011-04-14 15:25:34 UTC (rev 14093)
@@ -0,0 +1,78 @@
+/*
+ * 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.common.addressing;
+
+import java.util.List;
+import java.util.Map;
+
+import org.w3c.dom.Element;
+
+/**
+ * Message Addressing Properties is a wrapper for the stack-specific JSR-261 addressing properties
+ * classes implemented by JBossWS Native and CXF. It is used to localize dependence upon the WS
+ * stack.
+ *
+ * @author Andrew Dinn (adinn(a)redhat.com)
+ * @author alessio.soldano(a)jboss.com
+ *
+ */
+public interface MAP
+{
+ public String getTo();
+
+ public MAPEndpoint getFrom();
+
+ public String getMessageID();
+
+ public String getAction();
+
+ public MAPEndpoint getFaultTo();
+
+ public MAPEndpoint getReplyTo();
+
+ public MAPRelatesTo getRelatesTo();
+
+ public void setTo(String address);
+
+ public void setFrom(MAPEndpoint epref);
+
+ public void setMessageID(String messageID);
+
+ public void setAction(String action);
+
+ public void setReplyTo(MAPEndpoint epref);
+
+ public void setFaultTo(MAPEndpoint epref);
+
+ public void setRelatesTo(MAPRelatesTo relatesTo);
+
+ public void addReferenceParameter(Element refParam);
+
+ public List<Object> getReferenceParameters();
+
+ public void initializeAsDestination(MAPEndpoint epref);
+
+ public void installOutboundMapOnServerSide(Map<String, Object> requestContext, MAP map);
+
+ public void installOutboundMapOnClientSide(Map<String, Object> requestContext, MAP map);
+
+}
Deleted: api/trunk/src/main/java/org/jboss/wsf/common/addressing/MAPBuilder.java
===================================================================
--- api/branches/asoldano/src/main/java/org/jboss/wsf/common/addressing/MAPBuilder.java 2011-04-08 15:48:56 UTC (rev 14041)
+++ api/trunk/src/main/java/org/jboss/wsf/common/addressing/MAPBuilder.java 2011-04-14 15:25:34 UTC (rev 14093)
@@ -1,60 +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.common.addressing;
-
-import java.util.Map;
-
-import javax.xml.namespace.QName;
-import javax.xml.ws.handler.MessageContext;
-
-/**
- * MAPBuilder is a helper used to create objects used with class MAP.
- *
- * @author Andrew Dinn (adinn(a)redhat.com)
- * @author alessio.soldano(a)jboss.com
- *
- */
-public interface MAPBuilder
-{
- public MAP newMap();
-
- /**
- * retrieve the inbound server message address properties attached to a message context
- * @param ctx the server message context
- * @return
- */
- public MAP inboundMap(Map<String, Object> ctx);
-
- /**
- * retrieve the outbound client message address properties attached to a message request map
- * @param ctx the client request properties map
- * @return
- */
- public MAP outboundMap(Map<String, Object> ctx);
-
- public MAPConstants newConstants();
-
- public MAPEndpoint newEndpoint(String address);
-
- public MAPRelatesTo newRelatesTo(String id, QName type);
-
-}
Copied: api/trunk/src/main/java/org/jboss/wsf/common/addressing/MAPBuilder.java (from rev 14041, api/branches/asoldano/src/main/java/org/jboss/wsf/common/addressing/MAPBuilder.java)
===================================================================
--- api/trunk/src/main/java/org/jboss/wsf/common/addressing/MAPBuilder.java (rev 0)
+++ api/trunk/src/main/java/org/jboss/wsf/common/addressing/MAPBuilder.java 2011-04-14 15:25:34 UTC (rev 14093)
@@ -0,0 +1,60 @@
+/*
+ * 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.common.addressing;
+
+import java.util.Map;
+
+import javax.xml.namespace.QName;
+import javax.xml.ws.handler.MessageContext;
+
+/**
+ * MAPBuilder is a helper used to create objects used with class MAP.
+ *
+ * @author Andrew Dinn (adinn(a)redhat.com)
+ * @author alessio.soldano(a)jboss.com
+ *
+ */
+public interface MAPBuilder
+{
+ public MAP newMap();
+
+ /**
+ * retrieve the inbound server message address properties attached to a message context
+ * @param ctx the server message context
+ * @return
+ */
+ public MAP inboundMap(Map<String, Object> ctx);
+
+ /**
+ * retrieve the outbound client message address properties attached to a message request map
+ * @param ctx the client request properties map
+ * @return
+ */
+ public MAP outboundMap(Map<String, Object> ctx);
+
+ public MAPConstants newConstants();
+
+ public MAPEndpoint newEndpoint(String address);
+
+ public MAPRelatesTo newRelatesTo(String id, QName type);
+
+}
Deleted: api/trunk/src/main/java/org/jboss/wsf/common/addressing/MAPBuilderFactory.java
===================================================================
--- api/branches/asoldano/src/main/java/org/jboss/wsf/common/addressing/MAPBuilderFactory.java 2011-04-08 15:48:56 UTC (rev 14041)
+++ api/trunk/src/main/java/org/jboss/wsf/common/addressing/MAPBuilderFactory.java 2011-04-14 15:25:34 UTC (rev 14093)
@@ -1,144 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * 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.
- *
- * 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.common.addressing;
-
-import java.security.AccessController;
-import java.security.PrivilegedAction;
-
-import org.jboss.logging.Logger;
-import org.jboss.wsf.spi.util.ServiceLoader;
-
-/**
- * Factory for MAPBuilder; to be used to get an instance of the proper MAPBuilder
- * implementation which depends on the jbossws stack in use.
- *
- * @author alessio.soldano(a)jboss.com
- * @since 25-May-2009
- *
- */
-public abstract class MAPBuilderFactory
-{
- private static final String CLASSLOADER_PROVIDER = "org.jboss.wsf.spi.classloading.ClassLoaderProvider";
- private static final String CLASSLOADER_PROVIDER_GET_METHOD = "getDefaultProvider";
- private static final String CLASSLOADER_PROVIDER_GET_CL_METHOD = "getServerIntegrationClassLoader";
- private static final String JBOSSWS_SPI_MODULE = "org.jboss.ws.spi";
-
- /**
- * Get the proper MAPBuilderFactory instance according to stack in use;
- * this uses the ws server integration modular classloader if available
- * (alternatively the current thread context classloader is used) for
- * looking up the factory name.
- *
- * @return
- */
- public static MAPBuilderFactory getInstance()
- {
- return getInstance(getServerIntegrationClassLoader());
- }
-
- /**
- * The same as getInstance() except the provided ClassLoader instance
- * is used to lookup the factory name.
- *
- * @param loader
- * @return
- */
- public static MAPBuilderFactory getInstance(ClassLoader loader)
- {
- return (MAPBuilderFactory)ServiceLoader.loadService(MAPBuilderFactory.class.getName(), null, loader);
- }
-
- public abstract MAPBuilder getBuilderInstance();
-
- private static ClassLoader getServerIntegrationClassLoader()
- {
- ClassLoader cl = null;
- try
- {
- //if jboss-modules is available (i.e. AS7 in-container) we get the org.jboss.ws.spi:main module first,
- //the we use the ClassLoaderProvider facilities for getting the integration classloader.
- //The reason for going this way is in not exposing the ClassLoaderProvider to the public API,
- //while MAPBuilderFactory needs to work automatically (no need to specify the loader to use)
- final ClassLoader spiLoader = getSPIClassLoader();
- if (spiLoader != null)
- {
- final Class<?> clazz = spiLoader.loadClass(CLASSLOADER_PROVIDER);
- final Object clProvider = clazz.getMethod(CLASSLOADER_PROVIDER_GET_METHOD).invoke(null);
- cl = (ClassLoader)clazz.getMethod(CLASSLOADER_PROVIDER_GET_CL_METHOD).invoke(clProvider);
- }
- }
- catch (RuntimeException re)
- {
- throw re;
- }
- catch (Exception e)
- {
- throw new RuntimeException(e);
- }
- return (cl != null) ? cl : getContextClassLoader();
- }
-
- private static ClassLoader getSPIClassLoader()
- {
- ClassLoader moduleClassLoader = null;
- try {
- Class<?> moduleClass = Class.forName("org.jboss.modules.Module");
- Class<?> moduleIdentifierClass = Class.forName("org.jboss.modules.ModuleIdentifier");
- Class<?> moduleLoaderClass = Class.forName("org.jboss.modules.ModuleLoader");
- Object moduleLoader = moduleClass.getMethod("getBootModuleLoader").invoke(null);
- Object moduleIdentifier = moduleIdentifierClass.getMethod("create", String.class).invoke(null, JBOSSWS_SPI_MODULE);
- Object module = moduleLoaderClass.getMethod("loadModule", moduleIdentifierClass).invoke(moduleLoader, moduleIdentifier);
- moduleClassLoader = (ClassLoader)moduleClass.getMethod("getClassLoader").invoke(module);
- } catch (Exception e) {
- //ignore, JBoss Modules might not be available at all
- Logger log = Logger.getLogger(MAPBuilderFactory.class);
- if (log.isTraceEnabled())
- {
- log.trace("Could not get " + JBOSSWS_SPI_MODULE + " module classloader: ", e);
- }
- }
- return moduleClassLoader;
- }
-
- /**
- * Get context classloader.
- *
- * @return the current context classloader
- */
- static ClassLoader getContextClassLoader()
- {
- SecurityManager sm = System.getSecurityManager();
- if (sm == null)
- {
- return Thread.currentThread().getContextClassLoader();
- }
- else
- {
- return AccessController.doPrivileged(new PrivilegedAction<ClassLoader>() {
- public ClassLoader run()
- {
- return Thread.currentThread().getContextClassLoader();
- }
- });
- }
- }
-}
Copied: api/trunk/src/main/java/org/jboss/wsf/common/addressing/MAPBuilderFactory.java (from rev 14041, api/branches/asoldano/src/main/java/org/jboss/wsf/common/addressing/MAPBuilderFactory.java)
===================================================================
--- api/trunk/src/main/java/org/jboss/wsf/common/addressing/MAPBuilderFactory.java (rev 0)
+++ api/trunk/src/main/java/org/jboss/wsf/common/addressing/MAPBuilderFactory.java 2011-04-14 15:25:34 UTC (rev 14093)
@@ -0,0 +1,144 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * 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.
+ *
+ * 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.common.addressing;
+
+import java.security.AccessController;
+import java.security.PrivilegedAction;
+
+import org.jboss.logging.Logger;
+import org.jboss.wsf.spi.util.ServiceLoader;
+
+/**
+ * Factory for MAPBuilder; to be used to get an instance of the proper MAPBuilder
+ * implementation which depends on the jbossws stack in use.
+ *
+ * @author alessio.soldano(a)jboss.com
+ * @since 25-May-2009
+ *
+ */
+public abstract class MAPBuilderFactory
+{
+ private static final String CLASSLOADER_PROVIDER = "org.jboss.wsf.spi.classloading.ClassLoaderProvider";
+ private static final String CLASSLOADER_PROVIDER_GET_METHOD = "getDefaultProvider";
+ private static final String CLASSLOADER_PROVIDER_GET_CL_METHOD = "getServerIntegrationClassLoader";
+ private static final String JBOSSWS_SPI_MODULE = "org.jboss.ws.spi";
+
+ /**
+ * Get the proper MAPBuilderFactory instance according to stack in use;
+ * this uses the ws server integration modular classloader if available
+ * (alternatively the current thread context classloader is used) for
+ * looking up the factory name.
+ *
+ * @return
+ */
+ public static MAPBuilderFactory getInstance()
+ {
+ return getInstance(getServerIntegrationClassLoader());
+ }
+
+ /**
+ * The same as getInstance() except the provided ClassLoader instance
+ * is used to lookup the factory name.
+ *
+ * @param loader
+ * @return
+ */
+ public static MAPBuilderFactory getInstance(ClassLoader loader)
+ {
+ return (MAPBuilderFactory)ServiceLoader.loadService(MAPBuilderFactory.class.getName(), null, loader);
+ }
+
+ public abstract MAPBuilder getBuilderInstance();
+
+ private static ClassLoader getServerIntegrationClassLoader()
+ {
+ ClassLoader cl = null;
+ try
+ {
+ //if jboss-modules is available (i.e. AS7 in-container) we get the org.jboss.ws.spi:main module first,
+ //the we use the ClassLoaderProvider facilities for getting the integration classloader.
+ //The reason for going this way is in not exposing the ClassLoaderProvider to the public API,
+ //while MAPBuilderFactory needs to work automatically (no need to specify the loader to use)
+ final ClassLoader spiLoader = getSPIClassLoader();
+ if (spiLoader != null)
+ {
+ final Class<?> clazz = spiLoader.loadClass(CLASSLOADER_PROVIDER);
+ final Object clProvider = clazz.getMethod(CLASSLOADER_PROVIDER_GET_METHOD).invoke(null);
+ cl = (ClassLoader)clazz.getMethod(CLASSLOADER_PROVIDER_GET_CL_METHOD).invoke(clProvider);
+ }
+ }
+ catch (RuntimeException re)
+ {
+ throw re;
+ }
+ catch (Exception e)
+ {
+ throw new RuntimeException(e);
+ }
+ return (cl != null) ? cl : getContextClassLoader();
+ }
+
+ private static ClassLoader getSPIClassLoader()
+ {
+ ClassLoader moduleClassLoader = null;
+ try {
+ Class<?> moduleClass = Class.forName("org.jboss.modules.Module");
+ Class<?> moduleIdentifierClass = Class.forName("org.jboss.modules.ModuleIdentifier");
+ Class<?> moduleLoaderClass = Class.forName("org.jboss.modules.ModuleLoader");
+ Object moduleLoader = moduleClass.getMethod("getBootModuleLoader").invoke(null);
+ Object moduleIdentifier = moduleIdentifierClass.getMethod("create", String.class).invoke(null, JBOSSWS_SPI_MODULE);
+ Object module = moduleLoaderClass.getMethod("loadModule", moduleIdentifierClass).invoke(moduleLoader, moduleIdentifier);
+ moduleClassLoader = (ClassLoader)moduleClass.getMethod("getClassLoader").invoke(module);
+ } catch (Exception e) {
+ //ignore, JBoss Modules might not be available at all
+ Logger log = Logger.getLogger(MAPBuilderFactory.class);
+ if (log.isTraceEnabled())
+ {
+ log.trace("Could not get " + JBOSSWS_SPI_MODULE + " module classloader: ", e);
+ }
+ }
+ return moduleClassLoader;
+ }
+
+ /**
+ * Get context classloader.
+ *
+ * @return the current context classloader
+ */
+ static ClassLoader getContextClassLoader()
+ {
+ SecurityManager sm = System.getSecurityManager();
+ if (sm == null)
+ {
+ return Thread.currentThread().getContextClassLoader();
+ }
+ else
+ {
+ return AccessController.doPrivileged(new PrivilegedAction<ClassLoader>() {
+ public ClassLoader run()
+ {
+ return Thread.currentThread().getContextClassLoader();
+ }
+ });
+ }
+ }
+}
Deleted: api/trunk/src/main/java/org/jboss/wsf/common/addressing/MAPConstants.java
===================================================================
--- api/branches/asoldano/src/main/java/org/jboss/wsf/common/addressing/MAPConstants.java 2011-04-08 15:48:56 UTC (rev 14041)
+++ api/trunk/src/main/java/org/jboss/wsf/common/addressing/MAPConstants.java 2011-04-14 15:25:34 UTC (rev 14093)
@@ -1,47 +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.common.addressing;
-
-/**
- * MAPConstants is a wrapper which works with class MAP
- *
- * @author Andrew Dinn (adinn(a)redhat.com)
- * @author alessio.soldano(a)jboss.com
- *
- */
-public interface MAPConstants
-{
- public String getAnonymousURI();
-
- public String getNoneURI();
-
- public String getClientAddressingProperties();
-
- public String getClientAddressingPropertiesInbound();
-
- public String getClientAddressingPropertiesOutbound();
-
- public String getServerAddressingPropertiesInbound();
-
- public String getServerAddressingPropertiesOutbound();
-
-}
Copied: api/trunk/src/main/java/org/jboss/wsf/common/addressing/MAPConstants.java (from rev 14041, api/branches/asoldano/src/main/java/org/jboss/wsf/common/addressing/MAPConstants.java)
===================================================================
--- api/trunk/src/main/java/org/jboss/wsf/common/addressing/MAPConstants.java (rev 0)
+++ api/trunk/src/main/java/org/jboss/wsf/common/addressing/MAPConstants.java 2011-04-14 15:25:34 UTC (rev 14093)
@@ -0,0 +1,47 @@
+/*
+ * 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.common.addressing;
+
+/**
+ * MAPConstants is a wrapper which works with class MAP
+ *
+ * @author Andrew Dinn (adinn(a)redhat.com)
+ * @author alessio.soldano(a)jboss.com
+ *
+ */
+public interface MAPConstants
+{
+ public String getAnonymousURI();
+
+ public String getNoneURI();
+
+ public String getClientAddressingProperties();
+
+ public String getClientAddressingPropertiesInbound();
+
+ public String getClientAddressingPropertiesOutbound();
+
+ public String getServerAddressingPropertiesInbound();
+
+ public String getServerAddressingPropertiesOutbound();
+
+}
Deleted: api/trunk/src/main/java/org/jboss/wsf/common/addressing/MAPEndpoint.java
===================================================================
--- api/branches/asoldano/src/main/java/org/jboss/wsf/common/addressing/MAPEndpoint.java 2011-04-08 15:48:56 UTC (rev 14041)
+++ api/trunk/src/main/java/org/jboss/wsf/common/addressing/MAPEndpoint.java 2011-04-14 15:25:34 UTC (rev 14093)
@@ -1,43 +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.common.addressing;
-
-import java.util.List;
-
-import org.w3c.dom.Element;
-
-/**
- * MAPEndpoint is a wrapper which works with class MAP.
- *
- * @author Andrew Dinn (adinn(a)redhat.com)
- * @author alessio.soldano(a)jboss.com
- *
- */
-public interface MAPEndpoint
-{
- public String getAddress();
-
- public void addReferenceParameter(Element element);
-
- public List<Object> getReferenceParameters();
-
-}
Copied: api/trunk/src/main/java/org/jboss/wsf/common/addressing/MAPEndpoint.java (from rev 14041, api/branches/asoldano/src/main/java/org/jboss/wsf/common/addressing/MAPEndpoint.java)
===================================================================
--- api/trunk/src/main/java/org/jboss/wsf/common/addressing/MAPEndpoint.java (rev 0)
+++ api/trunk/src/main/java/org/jboss/wsf/common/addressing/MAPEndpoint.java 2011-04-14 15:25:34 UTC (rev 14093)
@@ -0,0 +1,43 @@
+/*
+ * 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.common.addressing;
+
+import java.util.List;
+
+import org.w3c.dom.Element;
+
+/**
+ * MAPEndpoint is a wrapper which works with class MAP.
+ *
+ * @author Andrew Dinn (adinn(a)redhat.com)
+ * @author alessio.soldano(a)jboss.com
+ *
+ */
+public interface MAPEndpoint
+{
+ public String getAddress();
+
+ public void addReferenceParameter(Element element);
+
+ public List<Object> getReferenceParameters();
+
+}
Deleted: api/trunk/src/main/java/org/jboss/wsf/common/addressing/MAPRelatesTo.java
===================================================================
--- api/branches/asoldano/src/main/java/org/jboss/wsf/common/addressing/MAPRelatesTo.java 2011-04-08 15:48:56 UTC (rev 14041)
+++ api/trunk/src/main/java/org/jboss/wsf/common/addressing/MAPRelatesTo.java 2011-04-14 15:25:34 UTC (rev 14093)
@@ -1,41 +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.common.addressing;
-
-import javax.xml.namespace.QName;
-
-/**
- * MAPRelationship is a wrapper which works with class MAP.
- *
- * @author Andrew Dinn (adinn(a)redhat.com)
- * @author alessio.soldano(a)jboss.com
- *
- */
-public interface MAPRelatesTo
-{
- public String getRelatesTo();
-
- public QName getType();
-
- public void setType(QName type);
-
-}
Copied: api/trunk/src/main/java/org/jboss/wsf/common/addressing/MAPRelatesTo.java (from rev 14041, api/branches/asoldano/src/main/java/org/jboss/wsf/common/addressing/MAPRelatesTo.java)
===================================================================
--- api/trunk/src/main/java/org/jboss/wsf/common/addressing/MAPRelatesTo.java (rev 0)
+++ api/trunk/src/main/java/org/jboss/wsf/common/addressing/MAPRelatesTo.java 2011-04-14 15:25:34 UTC (rev 14093)
@@ -0,0 +1,41 @@
+/*
+ * 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.common.addressing;
+
+import javax.xml.namespace.QName;
+
+/**
+ * MAPRelationship is a wrapper which works with class MAP.
+ *
+ * @author Andrew Dinn (adinn(a)redhat.com)
+ * @author alessio.soldano(a)jboss.com
+ *
+ */
+public interface MAPRelatesTo
+{
+ public String getRelatesTo();
+
+ public QName getType();
+
+ public void setType(QName type);
+
+}
Deleted: api/trunk/src/main/java/org/jboss/wsf/common/handler/GenericHandler.java
===================================================================
--- api/branches/asoldano/src/main/java/org/jboss/wsf/common/handler/GenericHandler.java 2011-04-08 15:48:56 UTC (rev 14041)
+++ api/trunk/src/main/java/org/jboss/wsf/common/handler/GenericHandler.java 2011-04-14 15:25:34 UTC (rev 14093)
@@ -1,79 +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.common.handler;
-
-import javax.xml.ws.handler.Handler;
-import javax.xml.ws.handler.MessageContext;
-
-/**
- * A generic jaxws handler
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 13-Aug-2006
- */
-public abstract class GenericHandler implements Handler
-{
- private String handlerName;
-
- public String getHandlerName()
- {
- return handlerName;
- }
-
- public void setHandlerName(String handlerName)
- {
- this.handlerName = handlerName;
- }
-
- public boolean handleMessage(MessageContext msgContext)
- {
- Boolean outbound = (Boolean)msgContext.get(MessageContext.MESSAGE_OUTBOUND_PROPERTY);
- if (outbound == null)
- throw new IllegalStateException("Cannot obtain required property: " + MessageContext.MESSAGE_OUTBOUND_PROPERTY);
-
- return outbound ? handleOutbound(msgContext) : handleInbound(msgContext);
- }
-
- protected boolean handleOutbound(MessageContext msgContext)
- {
- return true;
- }
-
- protected boolean handleInbound(MessageContext msgContext)
- {
- return true;
- }
-
- public boolean handleFault(MessageContext messagecontext)
- {
- return true;
- }
-
- public void close(MessageContext messageContext)
- {
- }
-
- public String toString()
- {
- return (handlerName != null ? handlerName : super.toString());
- }
-}
Copied: api/trunk/src/main/java/org/jboss/wsf/common/handler/GenericHandler.java (from rev 14041, api/branches/asoldano/src/main/java/org/jboss/wsf/common/handler/GenericHandler.java)
===================================================================
--- api/trunk/src/main/java/org/jboss/wsf/common/handler/GenericHandler.java (rev 0)
+++ api/trunk/src/main/java/org/jboss/wsf/common/handler/GenericHandler.java 2011-04-14 15:25:34 UTC (rev 14093)
@@ -0,0 +1,79 @@
+/*
+ * 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.common.handler;
+
+import javax.xml.ws.handler.Handler;
+import javax.xml.ws.handler.MessageContext;
+
+/**
+ * A generic jaxws handler
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 13-Aug-2006
+ */
+public abstract class GenericHandler implements Handler
+{
+ private String handlerName;
+
+ public String getHandlerName()
+ {
+ return handlerName;
+ }
+
+ public void setHandlerName(String handlerName)
+ {
+ this.handlerName = handlerName;
+ }
+
+ public boolean handleMessage(MessageContext msgContext)
+ {
+ Boolean outbound = (Boolean)msgContext.get(MessageContext.MESSAGE_OUTBOUND_PROPERTY);
+ if (outbound == null)
+ throw new IllegalStateException("Cannot obtain required property: " + MessageContext.MESSAGE_OUTBOUND_PROPERTY);
+
+ return outbound ? handleOutbound(msgContext) : handleInbound(msgContext);
+ }
+
+ protected boolean handleOutbound(MessageContext msgContext)
+ {
+ return true;
+ }
+
+ protected boolean handleInbound(MessageContext msgContext)
+ {
+ return true;
+ }
+
+ public boolean handleFault(MessageContext messagecontext)
+ {
+ return true;
+ }
+
+ public void close(MessageContext messageContext)
+ {
+ }
+
+ public String toString()
+ {
+ return (handlerName != null ? handlerName : super.toString());
+ }
+}
Deleted: api/trunk/src/main/java/org/jboss/wsf/common/handler/GenericLogicalHandler.java
===================================================================
--- api/branches/asoldano/src/main/java/org/jboss/wsf/common/handler/GenericLogicalHandler.java 2011-04-08 15:48:56 UTC (rev 14041)
+++ api/trunk/src/main/java/org/jboss/wsf/common/handler/GenericLogicalHandler.java 2011-04-14 15:25:34 UTC (rev 14093)
@@ -1,35 +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.common.handler;
-
-import javax.xml.ws.handler.LogicalHandler;
-import javax.xml.ws.handler.LogicalMessageContext;
-
-/**
- * A generic jaxws logical handler
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 13-Aug-2006
- */
-public class GenericLogicalHandler<C extends LogicalMessageContext> extends GenericHandler implements LogicalHandler
-{
-}
Copied: api/trunk/src/main/java/org/jboss/wsf/common/handler/GenericLogicalHandler.java (from rev 14041, api/branches/asoldano/src/main/java/org/jboss/wsf/common/handler/GenericLogicalHandler.java)
===================================================================
--- api/trunk/src/main/java/org/jboss/wsf/common/handler/GenericLogicalHandler.java (rev 0)
+++ api/trunk/src/main/java/org/jboss/wsf/common/handler/GenericLogicalHandler.java 2011-04-14 15:25:34 UTC (rev 14093)
@@ -0,0 +1,35 @@
+/*
+ * 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.common.handler;
+
+import javax.xml.ws.handler.LogicalHandler;
+import javax.xml.ws.handler.LogicalMessageContext;
+
+/**
+ * A generic jaxws logical handler
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 13-Aug-2006
+ */
+public class GenericLogicalHandler<C extends LogicalMessageContext> extends GenericHandler implements LogicalHandler
+{
+}
Deleted: api/trunk/src/main/java/org/jboss/wsf/common/handler/GenericSOAPHandler.java
===================================================================
--- api/branches/asoldano/src/main/java/org/jboss/wsf/common/handler/GenericSOAPHandler.java 2011-04-08 15:48:56 UTC (rev 14041)
+++ api/trunk/src/main/java/org/jboss/wsf/common/handler/GenericSOAPHandler.java 2011-04-14 15:25:34 UTC (rev 14093)
@@ -1,55 +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.common.handler;
-
-import java.util.HashSet;
-import java.util.Set;
-
-import javax.xml.namespace.QName;
-import javax.xml.ws.handler.LogicalMessageContext;
-import javax.xml.ws.handler.soap.SOAPHandler;
-
-/**
- * A generic jaxws soap handler
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 13-Aug-2006
- */
-public abstract class GenericSOAPHandler<C extends LogicalMessageContext> extends GenericHandler implements SOAPHandler
-{
- // The header blocks that can be processed by this Handler instance
- private Set<QName> headers = new HashSet<QName>();
-
- /** Gets the header blocks that can be processed by this Handler instance.
- */
- public Set<QName> getHeaders()
- {
- return headers;
- }
-
- /** Sets the header blocks that can be processed by this Handler instance.
- */
- public void setHeaders(Set<QName> headers)
- {
- this.headers = headers;
- }
-}
Copied: api/trunk/src/main/java/org/jboss/wsf/common/handler/GenericSOAPHandler.java (from rev 14041, api/branches/asoldano/src/main/java/org/jboss/wsf/common/handler/GenericSOAPHandler.java)
===================================================================
--- api/trunk/src/main/java/org/jboss/wsf/common/handler/GenericSOAPHandler.java (rev 0)
+++ api/trunk/src/main/java/org/jboss/wsf/common/handler/GenericSOAPHandler.java 2011-04-14 15:25:34 UTC (rev 14093)
@@ -0,0 +1,55 @@
+/*
+ * 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.common.handler;
+
+import java.util.HashSet;
+import java.util.Set;
+
+import javax.xml.namespace.QName;
+import javax.xml.ws.handler.LogicalMessageContext;
+import javax.xml.ws.handler.soap.SOAPHandler;
+
+/**
+ * A generic jaxws soap handler
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 13-Aug-2006
+ */
+public abstract class GenericSOAPHandler<C extends LogicalMessageContext> extends GenericHandler implements SOAPHandler
+{
+ // The header blocks that can be processed by this Handler instance
+ private Set<QName> headers = new HashSet<QName>();
+
+ /** Gets the header blocks that can be processed by this Handler instance.
+ */
+ public Set<QName> getHeaders()
+ {
+ return headers;
+ }
+
+ /** Sets the header blocks that can be processed by this Handler instance.
+ */
+ public void setHeaders(Set<QName> headers)
+ {
+ this.headers = headers;
+ }
+}
Modified: api/trunk/src/main/java/org/jboss/wsf/spi/util/ServiceLoader.java
===================================================================
--- api/trunk/src/main/java/org/jboss/wsf/spi/util/ServiceLoader.java 2011-04-14 15:12:21 UTC (rev 14092)
+++ api/trunk/src/main/java/org/jboss/wsf/spi/util/ServiceLoader.java 2011-04-14 15:25:34 UTC (rev 14093)
@@ -64,28 +64,59 @@
* as the name of the implementation class.
*
* 4. Finally, a default implementation class name is used.
+ *
+ * @param propertyName The property name for the service to resolve
+ * @param defaultFactory Default factory class name to be used when not able to resolve anything
+ * @param cl The classLoader to be used for loading resolved service
+ * @return A new instance of the required service
*/
- public static Object loadService(String propertyName, String defaultFactory)
+ public static Object loadService(String propertyName, String defaultFactory, ClassLoader cl)
{
- Object factory = loadFromServices(propertyName, null);
+ Object factory = loadFromServices(propertyName, null, cl);
if (factory == null)
{
- factory = loadFromPropertiesFile(propertyName, null);
+ factory = loadFromPropertiesFile(propertyName, null, cl);
}
if (factory == null)
{
- factory = loadFromSystemProperty(propertyName, defaultFactory);
+ factory = loadFromSystemProperty(propertyName, defaultFactory, cl);
}
return factory;
}
+ /**
+ * This method uses the algorithm below using the JAXWS Provider as an example.
+ *
+ * 1. If a resource with the name of META-INF/services/javax.xml.ws.spi.Provider exists, then
+ * its first line, if present, is used as the UTF-8 encoded name of the implementation class.
+ *
+ * 2. If the ${java.home}/lib/jaxws.properties file exists and it is readable by the
+ * java.util.Properties.load(InputStream) method and it contains an entry whose key is
+ * javax.xml.ws.spi.Provider, then the value of that entry is used as the name of the implementation class.
+ *
+ * 3. If a system property with the name javax.xml.ws.spi.Provider is defined, then its value is used
+ * as the name of the implementation class.
+ *
+ * 4. Finally, a default implementation class name is used.
+ *
+ * This is equivalent to calling {@link loadService(String propertyName, String defaultFactory, ClassLoader cl)}
+ * passing in the Thread.currentThread().getContextClassLoader().
+ *
+ * @param propertyName The property name for the service to resolve
+ * @param defaultFactory Default factory class name to be used when not able to resolve anything
+ * @return A new instance of the required service
+ */
+ public static Object loadService(String propertyName, String defaultFactory)
+ {
+ return loadService(propertyName, defaultFactory, SecurityActions.getContextClassLoader());
+ }
+
/** Use the Services API (as detailed in the JAR specification), if available, to determine the classname.
*/
- public static Object loadFromServices(String propertyName, String defaultFactory)
+ private static Object loadFromServices(String propertyName, String defaultFactory, ClassLoader loader)
{
Object factory = null;
String factoryName = null;
- ClassLoader loader = SecurityActions.getContextClassLoader();
// Use the Services API (as detailed in the JAR specification), if available, to determine the classname.
String filename = "META-INF/services/" + propertyName;
@@ -107,7 +138,7 @@
// Use the default factory implementation class.
if (factory == null && defaultFactory != null)
{
- factory = loadDefault(defaultFactory);
+ factory = loadDefault(defaultFactory, loader);
}
return factory;
@@ -142,10 +173,9 @@
/** Use the system property
*/
- public static Object loadFromSystemProperty(String propertyName, String defaultFactory)
+ private static Object loadFromSystemProperty(String propertyName, String defaultFactory, ClassLoader loader)
{
Object factory = null;
- ClassLoader loader = SecurityActions.getContextClassLoader();
PrivilegedAction action = new PropertyAccessAction(propertyName);
String factoryName = (String)AccessController.doPrivileged(action);
@@ -166,7 +196,7 @@
// Use the default factory implementation class.
if (factory == null && defaultFactory != null)
{
- factory = loadDefault(defaultFactory);
+ factory = loadDefault(defaultFactory, loader);
}
return factory;
@@ -177,11 +207,10 @@
* This configuration file is in standard java.util.Properties format and contains the
* fully qualified name of the implementation class with the key being the system property defined above.
*/
- public static Object loadFromPropertiesFile(String propertyName, String defaultFactory)
+ private static Object loadFromPropertiesFile(String propertyName, String defaultFactory, ClassLoader loader)
{
Object factory = null;
String factoryName = null;
- ClassLoader loader = SecurityActions.getContextClassLoader();
// Use the properties file "lib/jaxm.properties" in the JRE directory.
// This configuration file is in standard java.util.Properties format and contains the fully qualified name of the implementation class with the key being the system property defined above.
@@ -211,16 +240,15 @@
// Use the default factory implementation class.
if (factory == null && defaultFactory != null)
{
- factory = loadDefault(defaultFactory);
+ factory = loadDefault(defaultFactory, loader);
}
return factory;
}
- private static Object loadDefault(String defaultFactory)
+ private static Object loadDefault(String defaultFactory, ClassLoader loader)
{
Object factory = null;
- ClassLoader loader = SecurityActions.getContextClassLoader();
// Use the default factory implementation class.
if (defaultFactory != null)
Deleted: api/trunk/src/main/java/org/jboss/wsf/util/DOMUtils.java
===================================================================
--- api/branches/asoldano/src/main/java/org/jboss/wsf/util/DOMUtils.java 2011-04-08 15:48:56 UTC (rev 14041)
+++ api/trunk/src/main/java/org/jboss/wsf/util/DOMUtils.java 2011-04-14 15:25:34 UTC (rev 14093)
@@ -1,647 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * 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.
- *
- * 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.util;
-
-import java.io.ByteArrayInputStream;
-import java.io.ByteArrayOutputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.Reader;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.LinkedList;
-import java.util.List;
-import java.util.Map;
-
-import javax.xml.namespace.QName;
-import javax.xml.parsers.DocumentBuilder;
-import javax.xml.transform.OutputKeys;
-import javax.xml.transform.Source;
-import javax.xml.transform.Transformer;
-import javax.xml.transform.TransformerException;
-import javax.xml.transform.TransformerFactory;
-import javax.xml.transform.dom.DOMSource;
-import javax.xml.transform.sax.SAXSource;
-import javax.xml.transform.stream.StreamResult;
-import javax.xml.transform.stream.StreamSource;
-
-import org.jboss.logging.Logger;
-import org.w3c.dom.Attr;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-import org.w3c.dom.NamedNodeMap;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-import org.xml.sax.InputSource;
-import org.xml.sax.SAXException;
-
-/**
- * Basic DOM2 utilities
- *
- * @author alessio.soldano(a)jboss.com
- * @author Thomas.Diesler(a)jboss.org
- *
- */
-public abstract class DOMUtils
-{
- private static Logger log = Logger.getLogger(DOMUtils.class);
-
- /** Get the qname of the given node.
- */
- public static QName getElementQName(Element el)
- {
- String qualifiedName = el.getNodeName();
- return resolveQName(el, qualifiedName);
- }
-
- /** Transform the given qualified name into a QName
- */
- public static QName resolveQName(Element el, String qualifiedName)
- {
- QName qname;
- String prefix = "";
- String namespaceURI = "";
- String localPart = qualifiedName;
-
- int colIndex = qualifiedName.indexOf(":");
- if (colIndex > 0)
- {
- prefix = qualifiedName.substring(0, colIndex);
- localPart = qualifiedName.substring(colIndex + 1);
-
- if ("xmlns".equals(prefix))
- {
- namespaceURI = "URI:XML_PREDEFINED_NAMESPACE";
- }
- else
- {
- Element nsElement = el;
- while (namespaceURI.equals("") && nsElement != null)
- {
- namespaceURI = nsElement.getAttribute("xmlns:" + prefix);
- if (namespaceURI.equals(""))
- nsElement = getParentElement(nsElement);
- }
- }
-
- if (namespaceURI.equals("") && el.getNamespaceURI() != null)
- {
- namespaceURI = el.getNamespaceURI();
- }
-
- if (namespaceURI.equals(""))
- throw new IllegalArgumentException("Cannot find namespace uri for: " + qualifiedName);
- }
- else
- {
- Element nsElement = el;
- while (namespaceURI.equals("") && nsElement != null)
- {
- namespaceURI = nsElement.getAttribute("xmlns");
- if (namespaceURI.equals(""))
- nsElement = getParentElement(nsElement);
- }
- }
-
- qname = new QName(namespaceURI, localPart, prefix);
- return qname;
- }
-
- /** Get the value from the given attribute
- *
- * @return null if the attribute value is empty or the attribute is not present
- */
- public static String getAttributeValue(Element el, String attrName)
- {
- return getAttributeValue(el, new QName(attrName));
- }
-
- /** Get the value from the given attribute
- *
- * @return null if the attribute value is empty or the attribute is not present
- */
- public static String getAttributeValue(Element el, QName attrName)
- {
- String attr = null;
- if ("".equals(attrName.getNamespaceURI()))
- attr = el.getAttribute(attrName.getLocalPart());
- else
- attr = el.getAttributeNS(attrName.getNamespaceURI(), attrName.getLocalPart());
-
- if ("".equals(attr))
- attr = null;
-
- return attr;
- }
-
- /** Get the qname value from the given attribute
- */
- public static QName getAttributeValueAsQName(Element el, String attrName)
- {
- return getAttributeValueAsQName(el, new QName(attrName));
-
- }
-
- /** Get the qname value from the given attribute
- */
- public static QName getAttributeValueAsQName(Element el, QName attrName)
- {
- QName qname = null;
-
- String qualifiedName = getAttributeValue(el, attrName);
- if (qualifiedName != null)
- {
- qname = resolveQName(el, qualifiedName);
- }
-
- return qname;
- }
-
- /** Get the boolean value from the given attribute
- */
- public static boolean getAttributeValueAsBoolean(Element el, String attrName)
- {
- return getAttributeValueAsBoolean(el, new QName(attrName));
- }
-
- /** Get the boolean value from the given attribute
- */
- public static boolean getAttributeValueAsBoolean(Element el, QName attrName)
- {
- String attrVal = getAttributeValue(el, attrName);
- boolean ret = "true".equalsIgnoreCase(attrVal) || "1".equalsIgnoreCase(attrVal);
- return ret;
- }
-
- /** Get the integer value from the given attribute
- */
- public static Integer getAttributeValueAsInteger(Element el, String attrName)
- {
- return getAttributeValueAsInteger(el, new QName(attrName));
- }
-
- /** Get the integer value from the given attribute
- */
- public static Integer getAttributeValueAsInteger(Element el, QName attrName)
- {
- String attrVal = getAttributeValue(el, attrName);
- return (attrVal != null ? new Integer(attrVal) : null);
- }
-
- /** Get the attributes as Map<QName, String>
- */
- public static Map<QName, String> getAttributes(Element el)
- {
- Map<QName, String> attmap = new HashMap<QName, String>();
- NamedNodeMap attribs = el.getAttributes();
- int len = attribs.getLength();
- for (int i = 0; i < len; i++)
- {
- Attr attr = (Attr) attribs.item(i);
- String name = attr.getName();
- QName qname = resolveQName(el, name);
- String value = attr.getNodeValue();
- attmap.put(qname, value);
- }
- return attmap;
- }
-
- /** Copy attributes between elements
- */
- public static void copyAttributes(Element destElement, Element srcElement)
- {
- NamedNodeMap attribs = srcElement.getAttributes();
- int len = attribs.getLength();
- for (int i = 0; i < len; i++)
- {
- Attr attr = (Attr) attribs.item(i);
- String uri = attr.getNamespaceURI();
- String qname = attr.getName();
- String value = attr.getNodeValue();
-
- // Prevent DOMException: NAMESPACE_ERR: An attempt is made to create or
- // change an object in a way which is incorrect with regard to namespaces.
- if (uri == null && qname.startsWith("xmlns"))
- {
- if (log.isTraceEnabled())
- log.trace("Ignore attribute: [uri=" + uri + ",qname=" + qname + ",value=" + value + "]");
- }
- else
- {
- destElement.setAttributeNS(uri, qname, value);
- }
- }
- }
-
- /** True if the node has text child elements only
- */
- public static boolean hasTextChildNodesOnly(Node node)
- {
- NodeList nodeList = node.getChildNodes();
- int len = nodeList.getLength();
- if (len == 0)
- return false;
-
- for (int i = 0; i < len; i++)
- {
- Node acksToChildNode = nodeList.item(i);
- if (acksToChildNode.getNodeType() != Node.TEXT_NODE)
- return false;
- }
-
- return true;
- }
-
- /** True if the node has child elements
- */
- public static boolean hasChildElements(Node node)
- {
- NodeList nlist = node.getChildNodes();
- int len = nlist.getLength();
- for (int i = 0; i < len; i++)
- {
- Node child = nlist.item(i);
- if (child.getNodeType() == Node.ELEMENT_NODE)
- return true;
- }
- return false;
- }
-
- /** Gets child elements
- */
- public static Iterator<Element> getChildElements(Node node)
- {
- List<Element> list = new LinkedList<Element>();
- NodeList nlist = node.getChildNodes();
- int len = nlist.getLength();
- for (int i = 0; i < len; i++)
- {
- Node child = nlist.item(i);
- if (child.getNodeType() == Node.ELEMENT_NODE)
- list.add((Element) child);
- }
- return list.iterator();
- }
-
- /** Get the concatenated text content, or null.
- */
- public static String getTextContent(Node node)
- {
- boolean hasTextContent = false;
- StringBuilder buffer = new StringBuilder();
- NodeList nlist = node.getChildNodes();
- int len = nlist.getLength();
- for (int i = 0; i < len; i++)
- {
- Node child = nlist.item(i);
- if (child.getNodeType() == Node.TEXT_NODE)
- {
- buffer.append(child.getNodeValue());
- hasTextContent = true;
- }
- }
- return (hasTextContent ? buffer.toString() : null);
- }
-
- /** Gets the first child element
- */
- public static Element getFirstChildElement(Node node)
- {
- return getFirstChildElement(node, false);
- }
-
- /** Gets the first child element
- */
- public static Element getFirstChildElement(Node node, boolean recursive)
- {
- return getFirstChildElementIntern(node, null, recursive);
- }
-
- /** Gets the first child element for a given local name without namespace
- */
- public static Element getFirstChildElement(Node node, String nodeName)
- {
- return getFirstChildElement(node, nodeName, false);
- }
-
- /** Gets the first child element for a given local name without namespace
- */
- public static Element getFirstChildElement(Node node, String nodeName, boolean recursive)
- {
- return getFirstChildElementIntern(node, new QName(nodeName), recursive);
- }
-
- /** Gets the first child element for a given qname
- */
- public static Element getFirstChildElement(Node node, QName nodeName)
- {
- return getFirstChildElement(node, nodeName, false);
- }
-
- /** Gets the first child element for a given qname
- */
- public static Element getFirstChildElement(Node node, QName nodeName, boolean recursive)
- {
- return getFirstChildElementIntern(node, nodeName, recursive);
- }
-
- private static Element getFirstChildElementIntern(Node node, QName nodeName, boolean recursive)
- {
- Element childElement = null;
- Iterator<Element> it = getChildElementsIntern(node, nodeName, recursive);
- if (it.hasNext())
- {
- childElement = (Element) it.next();
- }
- return childElement;
- }
-
- /** Gets the child elements for a given local name without namespace
- */
- public static Iterator<Element> getChildElements(Node node, String nodeName)
- {
- return getChildElements(node, nodeName, false);
- }
-
- /** Gets the child elements for a given local name without namespace
- */
- public static Iterator<Element> getChildElements(Node node, String nodeName, boolean recursive)
- {
- return getChildElementsIntern(node, new QName(nodeName), recursive);
- }
-
- /** Gets the child element for a given qname
- */
- public static Iterator<Element> getChildElements(Node node, QName nodeName)
- {
- return getChildElements(node, nodeName, false);
- }
-
- /** Gets the child element for a given qname
- */
- public static Iterator<Element> getChildElements(Node node, QName nodeName, boolean recursive)
- {
- return getChildElementsIntern(node, nodeName, recursive);
- }
-
- public static List<Element> getChildElementsAsList(Node node, String nodeName)
- {
- return getChildElementsAsList(node, nodeName, false);
- }
-
- public static List<Element> getChildElementsAsList(Node node, String nodeName, boolean recursive)
- {
- return getChildElementsAsListIntern(node, new QName(nodeName), recursive);
- }
-
- public static List<Element> getChildElementsAsList(Node node, QName nodeName)
- {
- return getChildElementsAsList(node, nodeName, false);
- }
-
- public static List<Element> getChildElementsAsList(Node node, QName nodeName, boolean recursive)
- {
- return getChildElementsAsListIntern(node, nodeName, recursive);
- }
-
- private static List<Element> getChildElementsAsListIntern(Node node, QName nodeName, boolean recursive)
- {
- List<Element> list = new LinkedList<Element>();
-
- NodeList nlist = node.getChildNodes();
- int len = nlist.getLength();
- for (int i = 0; i < len; i++)
- {
- Node child = nlist.item(i);
- if (child.getNodeType() == Node.ELEMENT_NODE)
- {
- search(list, (Element) child, nodeName, recursive);
- }
- }
- return list;
- }
-
- private static void search(List<Element> list, Element baseElement, QName nodeName, boolean recursive)
- {
- if (nodeName == null)
- {
- list.add(baseElement);
- }
- else
- {
- QName qname;
- if (nodeName.getNamespaceURI().length() > 0)
- {
- qname = new QName(baseElement.getNamespaceURI(), baseElement.getLocalName());
- }
- else
- {
- qname = new QName(baseElement.getLocalName());
- }
- if (qname.equals(nodeName))
- {
- list.add(baseElement);
- }
- }
- if (recursive)
- {
- NodeList nlist = baseElement.getChildNodes();
- int len = nlist.getLength();
- for (int i = 0; i < len; i++)
- {
- Node child = nlist.item(i);
- if (child.getNodeType() == Node.ELEMENT_NODE)
- {
- search(list, (Element) child, nodeName, recursive);
- }
- }
- }
- }
-
- private static Iterator<Element> getChildElementsIntern(Node node, QName nodeName, boolean recursive)
- {
- return getChildElementsAsListIntern(node, nodeName, recursive).iterator();
- }
-
- /** Gets parent element or null if there is none
- */
- public static Element getParentElement(Node node)
- {
- Node parent = node.getParentNode();
- return (parent instanceof Element ? (Element) parent : null);
- }
-
- public static Element sourceToElement(Source source, DocumentBuilder builder) throws IOException
- {
- Element retElement = null;
-
- if (source instanceof StreamSource)
- {
- StreamSource streamSource = (StreamSource) source;
-
- InputStream ins = streamSource.getInputStream();
- if (ins != null)
- {
- retElement = DOMUtils.parse(ins, builder);
- }
- Reader reader = streamSource.getReader();
- if (reader != null)
- {
- retElement = DOMUtils.parse(new InputSource(reader), builder);
- }
- }
- else if (source instanceof DOMSource)
- {
- DOMSource domSource = (DOMSource) source;
- Node node = domSource.getNode();
- if (node instanceof Element)
- {
- retElement = (Element) node;
- }
- else if (node instanceof Document)
- {
- retElement = ((Document) node).getDocumentElement();
- }
- }
- else if (source instanceof SAXSource)
- {
- // The fact that JAXBSource derives from SAXSource is an implementation detail.
- // Thus in general applications are strongly discouraged from accessing methods defined on SAXSource.
- // The XMLReader object obtained by the getXMLReader method shall be used only for parsing the InputSource object returned by the getInputSource method.
-
- final boolean hasInputSource = ((SAXSource) source).getInputSource() != null;
- final boolean hasXMLReader = ((SAXSource) source).getXMLReader() != null;
-
- if (hasInputSource || hasXMLReader)
- {
- try
- {
- TransformerFactory tf = TransformerFactory.newInstance();
- ByteArrayOutputStream baos = new ByteArrayOutputStream(1024);
- Transformer transformer = tf.newTransformer();
- transformer.setOutputProperty(OutputKeys.OMIT_XML_DECLARATION, "yes");
- transformer.setOutputProperty(OutputKeys.METHOD, "xml");
- transformer.transform(source, new StreamResult(baos));
- retElement = DOMUtils.parse(new ByteArrayInputStream(baos.toByteArray()), builder);
- }
- catch (TransformerException ex)
- {
- throw new IOException(ex);
- }
- }
- }
- else
- {
- throw new RuntimeException("Source type not implemented: " + source.getClass().getName());
- }
-
- return retElement;
- }
-
- /** Parse the given XML string and return the root Element
- */
- public static Element parse(String xmlString, DocumentBuilder builder) throws IOException
- {
- try
- {
- return parse(new ByteArrayInputStream(xmlString.getBytes("UTF-8")), builder);
- }
- catch (IOException e)
- {
- log.error("Cannot parse: " + xmlString);
- throw e;
- }
- }
-
- /** Parse the given XML stream and return the root Element
- */
- public static Element parse(InputStream xmlStream, DocumentBuilder builder) throws IOException
- {
- try
- {
- Document doc;
- synchronized (builder) //synchronize to prevent concurrent parsing on the same DocumentBuilder
- {
- doc = builder.parse(xmlStream);
- }
- return doc.getDocumentElement();
- }
- catch (SAXException se)
- {
- throw new IOException(se.toString());
- }
- finally
- {
- xmlStream.close();
- }
- }
-
- /** Parse the given input source and return the root Element
- */
- public static Element parse(InputSource source, DocumentBuilder builder) throws IOException
- {
- try
- {
- Document doc;
- synchronized (builder) //synchronize to prevent concurrent parsing on the same DocumentBuilder
- {
- doc = builder.parse(source);
- }
- return doc.getDocumentElement();
- }
- catch (SAXException se)
- {
- throw new IOException(se.toString());
- }
- finally
- {
- InputStream is = source.getByteStream();
- if (is != null)
- {
- is.close();
- }
- Reader r = source.getCharacterStream();
- if (r != null)
- {
- r.close();
- }
- }
- }
-
- /** Create an Element for a given name, prefix and uri
- */
- public static Element createElement(String localPart, String prefix, String uri, Document doc)
- {
- if (prefix == null || prefix.length() == 0)
- {
- if (log.isTraceEnabled())
- log.trace("createElement {" + uri + "}" + localPart);
- return doc.createElementNS(uri, localPart);
- }
- else
- {
- if (log.isTraceEnabled())
- log.trace("createElement {" + uri + "}" + prefix + ":" + localPart);
- return doc.createElementNS(uri, prefix + ":" + localPart);
- }
- }
-}
Copied: api/trunk/src/main/java/org/jboss/wsf/util/DOMUtils.java (from rev 14041, api/branches/asoldano/src/main/java/org/jboss/wsf/util/DOMUtils.java)
===================================================================
--- api/trunk/src/main/java/org/jboss/wsf/util/DOMUtils.java (rev 0)
+++ api/trunk/src/main/java/org/jboss/wsf/util/DOMUtils.java 2011-04-14 15:25:34 UTC (rev 14093)
@@ -0,0 +1,647 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * 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.
+ *
+ * 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.util;
+
+import java.io.ByteArrayInputStream;
+import java.io.ByteArrayOutputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.Reader;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.LinkedList;
+import java.util.List;
+import java.util.Map;
+
+import javax.xml.namespace.QName;
+import javax.xml.parsers.DocumentBuilder;
+import javax.xml.transform.OutputKeys;
+import javax.xml.transform.Source;
+import javax.xml.transform.Transformer;
+import javax.xml.transform.TransformerException;
+import javax.xml.transform.TransformerFactory;
+import javax.xml.transform.dom.DOMSource;
+import javax.xml.transform.sax.SAXSource;
+import javax.xml.transform.stream.StreamResult;
+import javax.xml.transform.stream.StreamSource;
+
+import org.jboss.logging.Logger;
+import org.w3c.dom.Attr;
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+import org.w3c.dom.NamedNodeMap;
+import org.w3c.dom.Node;
+import org.w3c.dom.NodeList;
+import org.xml.sax.InputSource;
+import org.xml.sax.SAXException;
+
+/**
+ * Basic DOM2 utilities
+ *
+ * @author alessio.soldano(a)jboss.com
+ * @author Thomas.Diesler(a)jboss.org
+ *
+ */
+public abstract class DOMUtils
+{
+ private static Logger log = Logger.getLogger(DOMUtils.class);
+
+ /** Get the qname of the given node.
+ */
+ public static QName getElementQName(Element el)
+ {
+ String qualifiedName = el.getNodeName();
+ return resolveQName(el, qualifiedName);
+ }
+
+ /** Transform the given qualified name into a QName
+ */
+ public static QName resolveQName(Element el, String qualifiedName)
+ {
+ QName qname;
+ String prefix = "";
+ String namespaceURI = "";
+ String localPart = qualifiedName;
+
+ int colIndex = qualifiedName.indexOf(":");
+ if (colIndex > 0)
+ {
+ prefix = qualifiedName.substring(0, colIndex);
+ localPart = qualifiedName.substring(colIndex + 1);
+
+ if ("xmlns".equals(prefix))
+ {
+ namespaceURI = "URI:XML_PREDEFINED_NAMESPACE";
+ }
+ else
+ {
+ Element nsElement = el;
+ while (namespaceURI.equals("") && nsElement != null)
+ {
+ namespaceURI = nsElement.getAttribute("xmlns:" + prefix);
+ if (namespaceURI.equals(""))
+ nsElement = getParentElement(nsElement);
+ }
+ }
+
+ if (namespaceURI.equals("") && el.getNamespaceURI() != null)
+ {
+ namespaceURI = el.getNamespaceURI();
+ }
+
+ if (namespaceURI.equals(""))
+ throw new IllegalArgumentException("Cannot find namespace uri for: " + qualifiedName);
+ }
+ else
+ {
+ Element nsElement = el;
+ while (namespaceURI.equals("") && nsElement != null)
+ {
+ namespaceURI = nsElement.getAttribute("xmlns");
+ if (namespaceURI.equals(""))
+ nsElement = getParentElement(nsElement);
+ }
+ }
+
+ qname = new QName(namespaceURI, localPart, prefix);
+ return qname;
+ }
+
+ /** Get the value from the given attribute
+ *
+ * @return null if the attribute value is empty or the attribute is not present
+ */
+ public static String getAttributeValue(Element el, String attrName)
+ {
+ return getAttributeValue(el, new QName(attrName));
+ }
+
+ /** Get the value from the given attribute
+ *
+ * @return null if the attribute value is empty or the attribute is not present
+ */
+ public static String getAttributeValue(Element el, QName attrName)
+ {
+ String attr = null;
+ if ("".equals(attrName.getNamespaceURI()))
+ attr = el.getAttribute(attrName.getLocalPart());
+ else
+ attr = el.getAttributeNS(attrName.getNamespaceURI(), attrName.getLocalPart());
+
+ if ("".equals(attr))
+ attr = null;
+
+ return attr;
+ }
+
+ /** Get the qname value from the given attribute
+ */
+ public static QName getAttributeValueAsQName(Element el, String attrName)
+ {
+ return getAttributeValueAsQName(el, new QName(attrName));
+
+ }
+
+ /** Get the qname value from the given attribute
+ */
+ public static QName getAttributeValueAsQName(Element el, QName attrName)
+ {
+ QName qname = null;
+
+ String qualifiedName = getAttributeValue(el, attrName);
+ if (qualifiedName != null)
+ {
+ qname = resolveQName(el, qualifiedName);
+ }
+
+ return qname;
+ }
+
+ /** Get the boolean value from the given attribute
+ */
+ public static boolean getAttributeValueAsBoolean(Element el, String attrName)
+ {
+ return getAttributeValueAsBoolean(el, new QName(attrName));
+ }
+
+ /** Get the boolean value from the given attribute
+ */
+ public static boolean getAttributeValueAsBoolean(Element el, QName attrName)
+ {
+ String attrVal = getAttributeValue(el, attrName);
+ boolean ret = "true".equalsIgnoreCase(attrVal) || "1".equalsIgnoreCase(attrVal);
+ return ret;
+ }
+
+ /** Get the integer value from the given attribute
+ */
+ public static Integer getAttributeValueAsInteger(Element el, String attrName)
+ {
+ return getAttributeValueAsInteger(el, new QName(attrName));
+ }
+
+ /** Get the integer value from the given attribute
+ */
+ public static Integer getAttributeValueAsInteger(Element el, QName attrName)
+ {
+ String attrVal = getAttributeValue(el, attrName);
+ return (attrVal != null ? new Integer(attrVal) : null);
+ }
+
+ /** Get the attributes as Map<QName, String>
+ */
+ public static Map<QName, String> getAttributes(Element el)
+ {
+ Map<QName, String> attmap = new HashMap<QName, String>();
+ NamedNodeMap attribs = el.getAttributes();
+ int len = attribs.getLength();
+ for (int i = 0; i < len; i++)
+ {
+ Attr attr = (Attr) attribs.item(i);
+ String name = attr.getName();
+ QName qname = resolveQName(el, name);
+ String value = attr.getNodeValue();
+ attmap.put(qname, value);
+ }
+ return attmap;
+ }
+
+ /** Copy attributes between elements
+ */
+ public static void copyAttributes(Element destElement, Element srcElement)
+ {
+ NamedNodeMap attribs = srcElement.getAttributes();
+ int len = attribs.getLength();
+ for (int i = 0; i < len; i++)
+ {
+ Attr attr = (Attr) attribs.item(i);
+ String uri = attr.getNamespaceURI();
+ String qname = attr.getName();
+ String value = attr.getNodeValue();
+
+ // Prevent DOMException: NAMESPACE_ERR: An attempt is made to create or
+ // change an object in a way which is incorrect with regard to namespaces.
+ if (uri == null && qname.startsWith("xmlns"))
+ {
+ if (log.isTraceEnabled())
+ log.trace("Ignore attribute: [uri=" + uri + ",qname=" + qname + ",value=" + value + "]");
+ }
+ else
+ {
+ destElement.setAttributeNS(uri, qname, value);
+ }
+ }
+ }
+
+ /** True if the node has text child elements only
+ */
+ public static boolean hasTextChildNodesOnly(Node node)
+ {
+ NodeList nodeList = node.getChildNodes();
+ int len = nodeList.getLength();
+ if (len == 0)
+ return false;
+
+ for (int i = 0; i < len; i++)
+ {
+ Node acksToChildNode = nodeList.item(i);
+ if (acksToChildNode.getNodeType() != Node.TEXT_NODE)
+ return false;
+ }
+
+ return true;
+ }
+
+ /** True if the node has child elements
+ */
+ public static boolean hasChildElements(Node node)
+ {
+ NodeList nlist = node.getChildNodes();
+ int len = nlist.getLength();
+ for (int i = 0; i < len; i++)
+ {
+ Node child = nlist.item(i);
+ if (child.getNodeType() == Node.ELEMENT_NODE)
+ return true;
+ }
+ return false;
+ }
+
+ /** Gets child elements
+ */
+ public static Iterator<Element> getChildElements(Node node)
+ {
+ List<Element> list = new LinkedList<Element>();
+ NodeList nlist = node.getChildNodes();
+ int len = nlist.getLength();
+ for (int i = 0; i < len; i++)
+ {
+ Node child = nlist.item(i);
+ if (child.getNodeType() == Node.ELEMENT_NODE)
+ list.add((Element) child);
+ }
+ return list.iterator();
+ }
+
+ /** Get the concatenated text content, or null.
+ */
+ public static String getTextContent(Node node)
+ {
+ boolean hasTextContent = false;
+ StringBuilder buffer = new StringBuilder();
+ NodeList nlist = node.getChildNodes();
+ int len = nlist.getLength();
+ for (int i = 0; i < len; i++)
+ {
+ Node child = nlist.item(i);
+ if (child.getNodeType() == Node.TEXT_NODE)
+ {
+ buffer.append(child.getNodeValue());
+ hasTextContent = true;
+ }
+ }
+ return (hasTextContent ? buffer.toString() : null);
+ }
+
+ /** Gets the first child element
+ */
+ public static Element getFirstChildElement(Node node)
+ {
+ return getFirstChildElement(node, false);
+ }
+
+ /** Gets the first child element
+ */
+ public static Element getFirstChildElement(Node node, boolean recursive)
+ {
+ return getFirstChildElementIntern(node, null, recursive);
+ }
+
+ /** Gets the first child element for a given local name without namespace
+ */
+ public static Element getFirstChildElement(Node node, String nodeName)
+ {
+ return getFirstChildElement(node, nodeName, false);
+ }
+
+ /** Gets the first child element for a given local name without namespace
+ */
+ public static Element getFirstChildElement(Node node, String nodeName, boolean recursive)
+ {
+ return getFirstChildElementIntern(node, new QName(nodeName), recursive);
+ }
+
+ /** Gets the first child element for a given qname
+ */
+ public static Element getFirstChildElement(Node node, QName nodeName)
+ {
+ return getFirstChildElement(node, nodeName, false);
+ }
+
+ /** Gets the first child element for a given qname
+ */
+ public static Element getFirstChildElement(Node node, QName nodeName, boolean recursive)
+ {
+ return getFirstChildElementIntern(node, nodeName, recursive);
+ }
+
+ private static Element getFirstChildElementIntern(Node node, QName nodeName, boolean recursive)
+ {
+ Element childElement = null;
+ Iterator<Element> it = getChildElementsIntern(node, nodeName, recursive);
+ if (it.hasNext())
+ {
+ childElement = (Element) it.next();
+ }
+ return childElement;
+ }
+
+ /** Gets the child elements for a given local name without namespace
+ */
+ public static Iterator<Element> getChildElements(Node node, String nodeName)
+ {
+ return getChildElements(node, nodeName, false);
+ }
+
+ /** Gets the child elements for a given local name without namespace
+ */
+ public static Iterator<Element> getChildElements(Node node, String nodeName, boolean recursive)
+ {
+ return getChildElementsIntern(node, new QName(nodeName), recursive);
+ }
+
+ /** Gets the child element for a given qname
+ */
+ public static Iterator<Element> getChildElements(Node node, QName nodeName)
+ {
+ return getChildElements(node, nodeName, false);
+ }
+
+ /** Gets the child element for a given qname
+ */
+ public static Iterator<Element> getChildElements(Node node, QName nodeName, boolean recursive)
+ {
+ return getChildElementsIntern(node, nodeName, recursive);
+ }
+
+ public static List<Element> getChildElementsAsList(Node node, String nodeName)
+ {
+ return getChildElementsAsList(node, nodeName, false);
+ }
+
+ public static List<Element> getChildElementsAsList(Node node, String nodeName, boolean recursive)
+ {
+ return getChildElementsAsListIntern(node, new QName(nodeName), recursive);
+ }
+
+ public static List<Element> getChildElementsAsList(Node node, QName nodeName)
+ {
+ return getChildElementsAsList(node, nodeName, false);
+ }
+
+ public static List<Element> getChildElementsAsList(Node node, QName nodeName, boolean recursive)
+ {
+ return getChildElementsAsListIntern(node, nodeName, recursive);
+ }
+
+ private static List<Element> getChildElementsAsListIntern(Node node, QName nodeName, boolean recursive)
+ {
+ List<Element> list = new LinkedList<Element>();
+
+ NodeList nlist = node.getChildNodes();
+ int len = nlist.getLength();
+ for (int i = 0; i < len; i++)
+ {
+ Node child = nlist.item(i);
+ if (child.getNodeType() == Node.ELEMENT_NODE)
+ {
+ search(list, (Element) child, nodeName, recursive);
+ }
+ }
+ return list;
+ }
+
+ private static void search(List<Element> list, Element baseElement, QName nodeName, boolean recursive)
+ {
+ if (nodeName == null)
+ {
+ list.add(baseElement);
+ }
+ else
+ {
+ QName qname;
+ if (nodeName.getNamespaceURI().length() > 0)
+ {
+ qname = new QName(baseElement.getNamespaceURI(), baseElement.getLocalName());
+ }
+ else
+ {
+ qname = new QName(baseElement.getLocalName());
+ }
+ if (qname.equals(nodeName))
+ {
+ list.add(baseElement);
+ }
+ }
+ if (recursive)
+ {
+ NodeList nlist = baseElement.getChildNodes();
+ int len = nlist.getLength();
+ for (int i = 0; i < len; i++)
+ {
+ Node child = nlist.item(i);
+ if (child.getNodeType() == Node.ELEMENT_NODE)
+ {
+ search(list, (Element) child, nodeName, recursive);
+ }
+ }
+ }
+ }
+
+ private static Iterator<Element> getChildElementsIntern(Node node, QName nodeName, boolean recursive)
+ {
+ return getChildElementsAsListIntern(node, nodeName, recursive).iterator();
+ }
+
+ /** Gets parent element or null if there is none
+ */
+ public static Element getParentElement(Node node)
+ {
+ Node parent = node.getParentNode();
+ return (parent instanceof Element ? (Element) parent : null);
+ }
+
+ public static Element sourceToElement(Source source, DocumentBuilder builder) throws IOException
+ {
+ Element retElement = null;
+
+ if (source instanceof StreamSource)
+ {
+ StreamSource streamSource = (StreamSource) source;
+
+ InputStream ins = streamSource.getInputStream();
+ if (ins != null)
+ {
+ retElement = DOMUtils.parse(ins, builder);
+ }
+ Reader reader = streamSource.getReader();
+ if (reader != null)
+ {
+ retElement = DOMUtils.parse(new InputSource(reader), builder);
+ }
+ }
+ else if (source instanceof DOMSource)
+ {
+ DOMSource domSource = (DOMSource) source;
+ Node node = domSource.getNode();
+ if (node instanceof Element)
+ {
+ retElement = (Element) node;
+ }
+ else if (node instanceof Document)
+ {
+ retElement = ((Document) node).getDocumentElement();
+ }
+ }
+ else if (source instanceof SAXSource)
+ {
+ // The fact that JAXBSource derives from SAXSource is an implementation detail.
+ // Thus in general applications are strongly discouraged from accessing methods defined on SAXSource.
+ // The XMLReader object obtained by the getXMLReader method shall be used only for parsing the InputSource object returned by the getInputSource method.
+
+ final boolean hasInputSource = ((SAXSource) source).getInputSource() != null;
+ final boolean hasXMLReader = ((SAXSource) source).getXMLReader() != null;
+
+ if (hasInputSource || hasXMLReader)
+ {
+ try
+ {
+ TransformerFactory tf = TransformerFactory.newInstance();
+ ByteArrayOutputStream baos = new ByteArrayOutputStream(1024);
+ Transformer transformer = tf.newTransformer();
+ transformer.setOutputProperty(OutputKeys.OMIT_XML_DECLARATION, "yes");
+ transformer.setOutputProperty(OutputKeys.METHOD, "xml");
+ transformer.transform(source, new StreamResult(baos));
+ retElement = DOMUtils.parse(new ByteArrayInputStream(baos.toByteArray()), builder);
+ }
+ catch (TransformerException ex)
+ {
+ throw new IOException(ex);
+ }
+ }
+ }
+ else
+ {
+ throw new RuntimeException("Source type not implemented: " + source.getClass().getName());
+ }
+
+ return retElement;
+ }
+
+ /** Parse the given XML string and return the root Element
+ */
+ public static Element parse(String xmlString, DocumentBuilder builder) throws IOException
+ {
+ try
+ {
+ return parse(new ByteArrayInputStream(xmlString.getBytes("UTF-8")), builder);
+ }
+ catch (IOException e)
+ {
+ log.error("Cannot parse: " + xmlString);
+ throw e;
+ }
+ }
+
+ /** Parse the given XML stream and return the root Element
+ */
+ public static Element parse(InputStream xmlStream, DocumentBuilder builder) throws IOException
+ {
+ try
+ {
+ Document doc;
+ synchronized (builder) //synchronize to prevent concurrent parsing on the same DocumentBuilder
+ {
+ doc = builder.parse(xmlStream);
+ }
+ return doc.getDocumentElement();
+ }
+ catch (SAXException se)
+ {
+ throw new IOException(se.toString());
+ }
+ finally
+ {
+ xmlStream.close();
+ }
+ }
+
+ /** Parse the given input source and return the root Element
+ */
+ public static Element parse(InputSource source, DocumentBuilder builder) throws IOException
+ {
+ try
+ {
+ Document doc;
+ synchronized (builder) //synchronize to prevent concurrent parsing on the same DocumentBuilder
+ {
+ doc = builder.parse(source);
+ }
+ return doc.getDocumentElement();
+ }
+ catch (SAXException se)
+ {
+ throw new IOException(se.toString());
+ }
+ finally
+ {
+ InputStream is = source.getByteStream();
+ if (is != null)
+ {
+ is.close();
+ }
+ Reader r = source.getCharacterStream();
+ if (r != null)
+ {
+ r.close();
+ }
+ }
+ }
+
+ /** Create an Element for a given name, prefix and uri
+ */
+ public static Element createElement(String localPart, String prefix, String uri, Document doc)
+ {
+ if (prefix == null || prefix.length() == 0)
+ {
+ if (log.isTraceEnabled())
+ log.trace("createElement {" + uri + "}" + localPart);
+ return doc.createElementNS(uri, localPart);
+ }
+ else
+ {
+ if (log.isTraceEnabled())
+ log.trace("createElement {" + uri + "}" + prefix + ":" + localPart);
+ return doc.createElementNS(uri, prefix + ":" + localPart);
+ }
+ }
+}
13 years
JBossWS SVN: r14092 - in stack/cxf/trunk/modules/resources/src/main/resources/modules/org: jboss/as/webservices/server/integration/main and 3 other directories.
by jbossws-commits@lists.jboss.org
Author: alessio.soldano(a)jboss.com
Date: 2011-04-14 11:12:21 -0400 (Thu, 14 Apr 2011)
New Revision: 14092
Removed:
stack/cxf/trunk/modules/resources/src/main/resources/modules/org/jboss/ws/tools/
Modified:
stack/cxf/trunk/modules/resources/src/main/resources/modules/org/apache/cxf/main/module.xml
stack/cxf/trunk/modules/resources/src/main/resources/modules/org/jboss/as/webservices/server/integration/main/module.xml
stack/cxf/trunk/modules/resources/src/main/resources/modules/org/jboss/ws/common/main/module.xml
stack/cxf/trunk/modules/resources/src/main/resources/modules/org/jboss/ws/jaxws-client/main/module.xml
Log:
Rollback Richard's changes that does not work with the current AS7 upstream master; I'm going to move them to a branch later
svn merge -r 14090:14089 https://svn.jboss.org/repos/jbossws/stack/cxf/trunk .
Modified: stack/cxf/trunk/modules/resources/src/main/resources/modules/org/apache/cxf/main/module.xml
===================================================================
--- stack/cxf/trunk/modules/resources/src/main/resources/modules/org/apache/cxf/main/module.xml 2011-04-14 14:39:40 UTC (rev 14091)
+++ stack/cxf/trunk/modules/resources/src/main/resources/modules/org/apache/cxf/main/module.xml 2011-04-14 15:12:21 UTC (rev 14092)
@@ -41,7 +41,6 @@
<module name="javax.xml.stream.api" />
<module name="javax.xml.ws.api" />
<module name="org.apache.neethi" />
- <module name="org.apache.velocity" />
<module name="org.apache.ws.commons.xmlschema" />
<module name="org.apache.ws.security" />
<module name="org.apache.santuario.xmlsec" />
Modified: stack/cxf/trunk/modules/resources/src/main/resources/modules/org/jboss/as/webservices/server/integration/main/module.xml
===================================================================
--- stack/cxf/trunk/modules/resources/src/main/resources/modules/org/jboss/as/webservices/server/integration/main/module.xml 2011-04-14 14:39:40 UTC (rev 14091)
+++ stack/cxf/trunk/modules/resources/src/main/resources/modules/org/jboss/as/webservices/server/integration/main/module.xml 2011-04-14 15:12:21 UTC (rev 14092)
@@ -28,10 +28,7 @@
</resources>
<dependencies>
- <module name="javax.api" export="true"/>
- <module name="javax.jws.api" export="true"/>
<module name="javax.wsdl4j.api" export="true"/>
- <module name="javax.xml.ws.api" export="true"/>
<module name="com.sun.xml.bind" services="export" export="true"/>
<module name="org.jboss.ws.api" export="true"/>
<module name="org.jboss.ws.spi" export="true"/>
Modified: stack/cxf/trunk/modules/resources/src/main/resources/modules/org/jboss/ws/common/main/module.xml
===================================================================
--- stack/cxf/trunk/modules/resources/src/main/resources/modules/org/jboss/ws/common/main/module.xml 2011-04-14 14:39:40 UTC (rev 14091)
+++ stack/cxf/trunk/modules/resources/src/main/resources/modules/org/jboss/ws/common/main/module.xml 2011-04-14 15:12:21 UTC (rev 14092)
@@ -29,7 +29,6 @@
</resources>
<dependencies>
- <module name="gnu.getopt"/>
<module name="javax.api"/>
<module name="javax.annotation.api"/>
<module name="javax.ejb.api"/>
@@ -37,12 +36,10 @@
<module name="javax.servlet.api"/>
<module name="javax.wsdl4j.api" />
<module name="javax.xml.ws.api"/>
- <module name="org.jboss.modules"/>
<module name="org.jboss.ws.api"/>
<module name="org.jboss.ws.spi"/>
<module name="org.jboss.logging"/>
<module name="org.jboss.common-core"/>
- <module name="org.apache.log4j"/>
<module name="org.apache.xerces" services="import"/>
</dependencies>
Modified: stack/cxf/trunk/modules/resources/src/main/resources/modules/org/jboss/ws/jaxws-client/main/module.xml
===================================================================
--- stack/cxf/trunk/modules/resources/src/main/resources/modules/org/jboss/ws/jaxws-client/main/module.xml 2011-04-14 14:39:40 UTC (rev 14091)
+++ stack/cxf/trunk/modules/resources/src/main/resources/modules/org/jboss/ws/jaxws-client/main/module.xml 2011-04-14 15:12:21 UTC (rev 14092)
@@ -49,7 +49,6 @@
<include path="META-INF/"/>
</imports>
</module>
- <module name="org.apache.log4j" />
<module name="org.apache.neethi" />
<module name="org.jboss.logging" />
<module name="org.springframework.spring" optional="true" />
13 years
JBossWS SVN: r14091 - in stack/cxf: tags and 1 other directory.
by jbossws-commits@lists.jboss.org
Author: alessio.soldano(a)jboss.com
Date: 2011-04-14 10:39:40 -0400 (Thu, 14 Apr 2011)
New Revision: 14091
Added:
stack/cxf/tags/jbossws-cxf-4.0.0.Alpha4/
Removed:
stack/cxf/branches/asoldano/
Log:
Tag jbossws-cxf-4.0.0.Alpha4
13 years
JBossWS SVN: r14090 - in stack/cxf/trunk/modules/resources/src/main/resources/modules/org: jboss/as/webservices/server/integration/main and 8 other directories.
by jbossws-commits@lists.jboss.org
Author: richard.opalka(a)jboss.com
Date: 2011-04-14 08:58:25 -0400 (Thu, 14 Apr 2011)
New Revision: 14090
Added:
stack/cxf/trunk/modules/resources/src/main/resources/modules/org/jboss/ws/tools/
stack/cxf/trunk/modules/resources/src/main/resources/modules/org/jboss/ws/tools/wsconsume/
stack/cxf/trunk/modules/resources/src/main/resources/modules/org/jboss/ws/tools/wsconsume/main/
stack/cxf/trunk/modules/resources/src/main/resources/modules/org/jboss/ws/tools/wsconsume/main/module.xml
stack/cxf/trunk/modules/resources/src/main/resources/modules/org/jboss/ws/tools/wsprovide/
stack/cxf/trunk/modules/resources/src/main/resources/modules/org/jboss/ws/tools/wsprovide/main/
stack/cxf/trunk/modules/resources/src/main/resources/modules/org/jboss/ws/tools/wsprovide/main/module.xml
Modified:
stack/cxf/trunk/modules/resources/src/main/resources/modules/org/apache/cxf/main/module.xml
stack/cxf/trunk/modules/resources/src/main/resources/modules/org/jboss/as/webservices/server/integration/main/module.xml
stack/cxf/trunk/modules/resources/src/main/resources/modules/org/jboss/ws/common/main/module.xml
stack/cxf/trunk/modules/resources/src/main/resources/modules/org/jboss/ws/jaxws-client/main/module.xml
Log:
[JBWS-3222] enabling wsprovide.sh(.bat) & wsconsume.sh(.bat) command line tools for CXF
Modified: stack/cxf/trunk/modules/resources/src/main/resources/modules/org/apache/cxf/main/module.xml
===================================================================
--- stack/cxf/trunk/modules/resources/src/main/resources/modules/org/apache/cxf/main/module.xml 2011-04-14 12:29:52 UTC (rev 14089)
+++ stack/cxf/trunk/modules/resources/src/main/resources/modules/org/apache/cxf/main/module.xml 2011-04-14 12:58:25 UTC (rev 14090)
@@ -41,6 +41,7 @@
<module name="javax.xml.stream.api" />
<module name="javax.xml.ws.api" />
<module name="org.apache.neethi" />
+ <module name="org.apache.velocity" />
<module name="org.apache.ws.commons.xmlschema" />
<module name="org.apache.ws.security" />
<module name="org.apache.santuario.xmlsec" />
Modified: stack/cxf/trunk/modules/resources/src/main/resources/modules/org/jboss/as/webservices/server/integration/main/module.xml
===================================================================
--- stack/cxf/trunk/modules/resources/src/main/resources/modules/org/jboss/as/webservices/server/integration/main/module.xml 2011-04-14 12:29:52 UTC (rev 14089)
+++ stack/cxf/trunk/modules/resources/src/main/resources/modules/org/jboss/as/webservices/server/integration/main/module.xml 2011-04-14 12:58:25 UTC (rev 14090)
@@ -28,7 +28,10 @@
</resources>
<dependencies>
+ <module name="javax.api" export="true"/>
+ <module name="javax.jws.api" export="true"/>
<module name="javax.wsdl4j.api" export="true"/>
+ <module name="javax.xml.ws.api" export="true"/>
<module name="com.sun.xml.bind" services="export" export="true"/>
<module name="org.jboss.ws.api" export="true"/>
<module name="org.jboss.ws.spi" export="true"/>
Modified: stack/cxf/trunk/modules/resources/src/main/resources/modules/org/jboss/ws/common/main/module.xml
===================================================================
--- stack/cxf/trunk/modules/resources/src/main/resources/modules/org/jboss/ws/common/main/module.xml 2011-04-14 12:29:52 UTC (rev 14089)
+++ stack/cxf/trunk/modules/resources/src/main/resources/modules/org/jboss/ws/common/main/module.xml 2011-04-14 12:58:25 UTC (rev 14090)
@@ -29,6 +29,7 @@
</resources>
<dependencies>
+ <module name="gnu.getopt"/>
<module name="javax.api"/>
<module name="javax.annotation.api"/>
<module name="javax.ejb.api"/>
@@ -36,10 +37,12 @@
<module name="javax.servlet.api"/>
<module name="javax.wsdl4j.api" />
<module name="javax.xml.ws.api"/>
+ <module name="org.jboss.modules"/>
<module name="org.jboss.ws.api"/>
<module name="org.jboss.ws.spi"/>
<module name="org.jboss.logging"/>
<module name="org.jboss.common-core"/>
+ <module name="org.apache.log4j"/>
<module name="org.apache.xerces" services="import"/>
</dependencies>
Modified: stack/cxf/trunk/modules/resources/src/main/resources/modules/org/jboss/ws/jaxws-client/main/module.xml
===================================================================
--- stack/cxf/trunk/modules/resources/src/main/resources/modules/org/jboss/ws/jaxws-client/main/module.xml 2011-04-14 12:29:52 UTC (rev 14089)
+++ stack/cxf/trunk/modules/resources/src/main/resources/modules/org/jboss/ws/jaxws-client/main/module.xml 2011-04-14 12:58:25 UTC (rev 14090)
@@ -49,6 +49,7 @@
<include path="META-INF/"/>
</imports>
</module>
+ <module name="org.apache.log4j" />
<module name="org.apache.neethi" />
<module name="org.jboss.logging" />
<module name="org.springframework.spring" optional="true" />
Added: stack/cxf/trunk/modules/resources/src/main/resources/modules/org/jboss/ws/tools/wsconsume/main/module.xml
===================================================================
--- stack/cxf/trunk/modules/resources/src/main/resources/modules/org/jboss/ws/tools/wsconsume/main/module.xml (rev 0)
+++ stack/cxf/trunk/modules/resources/src/main/resources/modules/org/jboss/ws/tools/wsconsume/main/module.xml 2011-04-14 12:58:25 UTC (rev 14090)
@@ -0,0 +1,33 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+ ~ 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.
+ -->
+
+<module xmlns="urn:jboss:module:1.0" name="org.jboss.ws.tools.wsconsume">
+
+ <main-class name="org.jboss.wsf.spi.tools.cmd.WSConsume"/>
+
+ <dependencies>
+ <module name="org.jboss.ws.common"/>
+ </dependencies>
+
+</module>
Added: stack/cxf/trunk/modules/resources/src/main/resources/modules/org/jboss/ws/tools/wsprovide/main/module.xml
===================================================================
--- stack/cxf/trunk/modules/resources/src/main/resources/modules/org/jboss/ws/tools/wsprovide/main/module.xml (rev 0)
+++ stack/cxf/trunk/modules/resources/src/main/resources/modules/org/jboss/ws/tools/wsprovide/main/module.xml 2011-04-14 12:58:25 UTC (rev 14090)
@@ -0,0 +1,33 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+ ~ 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.
+ -->
+
+<module xmlns="urn:jboss:module:1.0" name="org.jboss.ws.tools.wsprovide">
+
+ <main-class name="org.jboss.wsf.spi.tools.cmd.WSProvide"/>
+
+ <dependencies>
+ <module name="org.jboss.ws.common"/>
+ </dependencies>
+
+</module>
13 years
JBossWS SVN: r14089 - in stack/native/trunk: modules/core/src/main/java/org/jboss/ws/tools/jaxws/impl and 29 other directories.
by jbossws-commits@lists.jboss.org
Author: richard.opalka(a)jboss.com
Date: 2011-04-14 08:29:52 -0400 (Thu, 14 Apr 2011)
New Revision: 14089
Added:
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/tools/jaxws/impl/SecurityActions.java
stack/native/trunk/modules/resources/src/main/resources/modules/com/sun/tools/
stack/native/trunk/modules/resources/src/main/resources/modules/com/sun/tools/javac/
stack/native/trunk/modules/resources/src/main/resources/modules/com/sun/tools/javac/main/
stack/native/trunk/modules/resources/src/main/resources/modules/com/sun/tools/javac/main/module.xml
stack/native/trunk/modules/resources/src/main/resources/modules/com/sun/tools/ws/
stack/native/trunk/modules/resources/src/main/resources/modules/com/sun/tools/ws/main/
stack/native/trunk/modules/resources/src/main/resources/modules/com/sun/tools/ws/main/module.xml
stack/native/trunk/modules/resources/src/main/resources/modules/com/sun/xml/stream/
stack/native/trunk/modules/resources/src/main/resources/modules/com/sun/xml/stream/buffer/
stack/native/trunk/modules/resources/src/main/resources/modules/com/sun/xml/stream/buffer/main/
stack/native/trunk/modules/resources/src/main/resources/modules/com/sun/xml/stream/buffer/main/module.xml
stack/native/trunk/modules/resources/src/main/resources/modules/com/sun/xml/ws/
stack/native/trunk/modules/resources/src/main/resources/modules/com/sun/xml/ws/main/
stack/native/trunk/modules/resources/src/main/resources/modules/com/sun/xml/ws/main/module.xml
stack/native/trunk/modules/resources/src/main/resources/modules/com/sun/xml/ws/policy/
stack/native/trunk/modules/resources/src/main/resources/modules/com/sun/xml/ws/policy/main/
stack/native/trunk/modules/resources/src/main/resources/modules/com/sun/xml/ws/policy/main/module.xml
stack/native/trunk/modules/resources/src/main/resources/modules/org/jboss/ws/tools/
stack/native/trunk/modules/resources/src/main/resources/modules/org/jboss/ws/tools/wsconsume/
stack/native/trunk/modules/resources/src/main/resources/modules/org/jboss/ws/tools/wsconsume/main/
stack/native/trunk/modules/resources/src/main/resources/modules/org/jboss/ws/tools/wsconsume/main/module.xml
stack/native/trunk/modules/resources/src/main/resources/modules/org/jboss/ws/tools/wsprovide/
stack/native/trunk/modules/resources/src/main/resources/modules/org/jboss/ws/tools/wsprovide/main/
stack/native/trunk/modules/resources/src/main/resources/modules/org/jboss/ws/tools/wsprovide/main/module.xml
stack/native/trunk/modules/resources/src/main/resources/modules/org/jvnet/
stack/native/trunk/modules/resources/src/main/resources/modules/org/jvnet/staxex/
stack/native/trunk/modules/resources/src/main/resources/modules/org/jvnet/staxex/main/
stack/native/trunk/modules/resources/src/main/resources/modules/org/jvnet/staxex/main/module.xml
Modified:
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/tools/jaxws/impl/JBossWSProviderImpl.java
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/tools/jaxws/impl/SunRIConsumerImpl.java
stack/native/trunk/modules/resources/src/main/resources/modules/org/jboss/as/webservices/server/integration/main/module.xml
stack/native/trunk/modules/resources/src/main/resources/modules/org/jboss/ws/common/main/module.xml
stack/native/trunk/modules/resources/src/main/resources/modules/org/jboss/ws/native/jbossws-native-core/main/module.xml
stack/native/trunk/modules/resources/src/main/resources/resources/jbossws-deploy-macros.xml
stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/tools/scripts/ScriptTestCase.java
stack/native/trunk/pom.xml
Log:
[JBWS-3222] enabling wsprovide.sh(.bat) & wsconsume.sh(.bat) command line tools for native
Modified: stack/native/trunk/modules/core/src/main/java/org/jboss/ws/tools/jaxws/impl/JBossWSProviderImpl.java
===================================================================
--- stack/native/trunk/modules/core/src/main/java/org/jboss/ws/tools/jaxws/impl/JBossWSProviderImpl.java 2011-04-14 11:45:13 UTC (rev 14088)
+++ stack/native/trunk/modules/core/src/main/java/org/jboss/ws/tools/jaxws/impl/JBossWSProviderImpl.java 2011-04-14 12:29:52 UTC (rev 14089)
@@ -130,14 +130,20 @@
@Override
public void provide(String endpointClass)
{
+ final ClassLoader origLoader = SecurityActions.getContextClassLoader();
try
{
+ SecurityActions.setContextClassLoader(loader);
provide(loader.loadClass(endpointClass));
}
catch (ClassNotFoundException e)
{
throw new WSException("Class not found: " + endpointClass);
}
+ finally
+ {
+ SecurityActions.setContextClassLoader(origLoader);
+ }
}
@Override
Added: stack/native/trunk/modules/core/src/main/java/org/jboss/ws/tools/jaxws/impl/SecurityActions.java
===================================================================
--- stack/native/trunk/modules/core/src/main/java/org/jboss/ws/tools/jaxws/impl/SecurityActions.java (rev 0)
+++ stack/native/trunk/modules/core/src/main/java/org/jboss/ws/tools/jaxws/impl/SecurityActions.java 2011-04-14 12:29:52 UTC (rev 14089)
@@ -0,0 +1,89 @@
+/*
+ * 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.ws.tools.jaxws.impl;
+
+import java.security.AccessController;
+import java.security.PrivilegedAction;
+
+/**
+ * TCCL utility methods.
+ *
+ * @author <a href="mailto:ropalka@redhat.com">Richard Opalka</a>
+ */
+final class SecurityActions
+{
+
+ private SecurityActions()
+ {
+ // forbidden instantiation
+ }
+
+ /**
+ * Get context classloader.
+ *
+ * @return the current context classloader
+ */
+ static ClassLoader getContextClassLoader()
+ {
+ SecurityManager sm = System.getSecurityManager();
+ if (sm == null)
+ {
+ return Thread.currentThread().getContextClassLoader();
+ }
+ else
+ {
+ return AccessController.doPrivileged(new PrivilegedAction<ClassLoader>() {
+ public ClassLoader run()
+ {
+ return Thread.currentThread().getContextClassLoader();
+ }
+ });
+ }
+ }
+
+ /**
+ * Set context classloader.
+ *
+ * @param classLoader the classloader
+ */
+ static void setContextClassLoader(final ClassLoader classLoader)
+ {
+ if (System.getSecurityManager() == null)
+ {
+ Thread.currentThread().setContextClassLoader(classLoader);
+ }
+ else
+ {
+ AccessController.doPrivileged(new PrivilegedAction<Object>()
+ {
+ public Object run()
+ {
+ Thread.currentThread().setContextClassLoader(classLoader);
+ return null;
+ }
+ });
+ }
+ }
+
+
+}
Modified: stack/native/trunk/modules/core/src/main/java/org/jboss/ws/tools/jaxws/impl/SunRIConsumerImpl.java
===================================================================
--- stack/native/trunk/modules/core/src/main/java/org/jboss/ws/tools/jaxws/impl/SunRIConsumerImpl.java 2011-04-14 11:45:13 UTC (rev 14088)
+++ stack/native/trunk/modules/core/src/main/java/org/jboss/ws/tools/jaxws/impl/SunRIConsumerImpl.java 2011-04-14 12:29:52 UTC (rev 14089)
@@ -197,6 +197,7 @@
if (stream != null)
{
args.add("-verbose");
+ args.add("-Xdebug");
}
else
{
Added: stack/native/trunk/modules/resources/src/main/resources/modules/com/sun/tools/javac/main/module.xml
===================================================================
--- stack/native/trunk/modules/resources/src/main/resources/modules/com/sun/tools/javac/main/module.xml (rev 0)
+++ stack/native/trunk/modules/resources/src/main/resources/modules/com/sun/tools/javac/main/module.xml 2011-04-14 12:29:52 UTC (rev 14089)
@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+ ~ 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.
+ -->
+<module xmlns="urn:jboss:module:1.0" name="com.sun.tools.javac">
+ <dependencies>
+ <module name="system" export="false">
+ <exports>
+ <include-set>
+ <path name="com/sun/tools/javac"/>
+ </include-set>
+ </exports>
+ </module>
+ </dependencies>
+</module>
Added: stack/native/trunk/modules/resources/src/main/resources/modules/com/sun/tools/ws/main/module.xml
===================================================================
--- stack/native/trunk/modules/resources/src/main/resources/modules/com/sun/tools/ws/main/module.xml (rev 0)
+++ stack/native/trunk/modules/resources/src/main/resources/modules/com/sun/tools/ws/main/module.xml 2011-04-14 12:29:52 UTC (rev 14089)
@@ -0,0 +1,41 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+ ~ 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.
+ -->
+
+<module xmlns="urn:jboss:module:1.0" name="com.sun.tools.ws">
+
+ <resources>
+ <!-- Insert resources here -->
+ </resources>
+
+ <dependencies>
+ <module name="javax.api"/>
+ <module name="javax.jws.api"/>
+ <module name="javax.xml.stream.api"/>
+ <module name="javax.xml.ws.api"/>
+ <module name="com.sun.xml.bind" services="import"/>
+ <module name="com.sun.xml.ws"/>
+ <module name="com.sun.xml.ws.policy"/>
+ </dependencies>
+
+</module>
Added: stack/native/trunk/modules/resources/src/main/resources/modules/com/sun/xml/stream/buffer/main/module.xml
===================================================================
--- stack/native/trunk/modules/resources/src/main/resources/modules/com/sun/xml/stream/buffer/main/module.xml (rev 0)
+++ stack/native/trunk/modules/resources/src/main/resources/modules/com/sun/xml/stream/buffer/main/module.xml 2011-04-14 12:29:52 UTC (rev 14089)
@@ -0,0 +1,37 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+ ~ JBoss, Home of Professional Open Source.
+ ~ Copyright 2010, 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.
+ -->
+
+<module xmlns="urn:jboss:module:1.0" name="com.sun.xml.stream.buffer">
+
+ <resources>
+ <!-- Insert resources here -->
+ </resources>
+
+ <dependencies>
+ <module name="javax.api"/>
+ <module name="javax.xml.stream.api"/>
+ <module name="org.jvnet.staxex"/>
+ </dependencies>
+
+</module>
Added: stack/native/trunk/modules/resources/src/main/resources/modules/com/sun/xml/ws/main/module.xml
===================================================================
--- stack/native/trunk/modules/resources/src/main/resources/modules/com/sun/xml/ws/main/module.xml (rev 0)
+++ stack/native/trunk/modules/resources/src/main/resources/modules/com/sun/xml/ws/main/module.xml 2011-04-14 12:29:52 UTC (rev 14089)
@@ -0,0 +1,38 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+ ~ JBoss, Home of Professional Open Source.
+ ~ Copyright 2010, 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.
+ -->
+
+<module xmlns="urn:jboss:module:1.0" name="com.sun.xml.ws">
+
+ <resources>
+ <!-- Insert resources here -->
+ </resources>
+
+ <dependencies>
+ <module name="com.sun.xml.stream.buffer"/>
+ <module name="javax.api"/>
+ <module name="javax.xml.stream.api"/>
+ <module name="javax.xml.ws.api"/>
+ </dependencies>
+
+</module>
Added: stack/native/trunk/modules/resources/src/main/resources/modules/com/sun/xml/ws/policy/main/module.xml
===================================================================
--- stack/native/trunk/modules/resources/src/main/resources/modules/com/sun/xml/ws/policy/main/module.xml (rev 0)
+++ stack/native/trunk/modules/resources/src/main/resources/modules/com/sun/xml/ws/policy/main/module.xml 2011-04-14 12:29:52 UTC (rev 14089)
@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+ ~ JBoss, Home of Professional Open Source.
+ ~ Copyright 2010, 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.
+ -->
+
+<module xmlns="urn:jboss:module:1.0" name="com.sun.xml.ws.policy">
+
+ <resources>
+ <!-- Insert resources here -->
+ </resources>
+
+ <dependencies>
+ <module name="javax.api"/>
+ </dependencies>
+</module>
Modified: stack/native/trunk/modules/resources/src/main/resources/modules/org/jboss/as/webservices/server/integration/main/module.xml
===================================================================
--- stack/native/trunk/modules/resources/src/main/resources/modules/org/jboss/as/webservices/server/integration/main/module.xml 2011-04-14 11:45:13 UTC (rev 14088)
+++ stack/native/trunk/modules/resources/src/main/resources/modules/org/jboss/as/webservices/server/integration/main/module.xml 2011-04-14 12:29:52 UTC (rev 14089)
@@ -28,13 +28,23 @@
</resources>
<dependencies>
+ <module name="javax.api"/>
+ <module name="javax.jws.api"/>
<module name="javax.wsdl4j.api" export="true"/>
+ <module name="javax.xml.ws.api"/>
<module name="com.sun.xml.bind" services="export" export="true"/>
+ <module name="com.sun.tools.javac"/>
<module name="org.jboss.ws.api" export="true"/>
<module name="org.jboss.ws.spi" export="true"/>
<module name="org.jboss.ws.common" export="true"/>
<module name="org.jboss.ws.native.jbossws-native-factories" services="export" export="true"/>
- <module name="org.jboss.ws.native.jbossws-native-core" services="export" export="true"/>
+ <module name="org.jboss.ws.native.jbossws-native-core" services="export" export="true">
+ <imports>
+ <include path="META-INF"/>
+ <include path="dtd"/>
+ <include path="schema"/>
+ </imports>
+ </module>
<module name="org.apache.xalan" services="export" export="true"/>
<module name="org.apache.xerces" services="export" export="true"/>
<module name="org.jboss.as.webservices" services="export" export="true"/>
Modified: stack/native/trunk/modules/resources/src/main/resources/modules/org/jboss/ws/common/main/module.xml
===================================================================
--- stack/native/trunk/modules/resources/src/main/resources/modules/org/jboss/ws/common/main/module.xml 2011-04-14 11:45:13 UTC (rev 14088)
+++ stack/native/trunk/modules/resources/src/main/resources/modules/org/jboss/ws/common/main/module.xml 2011-04-14 12:29:52 UTC (rev 14089)
@@ -29,6 +29,7 @@
</resources>
<dependencies>
+ <module name="gnu.getopt"/>
<module name="javax.api"/>
<module name="javax.annotation.api"/>
<module name="javax.ejb.api"/>
@@ -37,10 +38,12 @@
<module name="javax.wsdl4j.api" />
<module name="javax.xml.ws.api"/>
<module name="org.jboss.jaxbintros"/>
+ <module name="org.jboss.modules"/>
<module name="org.jboss.ws.api"/>
<module name="org.jboss.ws.spi"/>
<module name="org.jboss.logging"/>
<module name="org.jboss.common-core"/>
+ <module name="org.apache.log4j"/>
<module name="org.apache.xerces" services="import"/>
</dependencies>
</module>
Modified: stack/native/trunk/modules/resources/src/main/resources/modules/org/jboss/ws/native/jbossws-native-core/main/module.xml
===================================================================
--- stack/native/trunk/modules/resources/src/main/resources/modules/org/jboss/ws/native/jbossws-native-core/main/module.xml 2011-04-14 11:45:13 UTC (rev 14088)
+++ stack/native/trunk/modules/resources/src/main/resources/modules/org/jboss/ws/native/jbossws-native-core/main/module.xml 2011-04-14 12:29:52 UTC (rev 14089)
@@ -29,6 +29,7 @@
</resources>
<dependencies>
+ <module name="com.sun.tools.ws" services="import"/>
<module name="com.sun.xml.bind" services="import"/>
<module name="com.sun.xml.fastinfoset"/>
<module name="javax.api" />
Added: stack/native/trunk/modules/resources/src/main/resources/modules/org/jboss/ws/tools/wsconsume/main/module.xml
===================================================================
--- stack/native/trunk/modules/resources/src/main/resources/modules/org/jboss/ws/tools/wsconsume/main/module.xml (rev 0)
+++ stack/native/trunk/modules/resources/src/main/resources/modules/org/jboss/ws/tools/wsconsume/main/module.xml 2011-04-14 12:29:52 UTC (rev 14089)
@@ -0,0 +1,33 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+ ~ 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.
+ -->
+
+<module xmlns="urn:jboss:module:1.0" name="org.jboss.ws.tools.wsconsume">
+
+ <main-class name="org.jboss.wsf.spi.tools.cmd.WSConsume"/>
+
+ <dependencies>
+ <module name="org.jboss.ws.common"/>
+ </dependencies>
+
+</module>
Added: stack/native/trunk/modules/resources/src/main/resources/modules/org/jboss/ws/tools/wsprovide/main/module.xml
===================================================================
--- stack/native/trunk/modules/resources/src/main/resources/modules/org/jboss/ws/tools/wsprovide/main/module.xml (rev 0)
+++ stack/native/trunk/modules/resources/src/main/resources/modules/org/jboss/ws/tools/wsprovide/main/module.xml 2011-04-14 12:29:52 UTC (rev 14089)
@@ -0,0 +1,33 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+ ~ 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.
+ -->
+
+<module xmlns="urn:jboss:module:1.0" name="org.jboss.ws.tools.wsprovide">
+
+ <main-class name="org.jboss.wsf.spi.tools.cmd.WSProvide"/>
+
+ <dependencies>
+ <module name="org.jboss.ws.common"/>
+ </dependencies>
+
+</module>
Added: stack/native/trunk/modules/resources/src/main/resources/modules/org/jvnet/staxex/main/module.xml
===================================================================
--- stack/native/trunk/modules/resources/src/main/resources/modules/org/jvnet/staxex/main/module.xml (rev 0)
+++ stack/native/trunk/modules/resources/src/main/resources/modules/org/jvnet/staxex/main/module.xml 2011-04-14 12:29:52 UTC (rev 14089)
@@ -0,0 +1,36 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+ ~ 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.
+ -->
+
+<module xmlns="urn:jboss:module:1.0" name="org.jvnet.staxex">
+
+ <resources>
+ <!-- Insert resources here -->
+ </resources>
+
+ <dependencies>
+ <module name="javax.api"/>
+ <module name="javax.xml.stream.api"/>
+ </dependencies>
+
+</module>
Modified: stack/native/trunk/modules/resources/src/main/resources/resources/jbossws-deploy-macros.xml
===================================================================
--- stack/native/trunk/modules/resources/src/main/resources/resources/jbossws-deploy-macros.xml 2011-04-14 11:45:13 UTC (rev 14088)
+++ stack/native/trunk/modules/resources/src/main/resources/resources/jbossws-deploy-macros.xml 2011-04-14 12:29:52 UTC (rev 14089)
@@ -329,11 +329,36 @@
<include name="**/xmlsec.jar"/>
</fileset>
</copy>
+ <copy todir="@{targetdir}/com/sun/tools/ws/main" flatten="false" overwrite="true">
+ <fileset dir="@{thirdpartydir}/lib">
+ <include name="**/jaxws-tools.jar"/>
+ </fileset>
+ </copy>
+ <copy todir="@{targetdir}/com/sun/xml/stream/buffer/main" flatten="false" overwrite="true">
+ <fileset dir="@{thirdpartydir}/lib">
+ <include name="**/streambuffer.jar"/>
+ </fileset>
+ </copy>
+ <copy todir="@{targetdir}/com/sun/xml/ws/main" flatten="false" overwrite="true">
+ <fileset dir="@{thirdpartydir}/lib">
+ <include name="**/jaxws-rt.jar"/>
+ </fileset>
+ </copy>
+ <copy todir="@{targetdir}/com/sun/xml/ws/policy/main" flatten="false" overwrite="true">
+ <fileset dir="@{thirdpartydir}/lib">
+ <include name="**/policy.jar"/>
+ </fileset>
+ </copy>
<copy todir="@{targetdir}/com/sun/xml/fastinfoset/main" flatten="false" overwrite="true">
<fileset dir="@{thirdpartydir}/lib">
<include name="**/FastInfoset.jar"/>
</fileset>
</copy>
+ <copy todir="@{targetdir}/org/jvnet/staxex/main" flatten="false" overwrite="true">
+ <fileset dir="@{thirdpartydir}/lib">
+ <include name="**/stax-ex.jar"/>
+ </fileset>
+ </copy>
<copy todir="@{targetdir}/org/codehaus/jettison/main" flatten="false" overwrite="true">
<fileset dir="@{thirdpartydir}/lib">
<include name="**/jettison.jar"/>
Modified: stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/tools/scripts/ScriptTestCase.java
===================================================================
--- stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/tools/scripts/ScriptTestCase.java 2011-04-14 11:45:13 UTC (rev 14088)
+++ stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/tools/scripts/ScriptTestCase.java 2011-04-14 12:29:52 UTC (rev 14089)
@@ -47,6 +47,8 @@
public void testWSToolsFromCommandLine() throws Exception
{
+ if (!isTargetJBoss6()) return; // wstools.sh(.bat) not available since AS7
+
// use absolute path for the output to be re-usable
File dest = createResourceFile("wstools" + FS + "java");
dest.mkdirs();
Modified: stack/native/trunk/pom.xml
===================================================================
--- stack/native/trunk/pom.xml 2011-04-14 11:45:13 UTC (rev 14088)
+++ stack/native/trunk/pom.xml 2011-04-14 12:29:52 UTC (rev 14089)
@@ -527,6 +527,18 @@
</profile>
<!--
+ Name: jboss700
+ Descr: JBoss-7.0.0 specific options
+ -->
+ <profile>
+ <id>jboss700</id>
+ <properties>
+ <jbossws.integration.target>jboss700</jbossws.integration.target>
+ <jboss.home>${jboss700.home}</jboss.home>
+ </properties>
+ </profile>
+
+ <!--
Name: smoketest
Descr: Executes the smoke tests
-->
13 years
JBossWS SVN: r14088 - shared-testsuite/trunk/src/test/java/org/jboss/test/ws/jaxws/smoke/tools.
by jbossws-commits@lists.jboss.org
Author: richard.opalka(a)jboss.com
Date: 2011-04-14 07:45:13 -0400 (Thu, 14 Apr 2011)
New Revision: 14088
Modified:
shared-testsuite/trunk/src/test/java/org/jboss/test/ws/jaxws/smoke/tools/ScriptTestCase.java
shared-testsuite/trunk/src/test/java/org/jboss/test/ws/jaxws/smoke/tools/WSRunClientTestCase.java
Log:
[JBWS-3222] updating tests - wstools.sh(.bat) & wsrunclient.sh(.bat) are not available since AS7
Modified: shared-testsuite/trunk/src/test/java/org/jboss/test/ws/jaxws/smoke/tools/ScriptTestCase.java
===================================================================
--- shared-testsuite/trunk/src/test/java/org/jboss/test/ws/jaxws/smoke/tools/ScriptTestCase.java 2011-04-14 10:29:46 UTC (rev 14087)
+++ shared-testsuite/trunk/src/test/java/org/jboss/test/ws/jaxws/smoke/tools/ScriptTestCase.java 2011-04-14 11:45:13 UTC (rev 14088)
@@ -76,6 +76,9 @@
assertTrue(new File(JBOSS_HOME + FS + "bin" + FS + "wsprovide" + ".bat").exists());
assertTrue(new File(JBOSS_HOME + FS + "bin" + FS + "wsconsume" + ".sh").exists());
assertTrue(new File(JBOSS_HOME + FS + "bin" + FS + "wsconsume" + ".bat").exists());
+
+ if (!isTargetJBoss6()) return; // wsrunclient not available since AS7x
+
assertTrue(new File(JBOSS_HOME + FS + "bin" + FS + "wsrunclient" + ".sh").exists());
assertTrue(new File(JBOSS_HOME + FS + "bin" + FS + "wsrunclient" + ".bat").exists());
}
Modified: shared-testsuite/trunk/src/test/java/org/jboss/test/ws/jaxws/smoke/tools/WSRunClientTestCase.java
===================================================================
--- shared-testsuite/trunk/src/test/java/org/jboss/test/ws/jaxws/smoke/tools/WSRunClientTestCase.java 2011-04-14 10:29:46 UTC (rev 14087)
+++ shared-testsuite/trunk/src/test/java/org/jboss/test/ws/jaxws/smoke/tools/WSRunClientTestCase.java 2011-04-14 11:45:13 UTC (rev 14088)
@@ -53,6 +53,8 @@
*/
public void test() throws Exception
{
+ if (!isTargetJBoss6()) return; // wsrunclient not available since AS7x
+
StringBuilder sb = new StringBuilder();
Map<String, String> env = new HashMap<String, String>();
env.put("WSRUNCLIENT_CLASSPATH", additionalClasspath);
@@ -141,7 +143,7 @@
*/
private List<String> getContent(String resource) throws Exception
{
- File f = this.getResourceFile(resource);
+ File f = getResourceFile(resource);
assertTrue(f.exists());
List<String> retVal = new LinkedList<String>();
BufferedReader br = null;
13 years
JBossWS SVN: r14087 - stack/native/branches/jbossws-native-3.1.2/modules/testsuite.
by jbossws-commits@lists.jboss.org
Author: rsvoboda(a)redhat.com
Date: 2011-04-14 06:29:46 -0400 (Thu, 14 Apr 2011)
New Revision: 14087
Modified:
stack/native/branches/jbossws-native-3.1.2/modules/testsuite/pom.xml
Log:
JBPAPP-6308 updated hornetq.version from 2.1.2.Final to 2.2.2.Final
Modified: stack/native/branches/jbossws-native-3.1.2/modules/testsuite/pom.xml
===================================================================
--- stack/native/branches/jbossws-native-3.1.2/modules/testsuite/pom.xml 2011-04-13 09:31:57 UTC (rev 14086)
+++ stack/native/branches/jbossws-native-3.1.2/modules/testsuite/pom.xml 2011-04-14 10:29:46 UTC (rev 14087)
@@ -25,7 +25,7 @@
<hibernate.version>3.2.4.sp1</hibernate.version>
<endpoint.servlet>org.jboss.wsf.stack.jbws.EndpointServlet</endpoint.servlet>
<jboss.javaee.version>5.0.1.GA</jboss.javaee.version>
- <hornetq.version>2.1.2.Final</hornetq.version>
+ <hornetq.version>2.2.2.Final</hornetq.version>
</properties>
<!-- Modules -->
13 years
JBossWS SVN: r14086 - api/trunk/src/main/java/org/jboss/wsf/spi/tools.
by jbossws-commits@lists.jboss.org
Author: richard.opalka(a)jboss.com
Date: 2011-04-13 05:31:57 -0400 (Wed, 13 Apr 2011)
New Revision: 14086
Modified:
api/trunk/src/main/java/org/jboss/wsf/spi/tools/WSContractConsumer.java
Log:
[JBWS-3222] rollback previous commit - it's not needed anymore
Modified: api/trunk/src/main/java/org/jboss/wsf/spi/tools/WSContractConsumer.java
===================================================================
--- api/trunk/src/main/java/org/jboss/wsf/spi/tools/WSContractConsumer.java 2011-04-13 09:09:05 UTC (rev 14085)
+++ api/trunk/src/main/java/org/jboss/wsf/spi/tools/WSContractConsumer.java 2011-04-13 09:31:57 UTC (rev 14086)
@@ -52,21 +52,7 @@
*/
public static WSContractConsumer newInstance()
{
- // TODO: use SPI class loader facade, not reflection!
- ClassLoader loader;
- try {
- Class<?> moduleClass = Class.forName("org.jboss.modules.Module");
- Class<?> moduleIdentifierClass = Class.forName("org.jboss.modules.ModuleIdentifier");
- Class<?> moduleLoaderClass = Class.forName("org.jboss.modules.ModuleLoader");
- Object moduleLoader = moduleClass.getMethod("getBootModuleLoader").invoke(null);
- Object moduleIdentifier = moduleIdentifierClass.getMethod("create", String.class).invoke(null, "org.jboss.as.webservices.server.integration");
- Object module = moduleLoaderClass.getMethod("loadModule", moduleIdentifierClass).invoke(moduleLoader, moduleIdentifier);
- loader = (ClassLoader)moduleClass.getMethod("getClassLoader").invoke(module);
- } catch (Exception e) {
- //ignore, JBoss Modules might not be available at all
- loader = Thread.currentThread().getContextClassLoader();
- }
- return newInstance(loader);
+ return newInstance(SecurityActions.getContextClassLoader());
}
/**
13 years