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


Java AbortPolicyWithReport类代码示例

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


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

示例1: jStackDumpTest

import com.alibaba.dubbo.common.threadpool.support.AbortPolicyWithReport; //导入依赖的package包/类
@Test
public void jStackDumpTest() throws InterruptedException {
    URL url = URL.valueOf("dubbo://admin:[email protected]:20880/context/path?dump.directory=/tmp&version=1.0.0&application=morgan&noValue");
    AbortPolicyWithReport abortPolicyWithReport = new AbortPolicyWithReport("Test", url);

    try {
        abortPolicyWithReport.rejectedExecution(new Runnable() {
            @Override
            public void run() {
                System.out.println("hello");
            }
        }, (ThreadPoolExecutor) Executors.newFixedThreadPool(1));
    }catch (RejectedExecutionException rj){

    }

    Thread.currentThread().sleep(1000);

}
 
开发者ID:hufeng,项目名称:dubbo2.js,代码行数:20,代码来源:AbortPolicyWithReportTest.java

示例2: ConnectionOrderedChannelHandler

import com.alibaba.dubbo.common.threadpool.support.AbortPolicyWithReport; //导入依赖的package包/类
public ConnectionOrderedChannelHandler(ChannelHandler handler, URL url) {
    super(handler, url);
    String threadName = url.getParameter(Constants.THREAD_NAME_KEY,Constants.DEFAULT_THREAD_NAME);
    connectionExecutor = new ThreadPoolExecutor(1, 1,
                                 0L, TimeUnit.MILLISECONDS,
                                 new LinkedBlockingQueue<Runnable>(url.getPositiveParameter(Constants.CONNECT_QUEUE_CAPACITY, Integer.MAX_VALUE)),
                                 new NamedThreadFactory(threadName, true),
                                 new AbortPolicyWithReport(threadName, url)
        );  // FIXME 没有地方释放connectionExecutor!
    queuewarninglimit = url.getParameter(Constants.CONNECT_QUEUE_WARNING_SIZE, Constants.DEFAULT_CONNECT_QUEUE_WARNING_SIZE);
}
 
开发者ID:dachengxi,项目名称:EatDubbo,代码行数:12,代码来源:ConnectionOrderedChannelHandler.java

示例3: getExecutor

import com.alibaba.dubbo.common.threadpool.support.AbortPolicyWithReport; //导入依赖的package包/类
public Executor getExecutor(URL url) {
    String name = url.getParameter(Constants.THREAD_NAME_KEY, Constants.DEFAULT_THREAD_NAME);
    int threads = url.getParameter(Constants.THREADS_KEY, Constants.DEFAULT_THREADS);
    int queues = url.getParameter(Constants.QUEUES_KEY, Constants.DEFAULT_QUEUES);
    return new ThreadPoolExecutor(threads, threads, 0, TimeUnit.MILLISECONDS, 
    		queues == 0 ? new SynchronousQueue<Runnable>() : 
    			(queues < 0 ? new LinkedBlockingQueue<Runnable>() 
    					: new LinkedBlockingQueue<Runnable>(queues)),
    		new NamedThreadFactory(name, true), new AbortPolicyWithReport(name, url));
}
 
开发者ID:dachengxi,项目名称:EatDubbo,代码行数:11,代码来源:FixedThreadPool.java

示例4: getExecutor

import com.alibaba.dubbo.common.threadpool.support.AbortPolicyWithReport; //导入依赖的package包/类
public Executor getExecutor(URL url) {
    String name = url.getParameter(Constants.THREAD_NAME_KEY, Constants.DEFAULT_THREAD_NAME);
    int cores = url.getParameter(Constants.CORE_THREADS_KEY, Constants.DEFAULT_CORE_THREADS);
    int threads = url.getParameter(Constants.THREADS_KEY, Integer.MAX_VALUE);
    int queues = url.getParameter(Constants.QUEUES_KEY, Constants.DEFAULT_QUEUES);
    int alive = url.getParameter(Constants.ALIVE_KEY, Constants.DEFAULT_ALIVE);
    return new ThreadPoolExecutor(cores, threads, alive, TimeUnit.MILLISECONDS, 
    		queues == 0 ? new SynchronousQueue<Runnable>() : 
    			(queues < 0 ? new LinkedBlockingQueue<Runnable>() 
    					: new LinkedBlockingQueue<Runnable>(queues)),
    		new NamedThreadFactory(name, true), new AbortPolicyWithReport(name, url));
}
 
