com.sun.xml.internal.ws.util.ServiceFinder Java Examples

The following examples show how to use com.sun.xml.internal.ws.util.ServiceFinder. 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: BindingID.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Parses a binding ID string into a {@link BindingID} object.
 *
 * <p>
 * This method first checks for a few known values and then delegate
 * the parsing to {@link BindingIDFactory}.
 *
 * <p>
 * If parsing succeeds this method returns a value. Otherwise
 * throws {@link WebServiceException}.
 *
 * @throws WebServiceException
 *      If the binding ID is not understood.
 */
public static @NotNull BindingID parse(String lexical) {
    if(lexical.equals(XML_HTTP.toString()))
        return XML_HTTP;
    if(lexical.equals(REST_HTTP.toString()))
        return REST_HTTP;
    if(belongsTo(lexical,SOAP11_HTTP.toString()))
        return customize(lexical,SOAP11_HTTP);
    if(belongsTo(lexical,SOAP12_HTTP.toString()))
        return customize(lexical,SOAP12_HTTP);
    if(belongsTo(lexical,SOAPBindingImpl.X_SOAP12HTTP_BINDING))
        return customize(lexical,X_SOAP12_HTTP);

    // OK, it's none of the values JAX-WS understands.
    for( BindingIDFactory f : ServiceFinder.find(BindingIDFactory.class) ) {
        BindingID r = f.parse(lexical);
        if(r!=null)
            return r;
    }

    // nobody understood this value
    throw new WebServiceException("Wrong binding ID: "+lexical);
}
 
Example #2
Source File: ProviderInvokerTubeFactory.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 6 votes vote down vote up
/**
 * @param classLoader
 * @param container
 * @param implType
 * @param invoker
 * @param argsBuilder
 * @param isAsync
 *
 * @return
 */
public static <T> ProviderInvokerTube<T> create(@Nullable final ClassLoader classLoader,
                                                @NotNull  final Container container,
                                                @NotNull  final Class<T> implType,
                                                @NotNull  final Invoker invoker,
                                                @NotNull  final ProviderArgumentsBuilder<?> argsBuilder,
                                                          final boolean isAsync)
{
    for (ProviderInvokerTubeFactory factory : ServiceFinder.find(ProviderInvokerTubeFactory.class,
                                                                 classLoader, container))
    {
        ProviderInvokerTube<T> tube = factory.doCreate(implType, invoker, argsBuilder, isAsync);
        if (tube != null) {
            if (logger.isLoggable(Level.FINE)) {
                ProviderInvokerTubeFactory.logger.log(Level.FINE, "{0} successfully created {1}", new Object[]{factory.getClass(), tube});
            }
            return tube;
        }
    }
    return DEFAULT.createDefault(implType, invoker, argsBuilder, isAsync);
}
 
Example #3
Source File: BindingID.java    From openjdk-8 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Parses a binding ID string into a {@link BindingID} object.
 *
 * <p>
 * This method first checks for a few known values and then delegate
 * the parsing to {@link BindingIDFactory}.
 *
 * <p>
 * If parsing succeeds this method returns a value. Otherwise
 * throws {@link WebServiceException}.
 *
 * @throws WebServiceException
 *      If the binding ID is not understood.
 */
public static @NotNull BindingID parse(String lexical) {
    if(lexical.equals(XML_HTTP.toString()))
        return XML_HTTP;
    if(lexical.equals(REST_HTTP.toString()))
        return REST_HTTP;
    if(belongsTo(lexical,SOAP11_HTTP.toString()))
        return customize(lexical,SOAP11_HTTP);
    if(belongsTo(lexical,SOAP12_HTTP.toString()))
        return customize(lexical,SOAP12_HTTP);
    if(belongsTo(lexical,SOAPBindingImpl.X_SOAP12HTTP_BINDING))
        return customize(lexical,X_SOAP12_HTTP);

    // OK, it's none of the values JAX-WS understands.
    for( BindingIDFactory f : ServiceFinder.find(BindingIDFactory.class) ) {
        BindingID r = f.parse(lexical);
        if(r!=null)
            return r;
    }

    // nobody understood this value
    throw new WebServiceException("Wrong binding ID: "+lexical);
}
 
