diff -r 000000000000 -r 373ffda63c9a src/share/jaxws_classes/com/sun/xml/internal/ws/transport/http/DeploymentDescriptorParser.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/share/jaxws_classes/com/sun/xml/internal/ws/transport/http/DeploymentDescriptorParser.java Wed Apr 27 01:27:09 2016 +0800 @@ -0,0 +1,608 @@ +/* + * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code 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 General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package com.sun.xml.internal.ws.transport.http; + +import com.oracle.webservices.internal.api.databinding.DatabindingModeFeature; +import com.oracle.webservices.internal.api.databinding.ExternalMetadataFeature; +import com.sun.istack.internal.NotNull; +import com.sun.xml.internal.ws.api.BindingID; +import com.sun.xml.internal.ws.api.WSBinding; +import com.sun.xml.internal.ws.api.databinding.MetadataReader; +import com.sun.xml.internal.ws.api.server.Container; +import com.sun.xml.internal.ws.api.server.SDDocumentSource; +import com.sun.xml.internal.ws.api.server.WSEndpoint; +import com.sun.xml.internal.ws.api.streaming.XMLStreamReaderFactory; +import com.sun.xml.internal.ws.binding.WebServiceFeatureList; + +import com.sun.xml.internal.ws.handler.HandlerChainsModel; +import com.sun.xml.internal.ws.resources.ServerMessages; +import com.sun.xml.internal.ws.resources.WsservletMessages; +import com.sun.xml.internal.ws.server.EndpointFactory; +import com.sun.xml.internal.ws.server.ServerRtException; +import com.sun.xml.internal.ws.streaming.Attributes; +import com.sun.xml.internal.ws.streaming.TidyXMLStreamReader; +import com.sun.xml.internal.ws.streaming.XMLStreamReaderUtil; +import com.sun.xml.internal.ws.util.HandlerAnnotationInfo; +import com.sun.xml.internal.ws.util.exception.LocatableWebServiceException; +import com.sun.xml.internal.ws.util.xml.XmlUtil; +import org.xml.sax.EntityResolver; + +import javax.xml.namespace.QName; +import javax.xml.stream.XMLStreamConstants; +import javax.xml.stream.XMLStreamException; +import javax.xml.stream.XMLStreamReader; +import javax.xml.ws.WebServiceException; +import javax.xml.ws.WebServiceFeature; +import javax.xml.ws.http.HTTPBinding; +import javax.xml.ws.soap.MTOMFeature; +import javax.xml.ws.soap.SOAPBinding; +import java.io.File; +import java.io.FileInputStream; +import java.io.IOException; +import java.io.InputStream; +import java.net.MalformedURLException; +import java.net.URL; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; + +/** + * Parses {@code sun-jaxws.xml} into {@link WSEndpoint}. + *
+ * + * Since {@code sun-jaxws.xml} captures more information than what {@link WSEndpoint} + * represents (in particular URL pattern and name), this class + * takes a parameterization 'A' so that the user of this parser can choose to + * create another type that wraps {@link WSEndpoint}. + * + * {@link HttpAdapter} and its derived type is used for this often, + * but it can be anything. + * + * @author WS Development Team + * @author Kohsuke Kawaguchi + */ +public class DeploymentDescriptorParser { + + public static final String NS_RUNTIME = "http://java.sun.com/xml/ns/jax-ws/ri/runtime"; + public static final String JAXWS_WSDL_DD_DIR = "WEB-INF/wsdl"; + + public static final QName QNAME_ENDPOINTS = new QName(NS_RUNTIME, "endpoints"); + public static final QName QNAME_ENDPOINT = new QName(NS_RUNTIME, "endpoint"); + public static final QName QNAME_EXT_METADA = new QName(NS_RUNTIME, "external-metadata"); + + public static final String ATTR_FILE = "file"; + public static final String ATTR_RESOURCE = "resource"; + + public static final String ATTR_VERSION = "version"; + public static final String ATTR_NAME = "name"; + public static final String ATTR_IMPLEMENTATION = "implementation"; + public static final String ATTR_WSDL = "wsdl"; + public static final String ATTR_SERVICE = "service"; + public static final String ATTR_PORT = "port"; + public static final String ATTR_URL_PATTERN = "url-pattern"; + public static final String ATTR_ENABLE_MTOM = "enable-mtom"; + public static final String ATTR_MTOM_THRESHOLD_VALUE = "mtom-threshold-value"; + public static final String ATTR_BINDING = "binding"; + public static final String ATTR_DATABINDING = "databinding"; + + public static final List