开发者ID:dachengxi,项目名称:EatDubbo,代码行数:13,代码来源:CachedThreadPool.java

示例5: getExecutor

import com.alibaba.dubbo.common.threadpool.support.AbortPolicyWithReport; //导入依赖的package包/类
public Executor getExecutor(URL url) {
    String name = url.getParameter(Constants.THREAD_NAME_KEY, Constants.DEFAULT_THREAD_NAME);
    int cores = url.getParameter(Constants.CORE_THREADS_KEY, Constants.DEFAULT_CORE_THREADS);
    int threads = url.getParameter(Constants.THREADS_KEY, Constants.DEFAULT_THREADS);
    int queues = url.getParameter(Constants.QUEUES_KEY, Constants.DEFAULT_QUEUES);
    return new ThreadPoolExecutor(cores, threads, Long.MAX_VALUE, TimeUnit.MILLISECONDS, 
    		queues == 0 ? new SynchronousQueue<Runnable>() : 
    			(queues < 0 ? new LinkedBlockingQueue<Runnable>() 
    					: new LinkedBlockingQueue<Runnable>(queues)),
    		new NamedThreadFactory(name, true), new AbortPolicyWithReport(name, url));
}
 
开发者ID:dachengxi,项目名称:EatDubbo,代码行数:12,代码来源:LimitedThreadPool.java

示例6: ConnectionOrderedChannelHandler

import com.alibaba.dubbo.common.threadpool.support.AbortPolicyWithReport; //导入依赖的package包/类
public ConnectionOrderedChannelHandler(ChannelHandler handler, URL url) {
    super(handler, url);
    String threadName = url.getParameter(Constants.THREAD_NAME_KEY,Constants.DEFAULT_THREAD_NAME);
    //only single thread
    connectionExecutor = new ThreadPoolExecutor(1, 1,
                                 0L, TimeUnit.MILLISECONDS,
                                 new LinkedBlockingQueue<Runnable>(url.getPositiveParameter(Constants.CONNECT_QUEUE_CAPACITY, Integer.MAX_VALUE)),
                                 new NamedThreadFactory(threadName, true),
                                 new AbortPolicyWithReport(threadName, url)
        );  // FIXME 没有地方释放connectionExecutor!
    queuewarninglimit = url.getParameter(Constants.CONNECT_QUEUE_WARNING_SIZE, Constants.DEFAULT_CONNECT_QUEUE_WARNING_SIZE);
}
 
开发者ID:spccold,项目名称:dubbo-comments,代码行数:13,代码来源:ConnectionOrderedChannelHandler.java

示例7: ConnectionOrderedChannelHandler

import com.alibaba.dubbo.common.threadpool.support.AbortPolicyWithReport; //导入依赖的package包/类
public ConnectionOrderedChannelHandler(ChannelHandler handler, URL url) {
    super(handler, url);
    String threadName = url.getParameter(Constants.THREAD_NAME_KEY,Constants.DEFAULT_THREAD_NAME);
    connectionExecutor = new ThreadPoolExecutor(1, 1,
                                 0L, TimeUnit.MILLISECONDS,
                                 new LinkedBlockingQueue<>(url.getPositiveParameter(Constants.CONNECT_QUEUE_CAPACITY, Integer.MAX_VALUE)),
                                 new NamedThreadFactory(threadName, true),
                                 new AbortPolicyWithReport(threadName, url)
        );  // FIXME 没有地方释放connectionExecutor!
    queuewarninglimit = url.getParameter(Constants.CONNECT_QUEUE_WARNING_SIZE, Constants.DEFAULT_CONNECT_QUEUE_WARNING_SIZE);
}
 
开发者ID:linux-china,项目名称:dubbo3,代码行数:12,代码来源:ConnectionOrderedChannelHandler.java

示例8: getExecutor

import com.alibaba.dubbo.common.threadpool.support.AbortPolicyWithReport; //导入依赖的package包/类
public Executor getExecutor(URL url) {
    String name = url.getParameter(Constants.THREAD_NAME_KEY, Constants.DEFAULT_THREAD_NAME);
    int threads = url.getParameter(Constants.THREADS_KEY, Constants.DEFAULT_THREADS);
    int queues = url.getParameter(Constants.QUEUES_KEY, Constants.DEFAULT_QUEUES);
    return new ThreadPoolExecutor(threads, threads, 0, TimeUnit.MILLISECONDS, 
    		queues == 0 ? new SynchronousQueue<>() :
    			(queues < 0 ? new LinkedBlockingQueue<>()
    					: new LinkedBlockingQueue<>(queues)),
    		new NamedThreadFactory(name, true), new AbortPolicyWithReport(name, url));
}
 
开发者ID:linux-china,项目名称:dubbo3,代码行数:11,代码来源:FixedThreadPool.java

示例9: getExecutor

import com.alibaba.dubbo.common.threadpool.support.AbortPolicyWithReport; //导入依赖的package包/类
public Executor getExecutor(URL url) {
    String name = url.getParameter(Constants.THREAD_NAME_KEY, Constants.DEFAULT_THREAD_NAME);
    int cores = url.getParameter(Constants.CORE_THREADS_KEY, Constants.DEFAULT_CORE_THREADS);
    int threads = url.getParameter(Constants.THREADS_KEY, Integer.MAX_VALUE);
    int queues = url.getParameter(Constants.QUEUES_KEY, Constants.DEFAULT_QUEUES);
    int alive = url.getParameter(Constants.ALIVE_KEY, Constants.DEFAULT_ALIVE);
    return new ThreadPoolExecutor(cores, threads, alive, TimeUnit.MILLISECONDS,
            queues == 0 ? new SynchronousQueue<>() :
                    (queues < 0 ? new LinkedBlockingQueue<>()
                            : new LinkedBlockingQueue<>(queues)),
            new NamedThreadFactory(name, true), new AbortPolicyWithReport(name, url));
}
 
开发者ID:linux-china,项目名称:dubbo3,代码行数:13,代码来源:CachedThreadPool.java

示例10: getExecutor

import com.alibaba.dubbo.common.threadpool.support.AbortPolicyWithReport; //导入依赖的package包/类
public Executor getExecutor(URL url) {
    String name = url.getParameter(Constants.THREAD_NAME_KEY, Constants.DEFAULT_THREAD_NAME);
    int cores = url.getParameter(Constants.CORE_THREADS_KEY, Constants.DEFAULT_CORE_THREADS);
    int threads = url.getParameter(Constants.THREADS_KEY, Constants.DEFAULT_THREADS);
    int queues = url.getParameter(Constants.QUEUES_KEY, Constants.DEFAULT_QUEUES);
    return new ThreadPoolExecutor(cores, threads, Long.MAX_VALUE, TimeUnit.MILLISECONDS, 
    		queues == 0 ? new SynchronousQueue<>() :
    			(queues < 0 ? new LinkedBlockingQueue<>()
    					: new LinkedBlockingQueue<>(queues)),
    		new NamedThreadFactory(name, true), new AbortPolicyWithReport(name, url));
}
 
开发者ID:linux-china,项目名称:dubbo3,代码行数:12,代码来源:LimitedThreadPool.java


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