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


Java PoolExecutor类代码示例

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


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

示例1: createClient

import org.simpleframework.util.thread.PoolExecutor; //导入依赖的package包/类
public static Client createClient(InetSocketAddress address, String tag) throws Exception {
   PoolExecutor executor = new PoolExecutor(Runnable.class, 20);
   int port = address.getPort();
   Client client = new Client(executor, port, tag);

   client.start();
   return client;
}
 
开发者ID:blobrobotics,项目名称:bstation,代码行数:9,代码来源:StopTest.java

示例2: Pinger

import org.simpleframework.util.thread.PoolExecutor; //导入依赖的package包/类
public Pinger(int port, boolean socket, int count) throws Exception {
   this.executor = new PoolExecutor(Pinger.class, count);
   this.list = new Vector<String>(count);
   this.sockets = new Vector<java.net.Socket>(count);
   this.latch = new CountDownLatch(count);
   this.stop = new CountDownLatch(count + count);
   this.dumper = new ThreadDumper();
   this.port = port;
   this.socket = socket;
   this.count = count;
}
 
开发者ID:blobrobotics,项目名称:bstation,代码行数:12,代码来源:ConnectionTest.java

示例3: Client

import org.simpleframework.util.thread.PoolExecutor; //导入依赖的package包/类
public Client(PoolExecutor executor, int port, String tag) {
   this.task = new RequestTask(this, port, tag);
   this.executor = executor;
}
 
开发者ID:blobrobotics,项目名称:bstation,代码行数:5,代码来源:StopTest.java

示例4: ContainerSelector

import org.simpleframework.util.thread.PoolExecutor; //导入依赖的package包/类
/**
 * Constructor for the <code>ContainerSelector</code> object. This
 * is used to create a selector which will collect and dispatch
 * requests using two thread pools. The first is used to collect
 * the requests, the second is used to service those requests.
 * 
 * @param handler this is the container used to service requests
 * @param allocator this is used to allocate any buffers needed
 * @param count this is the number of threads per thread pool
 * @param select this is the number of selector threads to use
 */
public ContainerSelector(Container handler, Allocator allocator, int count, int select) throws IOException {
   this.executor = new PoolExecutor(Dispatcher.class, count); 
   this.collect = new PoolExecutor(Reader.class, count);
   this.reactor = new ExecutorReactor(collect, select);     
   this.allocator = allocator;
   this.handler = handler;
}
 
开发者ID:blobrobotics,项目名称:bstation,代码行数:19,代码来源:ContainerSelector.java

示例5: ContainerSelector

import org.simpleframework.util.thread.PoolExecutor; //导入依赖的package包/类
/**
 * Constructor for the <code>ContainerSelector</code> object. This is used
 * to create a selector which will collect and dispatch requests using two
 * thread pools. The first is used to collect the requests, the second is
 * used to service those requests.
 * 
 * @param handler
 *            this is the container used to service requests
 * @param allocator
 *            this is used to allocate any buffers needed
 * @param count
 *            this is the number of threads per thread pool
 * @param select
 *            this is the number of selector threads to use
 */
public ContainerSelector(Container handler, Allocator allocator, int count,
        int select) throws IOException {
    this.executor = new PoolExecutor(Dispatcher.class, count);
    this.collect = new PoolExecutor(Reader.class, count);
    this.reactor = new ExecutorReactor(this.collect, select);
    this.allocator = allocator;
    this.handler = handler;
}
 
开发者ID:TehSomeLuigi,项目名称:someluigis-peripherals,代码行数:24,代码来源:ContainerSelector.java

示例6: SecureNegotiator

import org.simpleframework.util.thread.PoolExecutor; //导入依赖的package包/类
/**
 * Constructor for the <code>SecureNegotiator</code> object. This is used to
 * create a negotiator that will perform SSL handshakes on provided
 * pipelines so that the data read from an written to the underlying
 * transport is complete and ready to use.
 * 
 * @param transporter
 *            this is used to process the transports
 * @param count
 *            this is the number of threads used by this
 */
public SecureNegotiator(Processor transporter, int count)
        throws IOException {
    this.executor = new PoolExecutor(Notifier.class, count);
    this.reactor = new ExecutorReactor(this.executor);
    this.transporter = transporter;
}
 
开发者ID:TehSomeLuigi,项目名称:someluigis-peripherals,代码行数:18,代码来源:SecureNegotiator.java

示例7: SecureNegotiator

import org.simpleframework.util.thread.PoolExecutor; //导入依赖的package包/类
/**
 * Constructor for the <code>SecureNegotiator</code> object. This
 * is used to create a negotiator that will perform SSL handshakes
 * on provided pipelines so that the data read from an written to
 * the underlying transport is complete and ready to use.
 * 
 * @param processor this is used to process the transports
 * @param count this is the number of threads used by this
 */
public SecureNegotiator(Processor processor, int count) throws IOException {          
  this.executor = new PoolExecutor(Notifier.class, count);          
  this.reactor = new ExecutorReactor(executor);            
  this.processor = processor;                  
}
 
开发者ID:blobrobotics,项目名称:bstation,代码行数:15,代码来源:SecureNegotiator.java


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