Example #4
Source File: ProviderInvokerTubeFactory.java    From openjdk-8-source with GNU General Public License v2.0 6 votes vote down vote up
/**
 * @param classLoader
 * @param container
 * @param implType
 * @param invoker
 * @param argsBuilder
 * @param isAsync
 *
 * @return
 */
public static <T> ProviderInvokerTube<T> create(@Nullable final ClassLoader classLoader,
                                                @NotNull  final Container container,
                                                @NotNull  final Class<T> implType,
                                                @NotNull  final Invoker invoker,
                                                @NotNull  final ProviderArgumentsBuilder<?> argsBuilder,
                                                          final boolean isAsync)
{
    for (ProviderInvokerTubeFactory factory : ServiceFinder.find(ProviderInvokerTubeFactory.class,
                                                                 classLoader, container))
    {
        ProviderInvokerTube<T> tube = factory.doCreate(implType, invoker, argsBuilder, isAsync);
        if (tube != null) {
            if (logger.isLoggable(Level.FINE)) {
                ProviderInvokerTubeFactory.logger.log(Level.FINE, "{0} successfully created {1}", new Object[]{factory.getClass(), tube});
            }
            return tube;
        }
    }
    return DEFAULT.createDefault(implType, invoker, argsBuilder, isAsync);
}
 
Example #5
Source File: BindingID.java    From openjdk-8-source with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Parses a binding ID string into a {@link BindingID} object.
 *
 * <p>
 * This method first checks for a few known values and then delegate
 * the parsing to {@link BindingIDFactory}.
 *
 * <p>
 * If parsing succeeds this method returns a value. Otherwise
 * throws {@link WebServiceException}.
 *
 * @throws WebServiceException
 *      If the binding ID is not understood.
 */
public static @NotNull BindingID parse(String lexical) {
    if(lexical.equals(XML_HTTP.toString()))
        return XML_HTTP;
    if(lexical.equals(REST_HTTP.toString()))
        return REST_HTTP;
    if(belongsTo(lexical,SOAP11_HTTP.toString()))
        return customize(lexical,SOAP11_HTTP);
    if(belongsTo(lexical,SOAP12_HTTP.toString()))
        return customize(lexical,SOAP12_HTTP);
    if(belongsTo(lexical,SOAPBindingImpl.X_SOAP12HTTP_BINDING))
        return customize(lexical,X_SOAP12_HTTP);

    // OK, it's none of the values JAX-WS understands.
    for( BindingIDFactory f : ServiceFinder.find(BindingIDFactory.class) ) {
        BindingID r = f.parse(lexical);
        if(r!=null)
            return r;
    }

    // nobody understood this value
    throw new WebServiceException("Wrong binding ID: "+lexical);
}
 
Example #6
Source File: MetadataFinder.java    From openjdk-jdk8u with GNU General Public License v2.0 6 votes vote down vote up
private @Nullable Element getFromMetadataResolver(String systemId, Exception ex) {
    //try MEX
    MetaDataResolver resolver;
    ServiceDescriptor serviceDescriptor = null;
    for (MetadataResolverFactory resolverFactory : ServiceFinder.find(MetadataResolverFactory.class)) {
        resolver = resolverFactory.metadataResolver(options.entityResolver);
        try {
            serviceDescriptor = resolver.resolve(new URI(systemId));
            //we got the ServiceDescriptor, now break
            if (serviceDescriptor != null)
                break;
        } catch (URISyntaxException e) {
            throw new ParseException(e);
        }
    }

    if (serviceDescriptor != null) {
        errorReceiver.warning(new SAXParseException(WsdlMessages.TRY_WITH_MEX(ex.getMessage()), null, ex));
        return parseMetadata(systemId, serviceDescriptor);
    } else {
        errorReceiver.error(null, WsdlMessages.PARSING_UNABLE_TO_GET_METADATA(ex.getMessage(), WscompileMessages.WSIMPORT_NO_WSDL(systemId)), ex);
    }
    return null;
}
 
Example #7
Source File: MetadataFinder.java    From openjdk-8 with GNU General Public License v2.0 6 votes vote down vote up
private @Nullable Element getFromMetadataResolver(String systemId, Exception ex) {
    //try MEX
    MetaDataResolver resolver;
    ServiceDescriptor serviceDescriptor = null;
    for (MetadataResolverFactory resolverFactory : ServiceFinder.find(MetadataResolverFactory.class)) {
        resolver = resolverFactory.metadataResolver(options.entityResolver);
        try {
            serviceDescriptor = resolver.resolve(new URI(systemId));
            //we got the ServiceDescriptor, now break
            if (serviceDescriptor != null)
                break;
        } catch (URISyntaxException e) {
            throw new ParseException(e);
        }
    }

    if (serviceDescriptor != null) {
        errorReceiver.warning(new SAXParseException(WsdlMessages.TRY_WITH_MEX(ex.getMessage()), null, ex));
        return parseMetadata(systemId, serviceDescriptor);
    } else {
        errorReceiver.error(null, WsdlMessages.PARSING_UNABLE_TO_GET_METADATA(ex.getMessage(), WscompileMessages.WSIMPORT_NO_WSDL(systemId)), ex);
    }
    return null;
}
 
Example #8
Source File: WSEndpoint.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
public static <T> WSEndpoint<T> create(
    @NotNull Class<T> implType,
    boolean processHandlerAnnotation,
    @Nullable Invoker invoker,
    @Nullable QName serviceName,
    @Nullable QName portName,
    @Nullable Container container,
    @Nullable WSBinding binding,
    @Nullable SDDocumentSource primaryWsdl,
    @Nullable Collection<? extends SDDocumentSource> metadata,
    @Nullable EntityResolver resolver,
    boolean isTransportSynchronous,
    boolean isStandard)
{
    final WSEndpoint<T> endpoint =
        EndpointFactory.createEndpoint(
            implType,processHandlerAnnotation, invoker,serviceName,portName,container,binding,primaryWsdl,metadata,resolver,isTransportSynchronous,isStandard);

    final Iterator<ManagedEndpointFactory> managementFactories = ServiceFinder.find(ManagedEndpointFactory.class).iterator();
    if (managementFactories.hasNext()) {
        final ManagedEndpointFactory managementFactory = managementFactories.next();
        final EndpointCreationAttributes attributes = new EndpointCreationAttributes(
                processHandlerAnnotation, invoker, resolver, isTransportSynchronous);

        WSEndpoint<T> managedEndpoint = managementFactory.createEndpoint(endpoint, attributes);

        if (endpoint.getAssemblerContext().getTerminalTube() instanceof EndpointAwareTube) {
            ((EndpointAwareTube)endpoint.getAssemblerContext().getTerminalTube()).setEndpoint(managedEndpoint);
        }

        return managedEndpoint;
    }


    return endpoint;
}
 
Example #9
Source File: MessageContextFactory.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
@Deprecated
private static MessageContext serviceFinder(final ClassLoader[] classLoader, final Creator creator) {
    final ClassLoader cl = classLoader.length == 0 ? null : classLoader[0];
    for (MessageContextFactory factory : ServiceFinder.find(MessageContextFactory.class, cl)) {
        final MessageContext messageContext = creator.create(factory);
        if (messageContext != null)
            return messageContext;
    }
    return creator.create(DEFAULT);
}
 
