• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java ServiceFinder类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中com.sun.xml.internal.ws.util.ServiceFinder的典型用法代码示例。如果您正苦于以下问题:Java ServiceFinder类的具体用法?Java ServiceFinder怎么用?Java ServiceFinder使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



ServiceFinder类属于com.sun.xml.internal.ws.util包,在下文中一共展示了ServiceFinder类的19个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: create

import com.sun.xml.internal.ws.util.ServiceFinder; //导入依赖的package包/类
/**
 * @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);
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:31,代码来源:ProviderInvokerTubeFactory.java


示例2: parse

import com.sun.xml.internal.ws.util.ServiceFinder; //导入依赖的package包/类
/**
 * 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);
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:37,代码来源:BindingID.java


示例3: getFromMetadataResolver

import com.sun.xml.internal.ws.util.ServiceFinder; //导入依赖的package包/类
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;
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:25,代码来源:MetadataFinder.java


示例4: generateWSDL

import com.sun.xml.internal.ws.util.ServiceFinder; //导入依赖的package包/类
/**
 * 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());
    WSDLGenerator wsdlGen = new WSDLGenerator(seiModel, wsdlResolver, binding, container, implType, false,
            ServiceFinder.find(WSDLGeneratorExtension.class).toArray());
    wsdlGen.doGeneration();
    return wsdlResolver.updateDocs();
}
 
开发者ID:alexkasko,项目名称:openjdk-icedtea7,代码行数:24,代码来源:EndpointFactory.java


示例5: create

import com.sun.xml.internal.ws.util.ServiceFinder; //导入依赖的package包/类
/**
 * 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);
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:15,代码来源:SAAJFactory.java


示例6: read

import com.sun.xml.internal.ws.util.ServiceFinder; //导入依赖的package包/类
/**
 * Reads Message as SOAPMessage.  After this call message is consumed.
 * @param soapVersion SOAP version
 * @param message Message
 * @return Created SOAPMessage
 * @throws SOAPException if SAAJ processing fails
 */
public static SOAPMessage read(SOAPVersion soapVersion, Message message) throws SOAPException {
        for (SAAJFactory s : ServiceFinder.find(SAAJFactory.class)) {
                SOAPMessage msg = s.readAsSOAPMessage(soapVersion, message);
                if (msg != null)
                        return msg;
        }

return instance.readAsSOAPMessage(soapVersion, message);
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:17,代码来源:SAAJFactory.java


示例7: create

import com.sun.xml.internal.ws.util.ServiceFinder; //导入依赖的package包/类
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;
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:11,代码来源:PolicyResolverFactory.java


示例8: create

import com.sun.xml.internal.ws.util.ServiceFinder; //导入依赖的package包/类
/**
 * 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();
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:24,代码来源:PipelineAssemblerFactory.java


示例9: create

import com.sun.xml.internal.ws.util.ServiceFinder; //导入依赖的package包/类
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;
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:37,代码来源:WSEndpoint.java


示例10: serviceIterator

import com.sun.xml.internal.ws.util.ServiceFinder; //导入依赖的package包/类
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();
        }
    };
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:39,代码来源:BindingContextFactory.java


示例11: generateWSDL

import com.sun.xml.internal.ws.util.ServiceFinder; //导入依赖的package包/类
/**
     * 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();
    }
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:31,代码来源:EndpointFactory.java


示例12: providers

import com.sun.xml.internal.ws.util.ServiceFinder; //导入依赖的package包/类
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;
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:8,代码来源:DatabindingFactoryImpl.java


示例13: selectStreamDecoder

import com.sun.xml.internal.ws.util.ServiceFinder; //导入依赖的package包/类
private StreamDecoder selectStreamDecoder() {
    for (StreamDecoder sd : ServiceFinder.find(StreamDecoder.class)) {
        return sd;
    }

    return new StreamDecoderImpl();
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:8,代码来源:StreamSOAPCodec.java


示例14: createBindingId

import com.sun.xml.internal.ws.util.ServiceFinder; //导入依赖的package包/类
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;
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:12,代码来源:RuntimeWSDLParser.java


示例15: findServices

import com.sun.xml.internal.ws.util.ServiceFinder; //导入依赖的package包/类
/**
 * Looks for all "META-INF/services/[className]" files and
 * create one instance for each class name found inside this file.
 */
private static <T> T[] findServices(Class<T> clazz, ClassLoader classLoader) {
    ServiceFinder<T> serviceFinder = ServiceFinder.find(clazz, classLoader);
    List<T> r = new ArrayList<T>();
    for (T t : serviceFinder) {
        r.add(t);
    }
    return r.toArray((T[]) Array.newInstance(clazz, r.size()));
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:13,代码来源:WsimportOptions.java


示例16: WsgenOptions

import com.sun.xml.internal.ws.util.ServiceFinder; //导入依赖的package包/类
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());
    }
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:13,代码来源:WsgenOptions.java


示例17: WSDLParser

import com.sun.xml.internal.ws.util.ServiceFinder; //导入依赖的package包/类
public WSDLParser(WsimportOptions options, ErrorReceiverFilter errReceiver, MetadataFinder forest) {
    this.extensionHandlers = new HashMap();
    this.options = options;
    this.errReceiver = errReceiver;
    if (forest == null) {
        forest = new MetadataFinder(new WSDLInternalizationLogic(), options, errReceiver);
        forest.parseWSDL();
        if (forest.isMexMetadata) {
            errReceiver.reset();
    }
    }
    this.forest = forest;
    // register handlers for default extensions
    register(new SOAPExtensionHandler(extensionHandlers));
    register(new HTTPExtensionHandler(extensionHandlers));
    register(new MIMEExtensionHandler(extensionHandlers));
    register(new JAXWSBindingExtensionHandler(extensionHandlers));
    register(new SOAP12ExtensionHandler(extensionHandlers));

    // MemberSubmission Addressing not supported by WsImport anymore see JAX_WS-1040 for details
    //register(new MemberSubmissionAddressingExtensionHandler(extensionHandlers, errReceiver, options.isExtensionMode()));

    register(new W3CAddressingExtensionHandler(extensionHandlers, errReceiver));
    register(new W3CAddressingMetadataExtensionHandler(extensionHandlers, errReceiver));
    register(new Policy12ExtensionHandler());
    register(new Policy15ExtensionHandler());
    for (TWSDLExtensionHandler te : ServiceFinder.find(TWSDLExtensionHandler.class)) {
        register(te);
    }

}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:32,代码来源:WSDLParser.java


示例18: createFactory

import com.sun.xml.internal.ws.util.ServiceFinder; //导入依赖的package包/类
static public MessageContextFactory createFactory(ClassLoader cl, WebServiceFeature ...f) {
    for (MessageContextFactory factory : ServiceFinder.find(MessageContextFactory.class, cl)) {
        MessageContextFactory newfac = factory.newFactory(f);
        if (newfac != null) return newfac;
    }
    return new com.sun.xml.internal.ws.api.message.MessageContextFactory(f);
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:8,代码来源:MessageContextFactory.java


示例19: serviceFinder

import com.sun.xml.internal.ws.util.ServiceFinder; //导入依赖的package包/类
@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);
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:11,代码来源:MessageContextFactory.java



注:本文中的com.sun.xml.internal.ws.util.ServiceFinder类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java TreeSet类代码示例发布时间:2022-05-23
下一篇:
Java PGPKeyEncryptionMethodGenerator类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap