zoukankan      html  css  js  c++  java
  • 为WebService指定线程池

    通过阅读WebService发布过程的源代码,可以配置自定义的线程池

    package org.zln.ws.server;

    import com.sun.xml.internal.ws.api.BindingID;
    import com.sun.xml.internal.ws.transport.http.server.EndpointImpl;
    import org.slf4j.Logger;
    import org.slf4j.LoggerFactory;

    import javax.xml.ws.WebServiceFeature;
    import java.util.concurrent.Executor;
    import java.util.concurrent.Executors;

    /**
    * Created by sherry on 16/12/15.
    */
    public class Main {

    /**
    * 日志
    */
    private static Logger logger = LoggerFactory.getLogger(Main.class);

    public static void main(String[] args) {
    UserService userService = new UserService();
    String address = "http://localhost:8080/Service/UserService";
    EndpointImpl endpoint = new EndpointImpl(BindingID.parse(userService.getClass()), userService, new WebServiceFeature[0]);
    Executor executor = Executors.newFixedThreadPool(2);
    endpoint.setExecutor(executor);
    endpoint.publish(address);

    logger.debug("Service服务发布成功");
    }

    }
  • 相关阅读:
    Python接入支付宝进行PC端支付
    python3.6安装pycrypto,pycrytodome和crypto
    Redis
    python时区设置——pytz模块
    redis介绍以及安装
    转译符,re模块,random模块
    正则表达式
    走进模块
    面向对象进阶
    pycharm快捷键
  • 原文地址:https://www.cnblogs.com/sherrykid/p/6254177.html
Copyright © 2011-2022 走看看