Java Code Examples for com.sun.xml.internal.ws.server.EndpointFactory#verifyImplementorClass()
The following examples show how to use
com.sun.xml.internal.ws.server.EndpointFactory#verifyImplementorClass() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: EndpointImpl.java From TencentKona-8 with GNU General Public License v2.0 | 5 votes |
/** * Gets wsdl from @WebService or @WebServiceProvider */ private @Nullable SDDocumentSource getPrimaryWsdl(MetadataReader metadataReader) { // Takes care of @WebService, @WebServiceProvider's wsdlLocation EndpointFactory.verifyImplementorClass(implClass, metadataReader); String wsdlLocation = EndpointFactory.getWsdlLocation(implClass, metadataReader); if (wsdlLocation != null) { ClassLoader cl = implClass.getClassLoader(); URL url = cl.getResource(wsdlLocation); if (url != null) { return SDDocumentSource.create(url); } throw new ServerRtException("cannot.load.wsdl", wsdlLocation); } return null; }
Example 2
Source File: EndpointImpl.java From jdk8u60 with GNU General Public License v2.0 | 5 votes |
/** * Gets wsdl from @WebService or @WebServiceProvider */ private @Nullable SDDocumentSource getPrimaryWsdl(MetadataReader metadataReader) { // Takes care of @WebService, @WebServiceProvider's wsdlLocation EndpointFactory.verifyImplementorClass(implClass, metadataReader); String wsdlLocation = EndpointFactory.getWsdlLocation(implClass, metadataReader); if (wsdlLocation != null) { ClassLoader cl = implClass.getClassLoader(); URL url = cl.getResource(wsdlLocation); if (url != null) { return SDDocumentSource.create(url); } throw new ServerRtException("cannot.load.wsdl", wsdlLocation); } return null; }
Example 3
Source File: EndpointImpl.java From openjdk-jdk8u with GNU General Public License v2.0 | 5 votes |
/** * Gets wsdl from @WebService or @WebServiceProvider */ private @Nullable SDDocumentSource getPrimaryWsdl(MetadataReader metadataReader) { // Takes care of @WebService, @WebServiceProvider's wsdlLocation EndpointFactory.verifyImplementorClass(implClass, metadataReader); String wsdlLocation = EndpointFactory.getWsdlLocation(implClass, metadataReader); if (wsdlLocation != null) { ClassLoader cl = implClass.getClassLoader(); URL url = cl.getResource(wsdlLocation); if (url != null) { return SDDocumentSource.create(url); } throw new ServerRtException("cannot.load.wsdl", wsdlLocation); } return null; }
Example 4
Source File: EndpointImpl.java From openjdk-jdk8u-backup with GNU General Public License v2.0 | 5 votes |
/** * Gets wsdl from @WebService or @WebServiceProvider */ private @Nullable SDDocumentSource getPrimaryWsdl(MetadataReader metadataReader) { // Takes care of @WebService, @WebServiceProvider's wsdlLocation EndpointFactory.verifyImplementorClass(implClass, metadataReader); String wsdlLocation = EndpointFactory.getWsdlLocation(implClass, metadataReader); if (wsdlLocation != null) { ClassLoader cl = implClass.getClassLoader(); URL url = cl.getResource(wsdlLocation); if (url != null) { return SDDocumentSource.create(url); } throw new ServerRtException("cannot.load.wsdl", wsdlLocation); } return null; }
Example 5
Source File: EndpointImpl.java From openjdk-jdk9 with GNU General Public License v2.0 | 5 votes |
/** * Gets wsdl from @WebService or @WebServiceProvider */ private @Nullable SDDocumentSource getPrimaryWsdl(MetadataReader metadataReader) { // Takes care of @WebService, @WebServiceProvider's wsdlLocation EndpointFactory.verifyImplementorClass(implClass, metadataReader); String wsdlLocation = EndpointFactory.getWsdlLocation(implClass, metadataReader); if (wsdlLocation != null) { return SDDocumentSource.create(implClass, wsdlLocation); } return null; }
Example 6
Source File: EndpointImpl.java From hottub with GNU General Public License v2.0 | 5 votes |
/** * Gets wsdl from @WebService or @WebServiceProvider */ private @Nullable SDDocumentSource getPrimaryWsdl(MetadataReader metadataReader) { // Takes care of @WebService, @WebServiceProvider's wsdlLocation EndpointFactory.verifyImplementorClass(implClass, metadataReader); String wsdlLocation = EndpointFactory.getWsdlLocation(implClass, metadataReader); if (wsdlLocation != null) { ClassLoader cl = implClass.getClassLoader(); URL url = cl.getResource(wsdlLocation); if (url != null) { return SDDocumentSource.create(url); } throw new ServerRtException("cannot.load.wsdl", wsdlLocation); } return null; }
Example 7
Source File: EndpointImpl.java From openjdk-8-source with GNU General Public License v2.0 | 5 votes |
/** * Gets wsdl from @WebService or @WebServiceProvider */ private @Nullable SDDocumentSource getPrimaryWsdl(MetadataReader metadataReader) { // Takes care of @WebService, @WebServiceProvider's wsdlLocation EndpointFactory.verifyImplementorClass(implClass, metadataReader); String wsdlLocation = EndpointFactory.getWsdlLocation(implClass, metadataReader); if (wsdlLocation != null) { ClassLoader cl = implClass.getClassLoader(); URL url = cl.getResource(wsdlLocation); if (url != null) { return SDDocumentSource.create(url); } throw new ServerRtException("cannot.load.wsdl", wsdlLocation); } return null; }
Example 8
Source File: EndpointImpl.java From openjdk-8 with GNU General Public License v2.0 | 5 votes |
/** * Gets wsdl from @WebService or @WebServiceProvider */ private @Nullable SDDocumentSource getPrimaryWsdl(MetadataReader metadataReader) { // Takes care of @WebService, @WebServiceProvider's wsdlLocation EndpointFactory.verifyImplementorClass(implClass, metadataReader); String wsdlLocation = EndpointFactory.getWsdlLocation(implClass, metadataReader); if (wsdlLocation != null) { ClassLoader cl = implClass.getClassLoader(); URL url = cl.getResource(wsdlLocation); if (url != null) { return SDDocumentSource.create(url); } throw new ServerRtException("cannot.load.wsdl", wsdlLocation); } return null; }
Example 9
Source File: DeploymentDescriptorParser.java From TencentKona-8 with GNU General Public License v2.0 | 4 votes |
private List<A> parseAdapters(XMLStreamReader reader) { if (!reader.getName().equals(QNAME_ENDPOINTS)) { failWithFullName("runtime.parser.invalidElement", reader); } List<A> adapters = new ArrayList<A>(); Attributes attrs = XMLStreamReaderUtil.getAttributes(reader); String version = getMandatoryNonEmptyAttribute(reader, attrs, ATTR_VERSION); if (!ATTRVALUE_SUPPORTED_VERSIONS.contains(version)) { failWithLocalName("runtime.parser.invalidVersionNumber", reader, version); } while (XMLStreamReaderUtil.nextElementContent(reader) != XMLStreamConstants.END_ELEMENT) { if (reader.getName().equals(QNAME_ENDPOINT)) { attrs = XMLStreamReaderUtil.getAttributes(reader); String name = getMandatoryNonEmptyAttribute(reader, attrs, ATTR_NAME); if (!names.add(name)) { logger.warning( WsservletMessages.SERVLET_WARNING_DUPLICATE_ENDPOINT_NAME(/*name*/)); } String implementationName = getMandatoryNonEmptyAttribute(reader, attrs, ATTR_IMPLEMENTATION); Class<?> implementorClass = getImplementorClass(implementationName, reader); MetadataReader metadataReader = null; ExternalMetadataFeature externalMetadataFeature = null; // parse subelements to instantiate externalMetadataReader, if necessary ... XMLStreamReaderUtil.nextElementContent(reader); if (reader.getEventType() != XMLStreamConstants.END_ELEMENT) { externalMetadataFeature = configureExternalMetadataReader(reader); if (externalMetadataFeature != null) { metadataReader = externalMetadataFeature.getMetadataReader(implementorClass.getClassLoader(), false); } } QName serviceName = getQNameAttribute(attrs, ATTR_SERVICE); if (serviceName == null) { serviceName = EndpointFactory.getDefaultServiceName(implementorClass, metadataReader); } QName portName = getQNameAttribute(attrs, ATTR_PORT); if (portName == null) { portName = EndpointFactory.getDefaultPortName(serviceName, implementorClass, metadataReader); } //get enable-mtom attribute value String enable_mtom = getAttribute(attrs, ATTR_ENABLE_MTOM); String mtomThreshold = getAttribute(attrs, ATTR_MTOM_THRESHOLD_VALUE); String dbMode = getAttribute(attrs, ATTR_DATABINDING); String bindingId = getAttribute(attrs, ATTR_BINDING); if (bindingId != null) { // Convert short-form tokens to API's binding ids bindingId = getBindingIdForToken(bindingId); } WSBinding binding = createBinding(bindingId, implementorClass, enable_mtom, mtomThreshold, dbMode); if (externalMetadataFeature != null) { binding.getFeatures().mergeFeatures(new WebServiceFeature[]{externalMetadataFeature}, true); } String urlPattern = getMandatoryNonEmptyAttribute(reader, attrs, ATTR_URL_PATTERN); // TODO use 'docs' as the metadata. If wsdl is non-null it's the primary. boolean handlersSetInDD = setHandlersAndRoles(binding, reader, serviceName, portName); EndpointFactory.verifyImplementorClass(implementorClass, metadataReader); SDDocumentSource primaryWSDL = getPrimaryWSDL(reader, attrs, implementorClass, metadataReader); WSEndpoint<?> endpoint = WSEndpoint.create( implementorClass, !handlersSetInDD, null, serviceName, portName, container, binding, primaryWSDL, docs.values(), createEntityResolver(), false ); adapters.add(adapterFactory.createAdapter(name, urlPattern, endpoint)); } else { failWithLocalName("runtime.parser.invalidElement", reader); } } return adapters; }
Example 10
Source File: DeploymentDescriptorParser.java From jdk8u60 with GNU General Public License v2.0 | 4 votes |
private List<A> parseAdapters(XMLStreamReader reader) { if (!reader.getName().equals(QNAME_ENDPOINTS)) { failWithFullName("runtime.parser.invalidElement", reader); } List<A> adapters = new ArrayList<A>(); Attributes attrs = XMLStreamReaderUtil.getAttributes(reader); String version = getMandatoryNonEmptyAttribute(reader, attrs, ATTR_VERSION); if (!ATTRVALUE_SUPPORTED_VERSIONS.contains(version)) { failWithLocalName("runtime.parser.invalidVersionNumber", reader, version); } while (XMLStreamReaderUtil.nextElementContent(reader) != XMLStreamConstants.END_ELEMENT) { if (reader.getName().equals(QNAME_ENDPOINT)) { attrs = XMLStreamReaderUtil.getAttributes(reader); String name = getMandatoryNonEmptyAttribute(reader, attrs, ATTR_NAME); if (!names.add(name)) { logger.warning( WsservletMessages.SERVLET_WARNING_DUPLICATE_ENDPOINT_NAME(/*name*/)); } String implementationName = getMandatoryNonEmptyAttribute(reader, attrs, ATTR_IMPLEMENTATION); Class<?> implementorClass = getImplementorClass(implementationName, reader); MetadataReader metadataReader = null; ExternalMetadataFeature externalMetadataFeature = null; // parse subelements to instantiate externalMetadataReader, if necessary ... XMLStreamReaderUtil.nextElementContent(reader); if (reader.getEventType() != XMLStreamConstants.END_ELEMENT) { externalMetadataFeature = configureExternalMetadataReader(reader); if (externalMetadataFeature != null) { metadataReader = externalMetadataFeature.getMetadataReader(implementorClass.getClassLoader(), false); } } QName serviceName = getQNameAttribute(attrs, ATTR_SERVICE); if (serviceName == null) { serviceName = EndpointFactory.getDefaultServiceName(implementorClass, metadataReader); } QName portName = getQNameAttribute(attrs, ATTR_PORT); if (portName == null) { portName = EndpointFactory.getDefaultPortName(serviceName, implementorClass, metadataReader); } //get enable-mtom attribute value String enable_mtom = getAttribute(attrs, ATTR_ENABLE_MTOM); String mtomThreshold = getAttribute(attrs, ATTR_MTOM_THRESHOLD_VALUE); String dbMode = getAttribute(attrs, ATTR_DATABINDING); String bindingId = getAttribute(attrs, ATTR_BINDING); if (bindingId != null) { // Convert short-form tokens to API's binding ids bindingId = getBindingIdForToken(bindingId); } WSBinding binding = createBinding(bindingId, implementorClass, enable_mtom, mtomThreshold, dbMode); if (externalMetadataFeature != null) { binding.getFeatures().mergeFeatures(new WebServiceFeature[]{externalMetadataFeature}, true); } String urlPattern = getMandatoryNonEmptyAttribute(reader, attrs, ATTR_URL_PATTERN); // TODO use 'docs' as the metadata. If wsdl is non-null it's the primary. boolean handlersSetInDD = setHandlersAndRoles(binding, reader, serviceName, portName); EndpointFactory.verifyImplementorClass(implementorClass, metadataReader); SDDocumentSource primaryWSDL = getPrimaryWSDL(reader, attrs, implementorClass, metadataReader); WSEndpoint<?> endpoint = WSEndpoint.create( implementorClass, !handlersSetInDD, null, serviceName, portName, container, binding, primaryWSDL, docs.values(), createEntityResolver(), false ); adapters.add(adapterFactory.createAdapter(name, urlPattern, endpoint)); } else { failWithLocalName("runtime.parser.invalidElement", reader); } } return adapters; }
Example 11
Source File: DeploymentDescriptorParser.java From openjdk-jdk8u with GNU General Public License v2.0 | 4 votes |
private List<A> parseAdapters(XMLStreamReader reader) { if (!reader.getName().equals(QNAME_ENDPOINTS)) { failWithFullName("runtime.parser.invalidElement", reader); } List<A> adapters = new ArrayList<A>(); Attributes attrs = XMLStreamReaderUtil.getAttributes(reader); String version = getMandatoryNonEmptyAttribute(reader, attrs, ATTR_VERSION); if (!ATTRVALUE_SUPPORTED_VERSIONS.contains(version)) { failWithLocalName("runtime.parser.invalidVersionNumber", reader, version); } while (XMLStreamReaderUtil.nextElementContent(reader) != XMLStreamConstants.END_ELEMENT) { if (reader.getName().equals(QNAME_ENDPOINT)) { attrs = XMLStreamReaderUtil.getAttributes(reader); String name = getMandatoryNonEmptyAttribute(reader, attrs, ATTR_NAME); if (!names.add(name)) { logger.warning( WsservletMessages.SERVLET_WARNING_DUPLICATE_ENDPOINT_NAME(/*name*/)); } String implementationName = getMandatoryNonEmptyAttribute(reader, attrs, ATTR_IMPLEMENTATION); Class<?> implementorClass = getImplementorClass(implementationName, reader); MetadataReader metadataReader = null; ExternalMetadataFeature externalMetadataFeature = null; // parse subelements to instantiate externalMetadataReader, if necessary ... XMLStreamReaderUtil.nextElementContent(reader); if (reader.getEventType() != XMLStreamConstants.END_ELEMENT) { externalMetadataFeature = configureExternalMetadataReader(reader); if (externalMetadataFeature != null) { metadataReader = externalMetadataFeature.getMetadataReader(implementorClass.getClassLoader(), false); } } QName serviceName = getQNameAttribute(attrs, ATTR_SERVICE); if (serviceName == null) { serviceName = EndpointFactory.getDefaultServiceName(implementorClass, metadataReader); } QName portName = getQNameAttribute(attrs, ATTR_PORT); if (portName == null) { portName = EndpointFactory.getDefaultPortName(serviceName, implementorClass, metadataReader); } //get enable-mtom attribute value String enable_mtom = getAttribute(attrs, ATTR_ENABLE_MTOM); String mtomThreshold = getAttribute(attrs, ATTR_MTOM_THRESHOLD_VALUE); String dbMode = getAttribute(attrs, ATTR_DATABINDING); String bindingId = getAttribute(attrs, ATTR_BINDING); if (bindingId != null) { // Convert short-form tokens to API's binding ids bindingId = getBindingIdForToken(bindingId); } WSBinding binding = createBinding(bindingId, implementorClass, enable_mtom, mtomThreshold, dbMode); if (externalMetadataFeature != null) { binding.getFeatures().mergeFeatures(new WebServiceFeature[]{externalMetadataFeature}, true); } String urlPattern = getMandatoryNonEmptyAttribute(reader, attrs, ATTR_URL_PATTERN); // TODO use 'docs' as the metadata. If wsdl is non-null it's the primary. boolean handlersSetInDD = setHandlersAndRoles(binding, reader, serviceName, portName); EndpointFactory.verifyImplementorClass(implementorClass, metadataReader); SDDocumentSource primaryWSDL = getPrimaryWSDL(reader, attrs, implementorClass, metadataReader); WSEndpoint<?> endpoint = WSEndpoint.create( implementorClass, !handlersSetInDD, null, serviceName, portName, container, binding, primaryWSDL, docs.values(), createEntityResolver(), false ); adapters.add(adapterFactory.createAdapter(name, urlPattern, endpoint)); } else { failWithLocalName("runtime.parser.invalidElement", reader); } } return adapters; }
Example 12
Source File: DeploymentDescriptorParser.java From openjdk-jdk8u-backup with GNU General Public License v2.0 | 4 votes |
private List<A> parseAdapters(XMLStreamReader reader) { if (!reader.getName().equals(QNAME_ENDPOINTS)) { failWithFullName("runtime.parser.invalidElement", reader); } List<A> adapters = new ArrayList<A>(); Attributes attrs = XMLStreamReaderUtil.getAttributes(reader); String version = getMandatoryNonEmptyAttribute(reader, attrs, ATTR_VERSION); if (!ATTRVALUE_SUPPORTED_VERSIONS.contains(version)) { failWithLocalName("runtime.parser.invalidVersionNumber", reader, version); } while (XMLStreamReaderUtil.nextElementContent(reader) != XMLStreamConstants.END_ELEMENT) { if (reader.getName().equals(QNAME_ENDPOINT)) { attrs = XMLStreamReaderUtil.getAttributes(reader); String name = getMandatoryNonEmptyAttribute(reader, attrs, ATTR_NAME); if (!names.add(name)) { logger.warning( WsservletMessages.SERVLET_WARNING_DUPLICATE_ENDPOINT_NAME(/*name*/)); } String implementationName = getMandatoryNonEmptyAttribute(reader, attrs, ATTR_IMPLEMENTATION); Class<?> implementorClass = getImplementorClass(implementationName, reader); MetadataReader metadataReader = null; ExternalMetadataFeature externalMetadataFeature = null; // parse subelements to instantiate externalMetadataReader, if necessary ... XMLStreamReaderUtil.nextElementContent(reader); if (reader.getEventType() != XMLStreamConstants.END_ELEMENT) { externalMetadataFeature = configureExternalMetadataReader(reader); if (externalMetadataFeature != null) { metadataReader = externalMetadataFeature.getMetadataReader(implementorClass.getClassLoader(), false); } } QName serviceName = getQNameAttribute(attrs, ATTR_SERVICE); if (serviceName == null) { serviceName = EndpointFactory.getDefaultServiceName(implementorClass, metadataReader); } QName portName = getQNameAttribute(attrs, ATTR_PORT); if (portName == null) { portName = EndpointFactory.getDefaultPortName(serviceName, implementorClass, metadataReader); } //get enable-mtom attribute value String enable_mtom = getAttribute(attrs, ATTR_ENABLE_MTOM); String mtomThreshold = getAttribute(attrs, ATTR_MTOM_THRESHOLD_VALUE); String dbMode = getAttribute(attrs, ATTR_DATABINDING); String bindingId = getAttribute(attrs, ATTR_BINDING); if (bindingId != null) { // Convert short-form tokens to API's binding ids bindingId = getBindingIdForToken(bindingId); } WSBinding binding = createBinding(bindingId, implementorClass, enable_mtom, mtomThreshold, dbMode); if (externalMetadataFeature != null) { binding.getFeatures().mergeFeatures(new WebServiceFeature[]{externalMetadataFeature}, true); } String urlPattern = getMandatoryNonEmptyAttribute(reader, attrs, ATTR_URL_PATTERN); // TODO use 'docs' as the metadata. If wsdl is non-null it's the primary. boolean handlersSetInDD = setHandlersAndRoles(binding, reader, serviceName, portName); EndpointFactory.verifyImplementorClass(implementorClass, metadataReader); SDDocumentSource primaryWSDL = getPrimaryWSDL(reader, attrs, implementorClass, metadataReader); WSEndpoint<?> endpoint = WSEndpoint.create( implementorClass, !handlersSetInDD, null, serviceName, portName, container, binding, primaryWSDL, docs.values(), createEntityResolver(), false ); adapters.add(adapterFactory.createAdapter(name, urlPattern, endpoint)); } else { failWithLocalName("runtime.parser.invalidElement", reader); } } return adapters; }
Example 13
Source File: DeploymentDescriptorParser.java From openjdk-jdk9 with GNU General Public License v2.0 | 4 votes |
private List<A> parseAdapters(XMLStreamReader reader) { if (!reader.getName().equals(QNAME_ENDPOINTS)) { failWithFullName("runtime.parser.invalidElement", reader); } List<A> adapters = new ArrayList<A>(); Attributes attrs = XMLStreamReaderUtil.getAttributes(reader); String version = getMandatoryNonEmptyAttribute(reader, attrs, ATTR_VERSION); if (!ATTRVALUE_SUPPORTED_VERSIONS.contains(version)) { failWithLocalName("runtime.parser.invalidVersionNumber", reader, version); } while (XMLStreamReaderUtil.nextElementContent(reader) != XMLStreamConstants.END_ELEMENT) { if (reader.getName().equals(QNAME_ENDPOINT)) { attrs = XMLStreamReaderUtil.getAttributes(reader); String name = getMandatoryNonEmptyAttribute(reader, attrs, ATTR_NAME); if (!names.add(name)) { logger.warning( WsservletMessages.SERVLET_WARNING_DUPLICATE_ENDPOINT_NAME(/*name*/)); } String implementationName = getMandatoryNonEmptyAttribute(reader, attrs, ATTR_IMPLEMENTATION); Class<?> implementorClass = getImplementorClass(implementationName, reader); MetadataReader metadataReader = null; ExternalMetadataFeature externalMetadataFeature = null; // parse subelements to instantiate externalMetadataReader, if necessary ... XMLStreamReaderUtil.nextElementContent(reader); if (reader.getEventType() != XMLStreamConstants.END_ELEMENT) { externalMetadataFeature = configureExternalMetadataReader(reader); if (externalMetadataFeature != null) { metadataReader = externalMetadataFeature.getMetadataReader(implementorClass.getClassLoader(), false); } } QName serviceName = getQNameAttribute(attrs, ATTR_SERVICE); if (serviceName == null) { serviceName = EndpointFactory.getDefaultServiceName(implementorClass, metadataReader); } QName portName = getQNameAttribute(attrs, ATTR_PORT); if (portName == null) { portName = EndpointFactory.getDefaultPortName(serviceName, implementorClass, metadataReader); } //get enable-mtom attribute value String enable_mtom = getAttribute(attrs, ATTR_ENABLE_MTOM); String mtomThreshold = getAttribute(attrs, ATTR_MTOM_THRESHOLD_VALUE); String dbMode = getAttribute(attrs, ATTR_DATABINDING); String bindingId = getAttribute(attrs, ATTR_BINDING); if (bindingId != null) { // Convert short-form tokens to API's binding ids bindingId = getBindingIdForToken(bindingId); } WSBinding binding = createBinding(bindingId, implementorClass, enable_mtom, mtomThreshold, dbMode); if (externalMetadataFeature != null) { binding.getFeatures().mergeFeatures(new WebServiceFeature[]{externalMetadataFeature}, true); } String urlPattern = getMandatoryNonEmptyAttribute(reader, attrs, ATTR_URL_PATTERN); // TODO use 'docs' as the metadata. If wsdl is non-null it's the primary. boolean handlersSetInDD = setHandlersAndRoles(binding, reader, serviceName, portName); EndpointFactory.verifyImplementorClass(implementorClass, metadataReader); SDDocumentSource primaryWSDL = getPrimaryWSDL(reader, attrs, implementorClass, metadataReader); WSEndpoint<?> endpoint = WSEndpoint.create( implementorClass, !handlersSetInDD, null, serviceName, portName, container, binding, primaryWSDL, docs.values(), createEntityResolver(), false ); adapters.add(adapterFactory.createAdapter(name, urlPattern, endpoint)); } else { failWithLocalName("runtime.parser.invalidElement", reader); } } return adapters; }
Example 14
Source File: DeploymentDescriptorParser.java From hottub with GNU General Public License v2.0 | 4 votes |
private List<A> parseAdapters(XMLStreamReader reader) { if (!reader.getName().equals(QNAME_ENDPOINTS)) { failWithFullName("runtime.parser.invalidElement", reader); } List<A> adapters = new ArrayList<A>(); Attributes attrs = XMLStreamReaderUtil.getAttributes(reader); String version = getMandatoryNonEmptyAttribute(reader, attrs, ATTR_VERSION); if (!ATTRVALUE_SUPPORTED_VERSIONS.contains(version)) { failWithLocalName("runtime.parser.invalidVersionNumber", reader, version); } while (XMLStreamReaderUtil.nextElementContent(reader) != XMLStreamConstants.END_ELEMENT) { if (reader.getName().equals(QNAME_ENDPOINT)) { attrs = XMLStreamReaderUtil.getAttributes(reader); String name = getMandatoryNonEmptyAttribute(reader, attrs, ATTR_NAME); if (!names.add(name)) { logger.warning( WsservletMessages.SERVLET_WARNING_DUPLICATE_ENDPOINT_NAME(/*name*/)); } String implementationName = getMandatoryNonEmptyAttribute(reader, attrs, ATTR_IMPLEMENTATION); Class<?> implementorClass = getImplementorClass(implementationName, reader); MetadataReader metadataReader = null; ExternalMetadataFeature externalMetadataFeature = null; // parse subelements to instantiate externalMetadataReader, if necessary ... XMLStreamReaderUtil.nextElementContent(reader); if (reader.getEventType() != XMLStreamConstants.END_ELEMENT) { externalMetadataFeature = configureExternalMetadataReader(reader); if (externalMetadataFeature != null) { metadataReader = externalMetadataFeature.getMetadataReader(implementorClass.getClassLoader(), false); } } QName serviceName = getQNameAttribute(attrs, ATTR_SERVICE); if (serviceName == null) { serviceName = EndpointFactory.getDefaultServiceName(implementorClass, metadataReader); } QName portName = getQNameAttribute(attrs, ATTR_PORT); if (portName == null) { portName = EndpointFactory.getDefaultPortName(serviceName, implementorClass, metadataReader); } //get enable-mtom attribute value String enable_mtom = getAttribute(attrs, ATTR_ENABLE_MTOM); String mtomThreshold = getAttribute(attrs, ATTR_MTOM_THRESHOLD_VALUE); String dbMode = getAttribute(attrs, ATTR_DATABINDING); String bindingId = getAttribute(attrs, ATTR_BINDING); if (bindingId != null) { // Convert short-form tokens to API's binding ids bindingId = getBindingIdForToken(bindingId); } WSBinding binding = createBinding(bindingId, implementorClass, enable_mtom, mtomThreshold, dbMode); if (externalMetadataFeature != null) { binding.getFeatures().mergeFeatures(new WebServiceFeature[]{externalMetadataFeature}, true); } String urlPattern = getMandatoryNonEmptyAttribute(reader, attrs, ATTR_URL_PATTERN); // TODO use 'docs' as the metadata. If wsdl is non-null it's the primary. boolean handlersSetInDD = setHandlersAndRoles(binding, reader, serviceName, portName); EndpointFactory.verifyImplementorClass(implementorClass, metadataReader); SDDocumentSource primaryWSDL = getPrimaryWSDL(reader, attrs, implementorClass, metadataReader); WSEndpoint<?> endpoint = WSEndpoint.create( implementorClass, !handlersSetInDD, null, serviceName, portName, container, binding, primaryWSDL, docs.values(), createEntityResolver(), false ); adapters.add(adapterFactory.createAdapter(name, urlPattern, endpoint)); } else { failWithLocalName("runtime.parser.invalidElement", reader); } } return adapters; }
Example 15
Source File: DeploymentDescriptorParser.java From openjdk-8-source with GNU General Public License v2.0 | 4 votes |
private List<A> parseAdapters(XMLStreamReader reader) { if (!reader.getName().equals(QNAME_ENDPOINTS)) { failWithFullName("runtime.parser.invalidElement", reader); } List<A> adapters = new ArrayList<A>(); Attributes attrs = XMLStreamReaderUtil.getAttributes(reader); String version = getMandatoryNonEmptyAttribute(reader, attrs, ATTR_VERSION); if (!ATTRVALUE_SUPPORTED_VERSIONS.contains(version)) { failWithLocalName("runtime.parser.invalidVersionNumber", reader, version); } while (XMLStreamReaderUtil.nextElementContent(reader) != XMLStreamConstants.END_ELEMENT) { if (reader.getName().equals(QNAME_ENDPOINT)) { attrs = XMLStreamReaderUtil.getAttributes(reader); String name = getMandatoryNonEmptyAttribute(reader, attrs, ATTR_NAME); if (!names.add(name)) { logger.warning( WsservletMessages.SERVLET_WARNING_DUPLICATE_ENDPOINT_NAME(/*name*/)); } String implementationName = getMandatoryNonEmptyAttribute(reader, attrs, ATTR_IMPLEMENTATION); Class<?> implementorClass = getImplementorClass(implementationName, reader); MetadataReader metadataReader = null; ExternalMetadataFeature externalMetadataFeature = null; // parse subelements to instantiate externalMetadataReader, if necessary ... XMLStreamReaderUtil.nextElementContent(reader); if (reader.getEventType() != XMLStreamConstants.END_ELEMENT) { externalMetadataFeature = configureExternalMetadataReader(reader); if (externalMetadataFeature != null) { metadataReader = externalMetadataFeature.getMetadataReader(implementorClass.getClassLoader(), false); } } QName serviceName = getQNameAttribute(attrs, ATTR_SERVICE); if (serviceName == null) { serviceName = EndpointFactory.getDefaultServiceName(implementorClass, metadataReader); } QName portName = getQNameAttribute(attrs, ATTR_PORT); if (portName == null) { portName = EndpointFactory.getDefaultPortName(serviceName, implementorClass, metadataReader); } //get enable-mtom attribute value String enable_mtom = getAttribute(attrs, ATTR_ENABLE_MTOM); String mtomThreshold = getAttribute(attrs, ATTR_MTOM_THRESHOLD_VALUE); String dbMode = getAttribute(attrs, ATTR_DATABINDING); String bindingId = getAttribute(attrs, ATTR_BINDING); if (bindingId != null) { // Convert short-form tokens to API's binding ids bindingId = getBindingIdForToken(bindingId); } WSBinding binding = createBinding(bindingId, implementorClass, enable_mtom, mtomThreshold, dbMode); if (externalMetadataFeature != null) { binding.getFeatures().mergeFeatures(new WebServiceFeature[]{externalMetadataFeature}, true); } String urlPattern = getMandatoryNonEmptyAttribute(reader, attrs, ATTR_URL_PATTERN); // TODO use 'docs' as the metadata. If wsdl is non-null it's the primary. boolean handlersSetInDD = setHandlersAndRoles(binding, reader, serviceName, portName); EndpointFactory.verifyImplementorClass(implementorClass, metadataReader); SDDocumentSource primaryWSDL = getPrimaryWSDL(reader, attrs, implementorClass, metadataReader); WSEndpoint<?> endpoint = WSEndpoint.create( implementorClass, !handlersSetInDD, null, serviceName, portName, container, binding, primaryWSDL, docs.values(), createEntityResolver(), false ); adapters.add(adapterFactory.createAdapter(name, urlPattern, endpoint)); } else { failWithLocalName("runtime.parser.invalidElement", reader); } } return adapters; }
Example 16
Source File: DeploymentDescriptorParser.java From openjdk-8 with GNU General Public License v2.0 | 4 votes |
private List<A> parseAdapters(XMLStreamReader reader) { if (!reader.getName().equals(QNAME_ENDPOINTS)) { failWithFullName("runtime.parser.invalidElement", reader); } List<A> adapters = new ArrayList<A>(); Attributes attrs = XMLStreamReaderUtil.getAttributes(reader); String version = getMandatoryNonEmptyAttribute(reader, attrs, ATTR_VERSION); if (!ATTRVALUE_SUPPORTED_VERSIONS.contains(version)) { failWithLocalName("runtime.parser.invalidVersionNumber", reader, version); } while (XMLStreamReaderUtil.nextElementContent(reader) != XMLStreamConstants.END_ELEMENT) { if (reader.getName().equals(QNAME_ENDPOINT)) { attrs = XMLStreamReaderUtil.getAttributes(reader); String name = getMandatoryNonEmptyAttribute(reader, attrs, ATTR_NAME); if (!names.add(name)) { logger.warning( WsservletMessages.SERVLET_WARNING_DUPLICATE_ENDPOINT_NAME(/*name*/)); } String implementationName = getMandatoryNonEmptyAttribute(reader, attrs, ATTR_IMPLEMENTATION); Class<?> implementorClass = getImplementorClass(implementationName, reader); MetadataReader metadataReader = null; ExternalMetadataFeature externalMetadataFeature = null; // parse subelements to instantiate externalMetadataReader, if necessary ... XMLStreamReaderUtil.nextElementContent(reader); if (reader.getEventType() != XMLStreamConstants.END_ELEMENT) { externalMetadataFeature = configureExternalMetadataReader(reader); if (externalMetadataFeature != null) { metadataReader = externalMetadataFeature.getMetadataReader(implementorClass.getClassLoader(), false); } } QName serviceName = getQNameAttribute(attrs, ATTR_SERVICE); if (serviceName == null) { serviceName = EndpointFactory.getDefaultServiceName(implementorClass, metadataReader); } QName portName = getQNameAttribute(attrs, ATTR_PORT); if (portName == null) { portName = EndpointFactory.getDefaultPortName(serviceName, implementorClass, metadataReader); } //get enable-mtom attribute value String enable_mtom = getAttribute(attrs, ATTR_ENABLE_MTOM); String mtomThreshold = getAttribute(attrs, ATTR_MTOM_THRESHOLD_VALUE); String dbMode = getAttribute(attrs, ATTR_DATABINDING); String bindingId = getAttribute(attrs, ATTR_BINDING); if (bindingId != null) { // Convert short-form tokens to API's binding ids bindingId = getBindingIdForToken(bindingId); } WSBinding binding = createBinding(bindingId, implementorClass, enable_mtom, mtomThreshold, dbMode); if (externalMetadataFeature != null) { binding.getFeatures().mergeFeatures(new WebServiceFeature[]{externalMetadataFeature}, true); } String urlPattern = getMandatoryNonEmptyAttribute(reader, attrs, ATTR_URL_PATTERN); // TODO use 'docs' as the metadata. If wsdl is non-null it's the primary. boolean handlersSetInDD = setHandlersAndRoles(binding, reader, serviceName, portName); EndpointFactory.verifyImplementorClass(implementorClass, metadataReader); SDDocumentSource primaryWSDL = getPrimaryWSDL(reader, attrs, implementorClass, metadataReader); WSEndpoint<?> endpoint = WSEndpoint.create( implementorClass, !handlersSetInDD, null, serviceName, portName, container, binding, primaryWSDL, docs.values(), createEntityResolver(), false ); adapters.add(adapterFactory.createAdapter(name, urlPattern, endpoint)); } else { failWithLocalName("runtime.parser.invalidElement", reader); } } return adapters; }