當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。