Example #10
Source File: BindingContextFactory.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
public static Iterator<BindingContextFactory> serviceIterator() {
    final ServiceFinder<BindingContextFactory> sf = ServiceFinder
            .find(BindingContextFactory.class);
    final Iterator<BindingContextFactory> ibcf = sf.iterator();

    return new Iterator<BindingContextFactory>() {
        private BindingContextFactory bcf;

        public boolean hasNext() {
            while (true) {
                try {
                    if (ibcf.hasNext()) {
                        bcf = ibcf.next();
                        return true;
                    } else
                        return false;
                } catch (ServiceConfigurationError e) {
                    LOGGER.warning("skipping factory: ServiceConfigurationError: "
                            + e.getMessage());
                } catch (NoClassDefFoundError ncdfe) {
                    LOGGER.fine("skipping factory: NoClassDefFoundError: "
                            + ncdfe.getMessage());
                }
            }
        }

        public BindingContextFactory next() {
            if (LOGGER.isLoggable(Level.FINER))
                LOGGER.finer("SPI found provider: " +
                        bcf.getClass().getName());
            return bcf;
        }

        public void remove() {
            throw new UnsupportedOperationException();
        }
    };
}
 
Example #11
Source File: MessageContextFactory.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
@Deprecated
private static MessageContext serviceFinder(final ClassLoader[] classLoader, final Creator creator) {
    final ClassLoader cl = classLoader.length == 0 ? null : classLoader[0];
    for (MessageContextFactory factory : ServiceFinder.find(MessageContextFactory.class, cl)) {
        final MessageContext messageContext = creator.create(factory);
        if (messageContext != null)
            return messageContext;
    }
    return creator.create(DEFAULT);
}
 
Example #12
Source File: MessageContextFactory.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
@Deprecated
private static MessageContext serviceFinder(final ClassLoader[] classLoader, final Creator creator) {
    final ClassLoader cl = classLoader.length == 0 ? null : classLoader[0];
    for (MessageContextFactory factory : ServiceFinder.find(MessageContextFactory.class, cl)) {
        final MessageContext messageContext = creator.create(factory);
        if (messageContext != null)
            return messageContext;
    }
    return creator.create(DEFAULT);
}
 
Example #13
Source File: DatabindingFactoryImpl.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
static private List<DatabindingProvider> providers() {
    List<DatabindingProvider> factories = new java.util.ArrayList<DatabindingProvider>();
    for (DatabindingProvider p : ServiceFinder.find(DatabindingProvider.class)) {
        factories.add(p);
    }
    return factories;
}
 
Example #14
Source File: PolicyResolverFactory.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
public static PolicyResolver create(){
    for (PolicyResolverFactory factory : ServiceFinder.find(PolicyResolverFactory.class)) {
        PolicyResolver policyResolver = factory.doCreate();
        if (policyResolver != null) {
            return policyResolver;
        }
    }
     // return default policy resolver.
    return DEFAULT_POLICY_RESOLVER;
}
 
Example #15
Source File: DatabindingFactoryImpl.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
static private List<DatabindingProvider> providers() {
    List<DatabindingProvider> factories = new java.util.ArrayList<DatabindingProvider>();
    for (DatabindingProvider p : ServiceFinder.find(DatabindingProvider.class)) {
        factories.add(p);
    }
    return factories;
}
 
