当前位置: 首页>>代码示例>>Java>>正文


Java ThreadPool类代码示例

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


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

示例1: WrappedChannelHandler

import com.alibaba.dubbo.common.threadpool.ThreadPool; //导入依赖的package包/类
public WrappedChannelHandler(ChannelHandler handler, URL url) {
    this.handler = handler;
    this.url = url;
    executor = (ExecutorService) ExtensionLoader.getExtensionLoader(ThreadPool.class).getAdaptiveExtension().getExecutor(url);

    String componentKey = Constants.EXECUTOR_SERVICE_COMPONENT_KEY;
    if (Constants.CONSUMER_SIDE.equalsIgnoreCase(url.getParameter(Constants.SIDE_KEY))) {
        componentKey = Constants.CONSUMER_SIDE;
    }
    DataStore dataStore = ExtensionLoader.getExtensionLoader(DataStore.class).getDefaultExtension();
    dataStore.put(componentKey, Integer.toString(url.getPort()), executor);
}
 
开发者ID:dachengxi,项目名称:EatDubbo,代码行数:13,代码来源:WrappedChannelHandler.java

示例2: WrappedChannelHandler

import com.alibaba.dubbo.common.threadpool.ThreadPool; //导入依赖的package包/类
public WrappedChannelHandler(ChannelHandler handler, URL url) {
    this.handler = handler;
    this.url = url;
    //FIXME 默认为 FixedThreadPool  add by jileng
    executor = (ExecutorService) ExtensionLoader.getExtensionLoader(ThreadPool.class).getAdaptiveExtension().getExecutor(url);

    String componentKey = Constants.EXECUTOR_SERVICE_COMPONENT_KEY;
    if (Constants.CONSUMER_SIDE.equalsIgnoreCase(url.getParameter(Constants.SIDE_KEY))) {
        componentKey = Constants.CONSUMER_SIDE;
    }
    DataStore dataStore = ExtensionLoader.getExtensionLoader(DataStore.class).getDefaultExtension();
    dataStore.put(componentKey, Integer.toString(url.getPort()), executor);
}
 
开发者ID:spccold,项目名称:dubbo-comments,代码行数:14,代码来源:WrappedChannelHandler.java

示例3: setThreadpool

import com.alibaba.dubbo.common.threadpool.ThreadPool; //导入依赖的package包/类
public void setThreadpool(String threadpool) {
    checkExtension(ThreadPool.class, "threadpool", threadpool);
    this.threadpool = threadpool;
}
 
开发者ID:dachengxi,项目名称:EatDubbo,代码行数:5,代码来源:ProviderConfig.java


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