) f::exists);
- }
-}
diff --git a/specs/javaxml/src/main/java/javax/xml/xpath/XPathFactory.java b/specs/javaxml/src/main/java/javax/xml/xpath/XPathFactory.java
deleted file mode 100644
index c236a7c0ad1..00000000000
--- a/specs/javaxml/src/main/java/javax/xml/xpath/XPathFactory.java
+++ /dev/null
@@ -1,120 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package javax.xml.xpath;
-
-public abstract class XPathFactory {
-
- public static final String DEFAULT_PROPERTY_NAME = "javax.xml.xpath.XPathFactory";
-
- public static final String DEFAULT_OBJECT_MODEL_URI = "http://java.sun.com/jaxp/xpath/dom";
-
- private static final String DEFAULT_IMPL = "com.sun.org.apache.xpath.internal.jaxp.XPathFactoryImpl";
-
- protected XPathFactory() {
- }
-
- public static XPathFactory newDefaultInstance() {
- try {
- return new $XPathFactoryFinder(null).createInstance(DEFAULT_IMPL, true);
- } catch (XPathFactoryConfigurationException e) {
- throw new RuntimeException(
- "XPathFactory#newInstance() failed to create an XPathFactory for the default object model: "
- + DEFAULT_OBJECT_MODEL_URI
- + " with the XPathFactoryConfigurationException: "
- + e.getMessage(), e
- );
- }
- }
-
- public static XPathFactory newInstance() {
- try {
- return newInstance(DEFAULT_OBJECT_MODEL_URI);
- } catch (XPathFactoryConfigurationException e) {
- throw new RuntimeException(
- "XPathFactory#newInstance() failed to create an XPathFactory for the default object model: "
- + DEFAULT_OBJECT_MODEL_URI
- + " with the XPathFactoryConfigurationException: "
- + e.getMessage(), e
- );
- }
- }
-
- public static XPathFactory newInstance(final String uri) throws XPathFactoryConfigurationException {
- if (uri == null) {
- throw new NullPointerException(
- "XPathFactory#newInstance(String uri) cannot be called with uri == null");
- }
- if (uri.length() == 0) {
- throw new IllegalArgumentException(
- "XPathFactory#newInstance(String uri) cannot be called with uri == \"\"");
- }
- ClassLoader classLoader = $XPathFactoryFinder.getContextClassLoader();
- if (classLoader == null) {
- classLoader = XPathFactory.class.getClassLoader();
- }
- XPathFactory xpathFactory = new $XPathFactoryFinder(classLoader).newFactory(uri);
- if (xpathFactory == null) {
- throw new XPathFactoryConfigurationException(
- "No XPathFactory implementation found for the object model: "
- + uri);
- }
- return xpathFactory;
- }
-
- public static XPathFactory newInstance(String uri, String factoryClassName, ClassLoader classLoader) throws XPathFactoryConfigurationException {
- ClassLoader cl = classLoader;
- if (uri == null) {
- throw new NullPointerException("XPathFactory#newInstance(String uri) cannot be called with uri == null");
- }
- if (uri.length() == 0) {
- throw new IllegalArgumentException("XPathFactory#newInstance(String uri) cannot be called with uri == \"\"");
- }
- if (cl == null) {
- cl = $XPathFactoryFinder.getContextClassLoader();
- }
- XPathFactory f = new $XPathFactoryFinder(cl).createInstance(factoryClassName);
-
- if (f == null) {
- throw new XPathFactoryConfigurationException(
- "No XPathFactory implementation found for the object model: "
- + uri);
- }
- if (f.isObjectModelSupported(uri)) {
- return f;
- } else {
- throw new XPathFactoryConfigurationException("Factory "
- + factoryClassName + " doesn't support given " + uri
- + " object model");
- }
-
- }
-
- public abstract boolean isObjectModelSupported(String objectModel);
-
- public abstract void setFeature(String name, boolean value)
- throws XPathFactoryConfigurationException;
-
- public abstract boolean getFeature(String name)
- throws XPathFactoryConfigurationException;
-
- public abstract void setXPathVariableResolver(XPathVariableResolver resolver);
-
- public abstract void setXPathFunctionResolver(XPathFunctionResolver resolver);
-
- public abstract XPath newXPath();
-
-}
diff --git a/specs/javaxml/src/main/java/org/w3c/dom/ElementTraversal.java b/specs/javaxml/src/main/java/org/w3c/dom/ElementTraversal.java
deleted file mode 100644
index 16406b532d5..00000000000
--- a/specs/javaxml/src/main/java/org/w3c/dom/ElementTraversal.java
+++ /dev/null
@@ -1,64 +0,0 @@
-/*
- * Copyright (c) 2009 World Wide Web Consortium,
- *
- * (Massachusetts Institute of Technology, European Research Consortium for
- * Informatics and Mathematics, Keio University). All Rights Reserved. This
- * work is distributed under the W3C(r) Software License [1] 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.
- *
- * [1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231
- */
-
-package org.w3c.dom;
-
-/**
- * The ElementTraversal interface is a set of read-only attributes
- * which allow an author to easily navigate between elements in a document.
- * In conforming implementations of Element Traversal, all objects that
- * implement {@link Element} must also implement the
- * ElementTraversal interface. Four of the methods,
- * {@link #getFirstElementChild}, {@link #getLastElementChild},
- * {@link #getPreviousElementSibling}, and {@link #getNextElementSibling},
- * each return a live reference to another element with the defined
- * relationship to the current element, if the related element exists. The
- * fifth method, {@link #getChildElementCount}, exposes the number of child
- * elements of an element, for preprocessing before navigation.
- *
See also the
- * Element Traversal Specification.
- */
-public interface ElementTraversal {
-
- /**
- * Returns the first child element node of this element. null
- * if this element has no child elements.
- */
- Element getFirstElementChild();
-
- /**
- * Returns the last child element node of this element. null
- * if this element has no child elements.
- */
- Element getLastElementChild();
-
- /**
- * Returns the previous sibling element node of this element.
- * null if this element has no element sibling nodes that
- * come before this one in the document tree.
- */
- Element getPreviousElementSibling();
-
- /**
- * Returns the next sibling element node of this element.
- * null if this element has no element sibling nodes that
- * come after this one in the document tree.
- */
- Element getNextElementSibling();
-
- /**
- * Returns the current number of element nodes that are children of this
- * element. 0 if this element has no child nodes that are of
- * nodeType 1.
- */
- int getChildElementCount();
-}
diff --git a/specs/javaxmlws/pom.xml b/specs/javaxmlws/pom.xml
deleted file mode 100644
index 47f5b455cba..00000000000
--- a/specs/javaxmlws/pom.xml
+++ /dev/null
@@ -1,84 +0,0 @@
-
-
-
-
-
- 4.0.0
-
-
- org.apache.karaf.specs
- specs
- 4.5.0-SNAPSHOT
-
-
- org.apache.karaf.specs.java.xml.ws
- Apache Karaf :: Specs :: Java Xml WS
-
-
- 8
-
-
-
-
-
- org.apache.karaf
- karaf-bom
- ${project.version}
- pom
- import
-
-
-
-
-
-
- org.apache.geronimo.specs
- geronimo-saaj_1.3_spec
- 1.1
-
-
- org.apache.geronimo.specs
- geronimo-jaxws_2.2_spec
- 1.2
-
-
- org.apache.geronimo.specs
- geronimo-saaj_1.3_spec
-
-
- org.apache.geronimo.specs
- geronimo-stax_1.0_spec
-
-
- org.apache.geronimo.specs
- geronimo-activation_1.1_spec
-
-
- javax.xml.bind
- jaxb-api
-
-
-
-
- org.apache.karaf.specs
- org.apache.karaf.specs.locator
-
-
-
-
diff --git a/specs/javaxmlws/src/main/java/javax/xml/soap/$FactoryFinder.java b/specs/javaxmlws/src/main/java/javax/xml/soap/$FactoryFinder.java
deleted file mode 100644
index 65938dd9f79..00000000000
--- a/specs/javaxmlws/src/main/java/javax/xml/soap/$FactoryFinder.java
+++ /dev/null
@@ -1,256 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package javax.xml.soap;
-
-import java.io.BufferedReader;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.InputStreamReader;
-import java.nio.charset.StandardCharsets;
-import java.nio.file.Files;
-import java.nio.file.Path;
-import java.nio.file.Paths;
-import java.security.AccessController;
-import java.security.PrivilegedAction;
-import java.util.Properties;
-import java.util.ServiceLoader;
-import java.util.logging.Level;
-import java.util.logging.Logger;
-
-
-class $FactoryFinder {
-
- private static final Logger LOGGER = Logger.getLogger("javax.xml.soap");
-
- @SuppressWarnings("unchecked")
- static T find(Class factoryClass, String defaultClassName, boolean tryFallback, String deprecatedFactoryId) throws SOAPException {
- ClassLoader tccl = contextClassLoader();
-
- String factoryId = factoryClass.getName();
- String className = fromSystemProperty(factoryId, deprecatedFactoryId);
- if (className != null) {
- Object result = newInstance(className, defaultClassName, tccl);
- return (T) result;
- }
-
- className = fromJDKProperties(factoryId, deprecatedFactoryId);
- if (className != null) {
- Object result = newInstance(className, defaultClassName, tccl);
- return (T) result;
- }
-
- try {
- Class spiClass = org.apache.karaf.specs.locator.OsgiLocator.locate(factoryClass);
- if (spiClass != null) {
- return spiClass.getConstructor().newInstance();
- }
- } catch (Throwable t) {
- }
-
- T factory = firstByServiceLoader(factoryClass);
- if (factory != null) {
- return factory;
- }
-
- className = fromMetaInfServices(deprecatedFactoryId, tccl);
- if (className != null) {
- LOGGER.log(Level.WARNING,
- "Using deprecated META-INF/services mechanism with non-standard property: {0}. " +
- "Property {1} should be used instead.",
- new Object[]{deprecatedFactoryId, factoryId});
- Object result = newInstance(className, defaultClassName, tccl);
- return (T) result;
- }
-
- if (!tryFallback)
- return null;
-
- if (defaultClassName == null) {
- throw new SOAPException("Provider for " + factoryId + " cannot be found", null);
- }
- return (T) newInstance(defaultClassName, defaultClassName, tccl);
- }
-
- static T find(Class factoryClass, String defaultClassName, boolean tryFallback) throws SOAPException {
- return find(factoryClass, defaultClassName, tryFallback, null);
- }
-
- private static String fromMetaInfServices(String deprecatedFactoryId, ClassLoader tccl) {
- String serviceId = "META-INF/services/" + deprecatedFactoryId;
- LOGGER.log(Level.FINE, "Checking deprecated {0} resource", serviceId);
-
- try (InputStream is =
- tccl == null
- ? ClassLoader.getSystemResourceAsStream(serviceId)
- : tccl.getResourceAsStream(serviceId)) {
-
- if (is != null) {
- String factoryClassName;
- try (InputStreamReader isr = new InputStreamReader(is, StandardCharsets.UTF_8);
- BufferedReader rd = new BufferedReader(isr)) {
- factoryClassName = rd.readLine();
- }
-
- logFound(factoryClassName);
- if (factoryClassName != null && !"".equals(factoryClassName)) {
- return factoryClassName;
- }
- }
- } catch (IOException e) {
- }
- return null;
- }
-
- private static String fromJDKProperties(String factoryId, String deprecatedFactoryId) {
- Path path = null;
- try {
- String JAVA_HOME = getSystemProperty("java.home");
- path = Paths.get(JAVA_HOME, "conf", "jaxm.properties");
- LOGGER.log(Level.FINE, "Checking configuration in {0}", path);
-
- if (!Files.exists(path)) {
- path = Paths.get(JAVA_HOME, "lib", "jaxm.properties");
- }
-
- LOGGER.log(Level.FINE, "Checking configuration in {0}", path);
- if (Files.exists(path)) {
- Properties props = new Properties();
- try (InputStream inputStream = Files.newInputStream(path)) {
- props.load(inputStream);
- }
-
- LOGGER.log(Level.FINE, "Checking property {0}", factoryId);
- String factoryClassName = props.getProperty(factoryId);
- logFound(factoryClassName);
- if (factoryClassName != null) {
- return factoryClassName;
- }
-
- if (deprecatedFactoryId != null) {
- LOGGER.log(Level.FINE, "Checking deprecated property {0}", deprecatedFactoryId);
- factoryClassName = props.getProperty(deprecatedFactoryId);
- logFound(factoryClassName);
- if (factoryClassName != null) {
- LOGGER.log(Level.WARNING,
- "Using non-standard property: {0}. Property {1} should be used instead.",
- new Object[]{deprecatedFactoryId, factoryId});
- return factoryClassName;
- }
- }
- }
- } catch (Exception ignored) {
- LOGGER.log(Level.SEVERE, "Error reading SAAJ configuration from [" + path +
- "] file. Check it is accessible and has correct format.", ignored);
- }
- return null;
- }
-
- private static String fromSystemProperty(String factoryId, String deprecatedFactoryId) {
- String systemProp = getSystemProperty(factoryId);
- if (systemProp != null) {
- return systemProp;
- }
- if (deprecatedFactoryId != null) {
- systemProp = getSystemProperty(deprecatedFactoryId);
- if (systemProp != null) {
- LOGGER.log(Level.WARNING,
- "Using non-standard property: {0}. Property {1} should be used instead.",
- new Object[] {deprecatedFactoryId, factoryId});
- return systemProp;
- }
- }
- return null;
- }
-
- private static String getSystemProperty(final String property) {
- LOGGER.log(Level.FINE, "Checking system property {0}", property);
- String value = AccessController.doPrivileged((PrivilegedAction) () -> System.getProperty(property));
- logFound(value);
- return value;
- }
-
- private static void logFound(String value) {
- if (value != null) {
- LOGGER.log(Level.FINE, " found {0}", value);
- } else {
- LOGGER.log(Level.FINE, " not found");
- }
- }
-
- private static T firstByServiceLoader(Class spiClass) throws SOAPException {
- LOGGER.log(Level.FINE, "Using java.util.ServiceLoader to find {0}", spiClass.getName());
- try {
- ServiceLoader serviceLoader = ServiceLoader.load(spiClass);
- for (T impl : serviceLoader) {
- LOGGER.fine("ServiceProvider loading Facility used; returning object [" + impl.getClass().getName() + "]");
- return impl;
- }
- } catch (Throwable t) {
- throw new SOAPException("Error while searching for service [" + spiClass.getName() + "]", t);
- }
- return null;
- }
-
- private static void checkPackageAccess(String className) {
- SecurityManager s = System.getSecurityManager();
- if (s != null) {
- int i = className.lastIndexOf('.');
- if (i != -1) {
- s.checkPackageAccess(className.substring(0, i));
- }
- }
- }
-
- private static Class nullSafeLoadClass(String className, ClassLoader classLoader) throws ClassNotFoundException {
- if (classLoader == null) {
- return Class.forName(className);
- } else {
- return classLoader.loadClass(className);
- }
- }
-
- static Object newInstance(String className, String defaultImplClassName, ClassLoader classLoader) throws SOAPException {
- try {
- return safeLoadClass(className, defaultImplClassName, classLoader).getConstructor().newInstance();
- } catch (ClassNotFoundException x) {
- throw new SOAPException("Provider " + className + " not found", x);
- } catch (Exception x) {
- throw new SOAPException("Provider " + className + " could not be instantiated: " + x, x);
- }
- }
-
- private static Class> safeLoadClass(String className, String defaultImplClassName, ClassLoader classLoader) throws ClassNotFoundException {
- try {
- checkPackageAccess(className);
- } catch (SecurityException se) {
- if (defaultImplClassName != null && defaultImplClassName.equals(className)) {
- return Class.forName(className);
- }
- throw se;
- }
- return nullSafeLoadClass(className, classLoader);
- }
-
- private static ClassLoader contextClassLoader() throws SOAPException {
- try {
- return Thread.currentThread().getContextClassLoader();
- } catch (Exception x) {
- throw new SOAPException(x.toString(), x);
- }
- }
-
-}
diff --git a/specs/javaxmlws/src/main/java/javax/xml/soap/MessageFactory.java b/specs/javaxmlws/src/main/java/javax/xml/soap/MessageFactory.java
deleted file mode 100644
index 6f0686a68b4..00000000000
--- a/specs/javaxmlws/src/main/java/javax/xml/soap/MessageFactory.java
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package javax.xml.soap;
-
-import java.io.IOException;
-import java.io.InputStream;
-
-public abstract class MessageFactory {
-
- private static final String DEFAULT_MESSAGE_FACTORY = "com.sun.xml.internal.messaging.saaj.soap.ver1_1.SOAPMessageFactory1_1Impl";
-
- public static MessageFactory newInstance() throws SOAPException {
- try {
- MessageFactory factory = $FactoryFinder.find(MessageFactory.class, DEFAULT_MESSAGE_FACTORY, false);
- if (factory != null) {
- return factory;
- }
- return newInstance(SOAPConstants.SOAP_1_1_PROTOCOL);
- } catch (Exception ex) {
- throw new SOAPException("Unable to create message factory for SOAP: " + ex.getMessage(), ex);
- }
-
- }
-
- public static MessageFactory newInstance(String protocol) throws SOAPException {
- return SAAJMetaFactory.getInstance().newMessageFactory(protocol);
- }
-
- public abstract SOAPMessage createMessage() throws SOAPException;
-
- public abstract SOAPMessage createMessage(MimeHeaders headers, InputStream in) throws IOException, SOAPException;
-}
diff --git a/specs/javaxmlws/src/main/java/javax/xml/soap/SAAJMetaFactory.java b/specs/javaxmlws/src/main/java/javax/xml/soap/SAAJMetaFactory.java
deleted file mode 100644
index cf83c554a16..00000000000
--- a/specs/javaxmlws/src/main/java/javax/xml/soap/SAAJMetaFactory.java
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package javax.xml.soap;
-
-public abstract class SAAJMetaFactory {
-
- private static final String META_FACTORY_DEPRECATED_CLASS_PROPERTY = "javax.xml.soap.MetaFactory";
-
- private static final String DEFAULT_META_FACTORY_CLASS = "com.sun.xml.internal.messaging.saaj.soap.SAAJMetaFactoryImpl";
-
- static SAAJMetaFactory getInstance() throws SOAPException {
- try {
- return $FactoryFinder.find(SAAJMetaFactory.class, DEFAULT_META_FACTORY_CLASS, true, META_FACTORY_DEPRECATED_CLASS_PROPERTY);
- } catch (Exception e) {
- throw new SOAPException("Unable to create SAAJ meta-factory: " + e.getMessage(), e);
- }
- }
-
- protected SAAJMetaFactory() { }
-
- protected abstract MessageFactory newMessageFactory(String protocol) throws SOAPException;
-
- protected abstract SOAPFactory newSOAPFactory(String protocol) throws SOAPException;
-}
diff --git a/specs/javaxmlws/src/main/java/javax/xml/soap/SOAPConnectionFactory.java b/specs/javaxmlws/src/main/java/javax/xml/soap/SOAPConnectionFactory.java
deleted file mode 100644
index 9466f2d99ce..00000000000
--- a/specs/javaxmlws/src/main/java/javax/xml/soap/SOAPConnectionFactory.java
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package javax.xml.soap;
-
-public abstract class SOAPConnectionFactory {
-
- private static final String DEFAULT_SOAP_CONNECTION_FACTORY = "com.sun.xml.internal.messaging.saaj.client.p2p.HttpSOAPConnectionFactory";
-
- public static SOAPConnectionFactory newInstance() throws SOAPException, UnsupportedOperationException {
- try {
- return $FactoryFinder.find(SOAPConnectionFactory.class, DEFAULT_SOAP_CONNECTION_FACTORY, true);
- } catch (Exception ex) {
- throw new SOAPException("Unable to create SOAP connection factory: " + ex.getMessage(), ex);
- }
- }
-
- public abstract SOAPConnection createConnection() throws SOAPException;
-
-}
diff --git a/specs/javaxmlws/src/main/java/javax/xml/soap/SOAPFactory.java b/specs/javaxmlws/src/main/java/javax/xml/soap/SOAPFactory.java
deleted file mode 100644
index eebdcc5f8ce..00000000000
--- a/specs/javaxmlws/src/main/java/javax/xml/soap/SOAPFactory.java
+++ /dev/null
@@ -1,68 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package javax.xml.soap;
-
-import org.w3c.dom.Element;
-
-import javax.xml.namespace.QName;
-
-public abstract class SOAPFactory {
-
- private static final String DEFAULT_SOAP_FACTORY = "com.sun.xml.internal.messaging.saaj.soap.ver1_1.SOAPFactory1_1Impl";
-
- public SOAPElement createElement(Element domElement) throws SOAPException {
- throw new UnsupportedOperationException("createElement(org.w3c.dom.Element) must be overridden by all subclasses of SOAPFactory.");
- }
-
- public abstract SOAPElement createElement(Name name) throws SOAPException;
-
- public SOAPElement createElement(QName qname) throws SOAPException {
- throw new UnsupportedOperationException("createElement(QName) must be overridden by all subclasses of SOAPFactory.");
- }
-
- public abstract SOAPElement createElement(String localName) throws SOAPException;
-
-
- public abstract SOAPElement createElement(String localName, String prefix, String uri) throws SOAPException;
-
- public abstract Detail createDetail() throws SOAPException;
-
- public abstract SOAPFault createFault(String reasonText, QName faultCode) throws SOAPException;
-
- public abstract SOAPFault createFault() throws SOAPException;
-
- public abstract Name createName(String localName, String prefix, String uri) throws SOAPException;
-
- public abstract Name createName(String localName) throws SOAPException;
-
- public static SOAPFactory newInstance() throws SOAPException {
- try {
- SOAPFactory factory = $FactoryFinder.find(SOAPFactory.class, DEFAULT_SOAP_FACTORY, false);
- if (factory != null) {
- return factory;
- }
- return newInstance(SOAPConstants.SOAP_1_1_PROTOCOL);
- } catch (Exception ex) {
- throw new SOAPException("Unable to create SOAP Factory: " + ex.getMessage(), ex);
- }
-
- }
-
- public static SOAPFactory newInstance(String protocol) throws SOAPException {
- return SAAJMetaFactory.getInstance().newSOAPFactory(protocol);
- }
-}
diff --git a/specs/javaxmlws/src/main/java/javax/xml/ws/spi/$FactoryFinder.java b/specs/javaxmlws/src/main/java/javax/xml/ws/spi/$FactoryFinder.java
deleted file mode 100644
index 12bce644faf..00000000000
--- a/specs/javaxmlws/src/main/java/javax/xml/ws/spi/$FactoryFinder.java
+++ /dev/null
@@ -1,165 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package javax.xml.ws.spi;
-
-import javax.xml.ws.WebServiceException;
-import java.io.InputStream;
-import java.nio.file.Files;
-import java.nio.file.Path;
-import java.nio.file.Paths;
-import java.util.Properties;
-import java.util.ServiceLoader;
-import java.util.logging.Level;
-import java.util.logging.Logger;
-
-class $FactoryFinder {
-
- private static final Logger LOGGER = Logger.getLogger("javax.xml.ws");
-
- @SuppressWarnings("unchecked")
- static T find(Class factoryClass, String fallbackClassName) {
- ClassLoader classLoader = contextClassLoader();
-
- T provider = firstByServiceLoader(factoryClass);
- if (provider != null) {
- return provider;
- }
-
- String factoryId = factoryClass.getName();
-
- provider = (T) fromJDKProperties(factoryId, fallbackClassName, classLoader);
- if (provider != null) {
- return provider;
- }
-
- provider = (T) fromSystemProperty(factoryId, fallbackClassName, classLoader);
- if (provider != null) {
- return provider;
- }
-
- try {
- Class spiClass = org.apache.karaf.specs.locator.OsgiLocator.locate(factoryClass);
- if (spiClass != null) {
- return spiClass.getConstructor().newInstance();
- }
- } catch (Throwable t) {
- }
-
- if (fallbackClassName == null) {
- throw new WebServiceException("Provider for " + factoryId + " cannot be found", null);
- }
-
- return (T) newInstance(fallbackClassName, fallbackClassName, classLoader);
- }
-
- private static Object fromSystemProperty(String factoryId, String fallbackClassName, ClassLoader classLoader) {
- try {
- String systemProp = System.getProperty(factoryId);
- if (systemProp != null) {
- return newInstance(systemProp, fallbackClassName, classLoader);
- }
- } catch (SecurityException ignored) {
- }
- return null;
- }
-
- private static Object fromJDKProperties(String factoryId, String fallbackClassName, ClassLoader classLoader) {
- Path path = null;
- try {
- String JAVA_HOME = System.getProperty("java.home");
- path = Paths.get(JAVA_HOME, "conf", "jaxws.properties");
- if (!Files.exists(path)) {
- path = Paths.get(JAVA_HOME, "lib", "jaxws.properties");
- }
- if (Files.exists(path)) {
- Properties props = new Properties();
- try (InputStream inStream = Files.newInputStream(path)) {
- props.load(inStream);
- }
- String factoryClassName = props.getProperty(factoryId);
- return newInstance(factoryClassName, fallbackClassName, classLoader);
- }
- } catch (Exception ignored) {
- LOGGER.log(Level.SEVERE, "Error reading JAX-WS configuration from [" + path +
- "] file. Check it is accessible and has correct format.", ignored);
- }
- return null;
- }
-
- private static T firstByServiceLoader(Class spiClass) throws WebServiceException {
- LOGGER.log(Level.FINE, "Using java.util.ServiceLoader to find {0}", spiClass.getName());
- try {
- ServiceLoader serviceLoader = ServiceLoader.load(spiClass);
- for (T impl : serviceLoader) {
- LOGGER.fine("ServiceProvider loading Facility used; returning object [" + impl.getClass().getName() + "]");
- return impl;
- }
- } catch (Throwable t) {
- throw new WebServiceException("Error while searching for service [" + spiClass.getName() + "]", t);
- }
- return null;
- }
-
- private static void checkPackageAccess(String className) {
- SecurityManager s = System.getSecurityManager();
- if (s != null) {
- int i = className.lastIndexOf('.');
- if (i != -1) {
- s.checkPackageAccess(className.substring(0, i));
- }
- }
- }
-
- private static Class nullSafeLoadClass(String className, ClassLoader classLoader) throws ClassNotFoundException {
- if (classLoader == null) {
- return Class.forName(className);
- } else {
- return classLoader.loadClass(className);
- }
- }
-
- private static Object newInstance(String className, String defaultImplClassName, ClassLoader classLoader) throws WebServiceException {
- try {
- return safeLoadClass(className, defaultImplClassName, classLoader).getConstructor().newInstance();
- } catch (ClassNotFoundException x) {
- throw new WebServiceException("Provider " + className + " not found", x);
- } catch (Exception x) {
- throw new WebServiceException("Provider " + className + " could not be instantiated: " + x, x);
- }
- }
-
- private static Class> safeLoadClass(String className, String defaultImplClassName, ClassLoader classLoader) throws ClassNotFoundException {
- try {
- checkPackageAccess(className);
- } catch (SecurityException se) {
- if (defaultImplClassName != null && defaultImplClassName.equals(className)) {
- return Class.forName(className);
- }
- throw se;
- }
- return nullSafeLoadClass(className, classLoader);
- }
-
- private static ClassLoader contextClassLoader() throws WebServiceException {
- try {
- return Thread.currentThread().getContextClassLoader();
- } catch (Exception x) {
- throw new WebServiceException(x.toString(), x);
- }
- }
-
-}
diff --git a/specs/javaxmlws/src/main/java/javax/xml/ws/spi/Provider.java b/specs/javaxmlws/src/main/java/javax/xml/ws/spi/Provider.java
deleted file mode 100644
index 9eca1402a94..00000000000
--- a/specs/javaxmlws/src/main/java/javax/xml/ws/spi/Provider.java
+++ /dev/null
@@ -1,89 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package javax.xml.ws.spi;
-
-import org.w3c.dom.Element;
-
-import javax.xml.namespace.QName;
-import javax.xml.transform.Source;
-import javax.xml.ws.*;
-import javax.xml.ws.wsaddressing.W3CEndpointReference;
-import java.net.URL;
-import java.util.List;
-import java.util.Map;
-
-public abstract class Provider {
-
- private static final String DEFAULT_JAXWSPROVIDER = "com.sun.xml.internal.ws.spi.ProviderImpl";
-
- protected Provider() {
- }
-
- public static Provider provider() {
- try {
- return $FactoryFinder.find(Provider.class, DEFAULT_JAXWSPROVIDER);
- } catch (WebServiceException ex) {
- throw ex;
- } catch (Exception ex) {
- throw new WebServiceException("Unable to createEndpointReference Provider", ex);
- }
- }
-
- public abstract ServiceDelegate createServiceDelegate(URL wsdlDocumentLocation, QName serviceName,
- Class extends Service> serviceClass);
-
- public ServiceDelegate createServiceDelegate(URL wsdlDocumentLocation, QName serviceName,
- Class extends Service> serviceClass, WebServiceFeature... features) {
- throw new UnsupportedOperationException("JAX-WS 2.2 implementation must override this default behaviour.");
- }
-
- public abstract Endpoint createEndpoint(String bindingId, Object implementor);
-
- public abstract Endpoint createAndPublishEndpoint(String address, Object implementor);
-
- public abstract EndpointReference readEndpointReference(Source eprInfoset);
-
- public abstract T getPort(EndpointReference endpointReference, Class serviceEndpointInterface,
- WebServiceFeature... features);
-
- public abstract W3CEndpointReference createW3CEndpointReference(String address, QName serviceName,
- QName portName, List metadata,
- String wsdlDocumentLocation,
- List referenceParameters);
-
- public W3CEndpointReference createW3CEndpointReference(String address,
- QName interfaceName, QName serviceName, QName portName,
- List metadata, String wsdlDocumentLocation,
- List referenceParameters,
- List elements, Map attributes) {
- throw new UnsupportedOperationException("JAX-WS 2.2 implementation must override this default behaviour.");
- }
-
- public Endpoint createAndPublishEndpoint(String address, Object implementor, WebServiceFeature... features) {
- throw new UnsupportedOperationException("JAX-WS 2.2 implementation must override this default behaviour.");
- }
-
- public Endpoint createEndpoint(String bindingId, Object implementor, WebServiceFeature... features) {
- throw new UnsupportedOperationException("JAX-WS 2.2 implementation must override this default behaviour.");
- }
-
- public Endpoint createEndpoint(String bindingId, Class> implementorClass,
- Invoker invoker, WebServiceFeature... features) {
- throw new UnsupportedOperationException("JAX-WS 2.2 implementation must override this default behaviour.");
- }
-
-}
diff --git a/specs/locator/pom.xml b/specs/locator/pom.xml
deleted file mode 100644
index 6722210a186..00000000000
--- a/specs/locator/pom.xml
+++ /dev/null
@@ -1,37 +0,0 @@
-
-
-
-
-
- 4.0.0
-
-
- org.apache.karaf.specs
- specs
- 4.5.0-SNAPSHOT
-
-
- org.apache.karaf.specs.locator
- Apache Karaf :: Specs :: Locator
-
-
- 8
-
-
-
diff --git a/specs/locator/src/main/java/org/apache/karaf/specs/locator/OsgiLocator.java b/specs/locator/src/main/java/org/apache/karaf/specs/locator/OsgiLocator.java
deleted file mode 100644
index cbc2b7c02de..00000000000
--- a/specs/locator/src/main/java/org/apache/karaf/specs/locator/OsgiLocator.java
+++ /dev/null
@@ -1,161 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.karaf.specs.locator;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.concurrent.Callable;
-import java.util.concurrent.locks.ReadWriteLock;
-import java.util.concurrent.locks.ReentrantReadWriteLock;
-
-public class OsgiLocator {
-
- public static final long DEFAULT_TIMEOUT = 0L;
- public static final String TIMEOUT = "org.apache.karaf.specs.timeout";
-
- private static final Map>> FACTORIES = new HashMap<>();
-
- private static final ReadWriteLock LOCK = new ReentrantReadWriteLock();
-
- private OsgiLocator() {
- }
-
- public static void unregister(String id, Callable factory) {
- LOCK.writeLock().lock();
- try {
- List> l = FACTORIES.get(id);
- if (l != null) {
- l.remove(factory);
- }
- } finally {
- LOCK.writeLock().unlock();
- }
- }
-
- public static void register(String id, Callable factory) {
- LOCK.writeLock().lock();
- try {
- FACTORIES.computeIfAbsent(id, k -> new ArrayList<>())
- .add(0, factory);
- synchronized (LOCK) {
- LOCK.notifyAll();
- }
- } finally {
- LOCK.writeLock().unlock();
- }
- }
-
-
- public static Class locate(Class factoryId) {
- return locate(factoryId, factoryId.getName());
- }
-
- private static long getTimeout() {
- long timeout = DEFAULT_TIMEOUT;
- try {
- String prop = System.getProperty(TIMEOUT);
- if (prop != null) {
- timeout = Long.parseLong(prop);
- }
- } catch (Throwable t) { }
- return timeout;
- }
-
- public static Class locate(Class factoryClass, String factoryId) {
- long timeout = getTimeout();
- if (timeout <= 0) {
- return doLocate(factoryClass, factoryId);
- }
- long t0 = System.currentTimeMillis();
- long t1 = t0;
- while (t1 - t0 < timeout) {
- Class impl = doLocate(factoryClass, factoryId);
- if (impl != null) {
- return impl;
- }
- synchronized (LOCK) {
- try {
- LOCK.wait(timeout - (t1 - t0));
- } catch (InterruptedException e) {
- return null;
- }
- }
- t1 = System.currentTimeMillis();
- }
- return null;
- }
-
- private static Class doLocate(Class factoryClass, String factoryId) {
- LOCK.readLock().lock();
- try {
- List> l = FACTORIES.get(factoryId);
- if (l != null && !l.isEmpty()) {
- // look up the System property first
- String factoryClassName = System.getProperty(factoryId);
- try {
- for (Callable i : l) {
- Class c = null;
- try {
- c = i.call();
- } catch (Exception ex) {
- // do nothing here
- }
- if (c != null && factoryClass == c.getClassLoader().loadClass(factoryClass.getName())
- && (factoryClassName == null || c.getName().equals(factoryClassName)))
- {
- return c;
- }
- }
- } catch (Exception ex) {
- // do nothing here
- }
- }
- return null;
- } finally {
- LOCK.readLock().unlock();
- }
- }
-
- public static List> locateAll(Class factoryId) {
- return locateAll(factoryId, factoryId.getName());
- }
-
- public static List> locateAll(Class factoryClass, String factoryId) {
- LOCK.readLock().lock();
- try {
- List> classes = new ArrayList<>();
- List> l = FACTORIES.get(factoryId);
- if (l != null) {
- for (Callable i : l) {
- try {
- Class c = i.call();
- if (c != null && factoryClass.isAssignableFrom(c)) {
- classes.add(c);
- }
- } catch (Exception e) {
- }
- }
- }
- return classes;
- } finally {
- LOCK.readLock().unlock();
- }
- }
-
-}
diff --git a/specs/locator/src/test/java/org/apache/karaf/specs/locator/MockCallable.java b/specs/locator/src/test/java/org/apache/karaf/specs/locator/MockCallable.java
deleted file mode 100644
index 092d5bdd002..00000000000
--- a/specs/locator/src/test/java/org/apache/karaf/specs/locator/MockCallable.java
+++ /dev/null
@@ -1,27 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.karaf.specs.locator;
-
-import java.util.concurrent.Callable;
-
-public class MockCallable implements Callable {
-
- public Class call() throws Exception {
- return this.getClass();
- }
-
-}
diff --git a/specs/locator/src/test/java/org/apache/karaf/specs/locator/MockCallable2.java b/specs/locator/src/test/java/org/apache/karaf/specs/locator/MockCallable2.java
deleted file mode 100644
index 7fba2f4ad2c..00000000000
--- a/specs/locator/src/test/java/org/apache/karaf/specs/locator/MockCallable2.java
+++ /dev/null
@@ -1,27 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.karaf.specs.locator;
-
-import java.util.concurrent.Callable;
-
-public class MockCallable2 implements Callable {
-
- public Class call() throws Exception {
- return this.getClass();
- }
-
-}
diff --git a/specs/locator/src/test/java/org/apache/karaf/specs/locator/OsgiLocatorTest.java b/specs/locator/src/test/java/org/apache/karaf/specs/locator/OsgiLocatorTest.java
deleted file mode 100644
index 7fc9dbdf77e..00000000000
--- a/specs/locator/src/test/java/org/apache/karaf/specs/locator/OsgiLocatorTest.java
+++ /dev/null
@@ -1,83 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.karaf.specs.locator;
-
-import org.junit.Assert;
-import org.junit.BeforeClass;
-import org.junit.Test;
-
-public class OsgiLocatorTest extends Assert {
-
- @BeforeClass
- public static void setup() {
- OsgiLocator.register("Factory", new MockCallable());
- OsgiLocator.register("Factory", new MockCallable2());
- }
-
- @Test
- public void testLocatorWithSystemProperty() {
- System.setProperty(OsgiLocator.TIMEOUT, "0");
- System.setProperty("Factory", "org.apache.karaf.specs.locator.MockCallable");
- Class clazz = OsgiLocator.locate(Object.class, "Factory");
- assertNotNull("Expected to find a class", clazz);
- assertEquals("Got the wrong class", MockCallable.class.getName(), clazz.getName());
-
- System.setProperty("Factory", "org.apache.karaf.specs.locator");
- clazz = OsgiLocator.locate(Object.class, "Factory");
- assertNull("Did not expect to find a class", clazz);
- }
-
- @Test
- public void testLocatorWithoutSystemProperty() {
- System.setProperty(OsgiLocator.TIMEOUT, "0");
- System.clearProperty("Factory");
- Class clazz = OsgiLocator.locate(Object.class, "Factory");
- assertNotNull("Expected to find a class", clazz);
- assertEquals("Got the wrong class", MockCallable2.class.getName(), clazz.getName());
- }
-
- @Test
- public void testLocatorWithSystemPropertyAndTimeout() {
- long timeout = 1000;
- System.setProperty(OsgiLocator.TIMEOUT, Long.toString(timeout));
- System.setProperty("Factory", "org.apache.karaf.specs.locator.MockCallable");
- Class clazz = OsgiLocator.locate(Object.class, "Factory");
- assertNotNull("Expected to find a class", clazz);
- assertEquals("Got the wrong class.", MockCallable.class.getName(), clazz.getName());
-
- System.setProperty("Factory", "org.apache.karaf.specs.locator");
- long t0 = System.currentTimeMillis();
- clazz = OsgiLocator.locate(Object.class, "Factory");
- long t1 = System.currentTimeMillis();
- assertNull("Did not expect to find a class", clazz);
- assertTrue("Timeout issue", (t1 - t0) > timeout / 2);
- }
-
- @Test
- public void testLocatorWithoutSystemPropertyAndTimeout() {
- long timeout = 1000;
- System.setProperty(OsgiLocator.TIMEOUT, Long.toString(timeout));
- System.clearProperty("Factory");
- long t0 = System.currentTimeMillis();
- Class clazz = OsgiLocator.locate(Object.class, "Factory");
- long t1 = System.currentTimeMillis();
- assertNotNull("Expected to find a class", clazz);
- assertEquals("Got the wrong class", MockCallable2.class.getName(), clazz.getName());
- assertTrue("Timeout issue", (t1 - t0) < timeout / 2);
- }
-
-}
diff --git a/specs/pom.xml b/specs/pom.xml
deleted file mode 100644
index 45ed552ba51..00000000000
--- a/specs/pom.xml
+++ /dev/null
@@ -1,44 +0,0 @@
-
-
-
-
-
- 4.0.0
-
-
- org.apache.karaf
- karaf
- 4.5.0-SNAPSHOT
- ../pom.xml
-
-
- org.apache.karaf.specs
- specs
- pom
- Apache Karaf :: Specs
-
-
- locator
- activator
- javaxml
- javaxmlws
-
-
-
-