Example #16
Source File: EndpointFactory.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
/**
     * Generates the WSDL and XML Schema for the endpoint if necessary
     * It generates WSDL only for SOAP1.1, and for XSOAP1.2 bindings
     */
    private static SDDocumentImpl generateWSDL(WSBinding binding, AbstractSEIModelImpl seiModel, Collection<SDDocumentImpl> docs,
                                               Container container, Class implType) {
        BindingID bindingId = binding.getBindingId();
        if (!bindingId.canGenerateWSDL()) {
            throw new ServerRtException("can.not.generate.wsdl", bindingId);
        }

        if (bindingId.toString().equals(SOAPBindingImpl.X_SOAP12HTTP_BINDING)) {
            String msg = ServerMessages.GENERATE_NON_STANDARD_WSDL();
            logger.warning(msg);
        }

        // Generate WSDL and schema documents using runtime model
        WSDLGenResolver wsdlResolver = new WSDLGenResolver(docs,seiModel.getServiceQName(),seiModel.getPortTypeName());
        WSDLGenInfo wsdlGenInfo = new WSDLGenInfo();
        wsdlGenInfo.setWsdlResolver(wsdlResolver);
        wsdlGenInfo.setContainer(container);
        wsdlGenInfo.setExtensions(ServiceFinder.find(WSDLGeneratorExtension.class).toArray());
        wsdlGenInfo.setInlineSchemas(false);
        wsdlGenInfo.setSecureXmlProcessingDisabled(isSecureXmlProcessingDisabled(binding.getFeatures()));
        seiModel.getDatabinding().generateWSDL(wsdlGenInfo);
//        WSDLGenerator wsdlGen = new WSDLGenerator(seiModel, wsdlResolver, binding, container, implType, false,
//                ServiceFinder.find(WSDLGeneratorExtension.class).toArray());
//        wsdlGen.doGeneration();
        return wsdlResolver.updateDocs();
    }
 
Example #17
Source File: SAAJFactory.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Reads the message within the Packet to a SAAJMessage.  After this call message is consumed.
 * @param packet Packet
 * @return Created SAAJPMessage
 * @throws SOAPException if SAAJ processing fails
 */
public static SAAJMessage read(Packet packet) throws SOAPException {
    // Use the Component from the Packet if it exists.  Note the logic
    // in the ServiceFinder is such that find(Class) is not equivalent
    // to find (Class, null), so the ternary operator is needed.
    ServiceFinder<SAAJFactory> factories = (packet.component != null ?
            ServiceFinder.find(SAAJFactory.class, packet.component) :
            ServiceFinder.find(SAAJFactory.class));
    for (SAAJFactory s : factories) {
        SAAJMessage msg = s.readAsSAAJ(packet);
        if (msg != null) return msg;
    }
    return instance.readAsSAAJ(packet);
}
 
Example #18
Source File: SAAJFactory.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Creates Message from SOAPMessage
 * @param saaj SOAPMessage
 * @return created Message
 */
public static Message create(SOAPMessage saaj) {
        for (SAAJFactory s : ServiceFinder.find(SAAJFactory.class)) {
                Message m = s.createMessage(saaj);
                if (m != null)
                        return m;
        }

return instance.createMessage(saaj);
}
 
Example #19
Source File: RuntimeWSDLParser.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
private static BindingID createBindingId(String transport, SOAPVersion soapVersion) {
    if (!transport.equals(SOAPConstants.URI_SOAP_TRANSPORT_HTTP)) {
        for( BindingIDFactory f : ServiceFinder.find(BindingIDFactory.class) ) {
            BindingID bindingId = f.create(transport, soapVersion);
            if(bindingId!=null) {
                return bindingId;
            }
        }
    }
    return soapVersion.equals(SOAPVersion.SOAP_11)?BindingID.SOAP11_HTTP:BindingID.SOAP12_HTTP;
}
 
Example #20
Source File: PipelineAssemblerFactory.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Locates {@link PipelineAssemblerFactory}s and create
 * a suitable {@link PipelineAssembler}.
 *
 * @param bindingId
 *      The binding ID string for which the new {@link PipelineAssembler}
 *      is created. Must not be null.
 * @return
 *      Always non-null, since we fall back to our default {@link PipelineAssembler}.
 */
