本文整理汇总了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);
}
示例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);
}
示例3: setThreadpool
import com.alibaba.dubbo.common.threadpool.ThreadPool; //导入依赖的package包/类
public void setThreadpool(String threadpool) {
checkExtension(ThreadPool.class, "threadpool", threadpool);
this.threadpool = threadpool;
}