public static PipelineAssembler create(ClassLoader classLoader, BindingID bindingId) {
    for (PipelineAssemblerFactory factory : ServiceFinder.find(PipelineAssemblerFactory.class,classLoader)) {
        PipelineAssembler assembler = factory.doCreate(bindingId);
        if(assembler!=null) {
            logger.fine(factory.getClass()+" successfully created "+assembler);
            return assembler;
        }
    }

    // default binding IDs that are known
    // TODO: replace this with proper ones
    return new com.sun.xml.internal.ws.util.pipe.StandalonePipeAssembler();
}
 
Example #21
Source File: PolicyResolverFactory.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
public static PolicyResolver create(){
    for (PolicyResolverFactory factory : ServiceFinder.find(PolicyResolverFactory.class)) {
        PolicyResolver policyResolver = factory.doCreate();
        if (policyResolver != null) {
            return policyResolver;
        }
    }
     // return default policy resolver.
    return DEFAULT_POLICY_RESOLVER;
}
 
Example #22
Source File: SAAJFactory.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Reads the message within the Packet to a SAAJMessage.  After this call message is consumed.
 * @param packet Packet
 * @return Created SAAJPMessage
 * @throws SOAPException if SAAJ processing fails
 */
public static SAAJMessage read(Packet packet) throws SOAPException {
    // Use the Component from the Packet if it exists.  Note the logic
    // in the ServiceFinder is such that find(Class) is not equivalent
    // to find (Class, null), so the ternary operator is needed.
    ServiceFinder<SAAJFactory> factories = (packet.component != null ?
            ServiceFinder.find(SAAJFactory.class, packet.component) :
            ServiceFinder.find(SAAJFactory.class));
    for (SAAJFactory s : factories) {
        SAAJMessage msg = s.readAsSAAJ(packet);
        if (msg != null) return msg;
    }
    return instance.readAsSAAJ(packet);
}
 
Example #23
Source File: DatabindingFactoryImpl.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
static private List<DatabindingProvider> providers() {
    List<DatabindingProvider> factories = new java.util.ArrayList<DatabindingProvider>();
    for (DatabindingProvider p : ServiceFinder.find(DatabindingProvider.class)) {
        factories.add(p);
    }
    return factories;
}
 
Example #24
Source File: SAAJFactory.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Creates Message from SOAPMessage
 * @param saaj SOAPMessage
 * @return created Message
 */
public static Message create(SOAPMessage saaj) {
        for (SAAJFactory s : ServiceFinder.find(SAAJFactory.class)) {
                Message m = s.createMessage(saaj);
                if (m != null)
                        return m;
        }

return instance.createMessage(saaj);
}
 
Example #25
Source File: WSEndpoint.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
public static <T> WSEndpoint<T> create(
    @NotNull Class<T> implType,
    boolean processHandlerAnnotation,
    @Nullable Invoker invoker,
    @Nullable QName serviceName,
    @Nullable QName portName,
    @Nullable Container container,
    @Nullable WSBinding binding,
    @Nullable SDDocumentSource primaryWsdl,
    @Nullable Collection<? extends SDDocumentSource> metadata,
    @Nullable EntityResolver resolver,
    boolean isTransportSynchronous,
    boolean isStandard)
{
    final WSEndpoint<T> endpoint =
        EndpointFactory.createEndpoint(
            implType,processHandlerAnnotation, invoker,serviceName,portName,container,binding,primaryWsdl,metadata,resolver,isTransportSynchronous,isStandard);

    final Iterator<ManagedEndpointFactory> managementFactories = ServiceFinder.find(ManagedEndpointFactory.class).iterator();
    if (managementFactories.hasNext()) {
        final ManagedEndpointFactory managementFactory = managementFactories.next();
        final EndpointCreationAttributes attributes = new EndpointCreationAttributes(
                processHandlerAnnotation, invoker, resolver, isTransportSynchronous);

        WSEndpoint<T> managedEndpoint = managementFactory.createEndpoint(endpoint, attributes);

        if (endpoint.getAssemblerContext().getTerminalTube() instanceof EndpointAwareTube) {
            ((EndpointAwareTube)endpoint.getAssemblerContext().getTerminalTube()).setEndpoint(managedEndpoint);
        }

        return managedEndpoint;
    }


    return endpoint;
}
 
Example #26
Source File: MessageContextFactory.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
@Deprecated
private static MessageContext serviceFinder(final ClassLoader[] classLoader, final Creator creator) {
    final ClassLoader cl = classLoader.length == 0 ? null : classLoader[0];
    for (MessageContextFactory factory : ServiceFinder.find(MessageContextFactory.class, cl)) {
        final MessageContext messageContext = creator.create(factory);
        if (messageContext != null)
            return messageContext;
    }
    return creator.create(DEFAULT);
}
 
Example #27
Source File: StreamSOAPCodec.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
private StreamDecoder selectStreamDecoder() {
    for (StreamDecoder sd : ServiceFinder.find(StreamDecoder.class)) {
        return sd;
    }

    return new StreamDecoderImpl();
}
 
Example #28
Source File: WsgenOptions.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
public WsgenOptions() {
    protocols.add(SOAP11);
    protocols.add(X_SOAP12);
    nonstdProtocols.put(X_SOAP12, SOAPBindingImpl.X_SOAP12HTTP_BINDING);
    ServiceFinder<WsgenExtension> extn = ServiceFinder.find(WsgenExtension.class);
    for(WsgenExtension ext : extn) {
        Class clazz = ext.getClass();
        WsgenProtocol pro = (WsgenProtocol)clazz.getAnnotation(WsgenProtocol.class);
        protocols.add(pro.token());
        nonstdProtocols.put(pro.token(), pro.lexical());
    }
}
 
Example #29
Source File: EndpointFactory.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
/**
     * Generates the WSDL and XML Schema for the endpoint if necessary
     * It generates WSDL only for SOAP1.1, and for XSOAP1.2 bindings
     */
    private static SDDocumentImpl generateWSDL(WSBinding binding, AbstractSEIModelImpl seiModel, List<SDDocumentImpl> docs,
                                               Container container, Class implType) {
        BindingID bindingId = binding.getBindingId();
        if (!bindingId.canGenerateWSDL()) {
            throw new ServerRtException("can.not.generate.wsdl", bindingId);
        }

        if (bindingId.toString().equals(SOAPBindingImpl.X_SOAP12HTTP_BINDING)) {
            String msg = ServerMessages.GENERATE_NON_STANDARD_WSDL();
            logger.warning(msg);
        }

        // Generate WSDL and schema documents using runtime model
        WSDLGenResolver wsdlResolver = new WSDLGenResolver(docs,seiModel.getServiceQName(),seiModel.getPortTypeName());
        WSDLGenInfo wsdlGenInfo = new WSDLGenInfo();
        wsdlGenInfo.setWsdlResolver(wsdlResolver);
        wsdlGenInfo.setContainer(container);
        wsdlGenInfo.setExtensions(ServiceFinder.find(WSDLGeneratorExtension.class).toArray());
        wsdlGenInfo.setInlineSchemas(false);
        wsdlGenInfo.setSecureXmlProcessingDisabled(isSecureXmlProcessingDisabled(binding.getFeatures()));
        seiModel.getDatabinding().generateWSDL(wsdlGenInfo);
//        WSDLGenerator wsdlGen = new WSDLGenerator(seiModel, wsdlResolver, binding, container, implType, false,
//                ServiceFinder.find(WSDLGeneratorExtension.class).toArray());
//        wsdlGen.doGeneration();
        return wsdlResolver.updateDocs();
    }
 
Example #30
Source File: StreamSOAPCodec.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
private StreamDecoder selectStreamDecoder() {
    for (StreamDecoder sd : ServiceFinder.find(StreamDecoder.class)) {
        return sd;
    }

    return new StreamDecoderImpl();
}