⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 simpleioprocessorpool.html

📁 MINA+API 关于MINA的API
💻 HTML
📖 第 1 页 / 共 3 页
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"><!--NewPage--><HTML><HEAD><!-- Generated by javadoc (build 1.6.0_04) on Tue Feb 19 10:50:43 MST 2008 --><META http-equiv="Content-Type" content="text/html; charset=UTF-8"><TITLE>SimpleIoProcessorPool (Apache MINA 2.0.0-M1 API Documentation)</TITLE><META NAME="date" CONTENT="2008-02-19"><LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../stylesheet.css" TITLE="Style"><SCRIPT type="text/javascript">function windowTitle(){    if (location.href.indexOf('is-external=true') == -1) {        parent.document.title="SimpleIoProcessorPool (Apache MINA 2.0.0-M1 API Documentation)";    }}</SCRIPT><NOSCRIPT></NOSCRIPT></HEAD><BODY BGCOLOR="white" onload="windowTitle();"><HR><!-- ========= START OF TOP NAVBAR ======= --><A NAME="navbar_top"><!-- --></A><A HREF="#skip-navbar_top" title="Skip navigation links"></A><TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""><TR><TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"><A NAME="navbar_top_firstrow"><!-- --></A><TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">  <TR ALIGN="center" VALIGN="top">  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD>  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD>  <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD>  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="class-use/SimpleIoProcessorPool.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A>&nbsp;</TD>  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD>  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD>  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD>  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD>  </TR></TABLE></TD><TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM></EM></TD></TR><TR><TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">&nbsp;<A HREF="../../../../org/apache/mina/common/SimpleBufferAllocator.html" title="class in org.apache.mina.common"><B>PREV CLASS</B></A>&nbsp;&nbsp;<A HREF="../../../../org/apache/mina/common/TrafficMask.html" title="class in org.apache.mina.common"><B>NEXT CLASS</B></A></FONT></TD><TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">  <A HREF="../../../../index.html?org/apache/mina/common/SimpleIoProcessorPool.html" target="_top"><B>FRAMES</B></A>  &nbsp;&nbsp;<A HREF="SimpleIoProcessorPool.html" target="_top"><B>NO FRAMES</B></A>  &nbsp;&nbsp;<SCRIPT type="text/javascript">  <!--  if(window==top) {    document.writeln('<A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A>');  }  //--></SCRIPT><NOSCRIPT>  <A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A></NOSCRIPT></FONT></TD></TR><TR><TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">  SUMMARY:&nbsp;NESTED&nbsp;|&nbsp;FIELD&nbsp;|&nbsp;<A HREF="#constructor_summary">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD><TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">DETAIL:&nbsp;FIELD&nbsp;|&nbsp;<A HREF="#constructor_detail">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_detail">METHOD</A></FONT></TD></TR></TABLE><A NAME="skip-navbar_top"></A><!-- ========= END OF TOP NAVBAR ========= --><HR><!-- ======== START OF CLASS DATA ======== --><H2><FONT SIZE="-1">org.apache.mina.common</FONT><BR>Class SimpleIoProcessorPool&lt;T extends <A HREF="../../../../org/apache/mina/common/AbstractIoSession.html" title="class in org.apache.mina.common">AbstractIoSession</A>&gt;</H2><PRE><A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">java.lang.Object</A>  <IMG SRC="../../../../resources/inherit.gif" ALT="extended by "><B>org.apache.mina.common.SimpleIoProcessorPool&lt;T&gt;</B></PRE><DL><DT><DT><B>Type Parameters:</B><DD><CODE>T</CODE> - the type of the <A HREF="../../../../org/apache/mina/common/IoSession.html" title="interface in org.apache.mina.common"><CODE>IoSession</CODE></A> to be managed by the specified            <A HREF="../../../../org/apache/mina/common/IoProcessor.html" title="interface in org.apache.mina.common"><CODE>IoProcessor</CODE></A>.</DL><DL><DT><B>All Implemented Interfaces:</B> <DD><A HREF="../../../../org/apache/mina/common/IoProcessor.html" title="interface in org.apache.mina.common">IoProcessor</A>&lt;T&gt;</DD></DL><HR><DL><DT><PRE>public class <B>SimpleIoProcessorPool&lt;T extends <A HREF="../../../../org/apache/mina/common/AbstractIoSession.html" title="class in org.apache.mina.common">AbstractIoSession</A>&gt;</B><DT>extends <A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</A><DT>implements <A HREF="../../../../org/apache/mina/common/IoProcessor.html" title="interface in org.apache.mina.common">IoProcessor</A>&lt;T&gt;</DL></PRE><P>An <A HREF="../../../../org/apache/mina/common/IoProcessor.html" title="interface in org.apache.mina.common"><CODE>IoProcessor</CODE></A> pool that distributes <A HREF="../../../../org/apache/mina/common/IoSession.html" title="interface in org.apache.mina.common"><CODE>IoSession</CODE></A>s into one or more <A HREF="../../../../org/apache/mina/common/IoProcessor.html" title="interface in org.apache.mina.common"><CODE>IoProcessor</CODE></A>s. Most current transport implementations use this pool internally to perform better in a multi-core environment, and therefore, you won't need to  use this pool directly unless you are running multiple <A HREF="../../../../org/apache/mina/common/IoService.html" title="interface in org.apache.mina.common"><CODE>IoService</CODE></A>s in the same JVM. <p> If you are running multiple <A HREF="../../../../org/apache/mina/common/IoService.html" title="interface in org.apache.mina.common"><CODE>IoService</CODE></A>s, you could want to share the pool among all services.  To do so, you can create a new <A HREF="../../../../org/apache/mina/common/SimpleIoProcessorPool.html" title="class in org.apache.mina.common"><CODE>SimpleIoProcessorPool</CODE></A> instance by yourself and provide the pool as a constructor parameter when you create the services. <p> This pool uses Java reflection API to create multiple <A HREF="../../../../org/apache/mina/common/IoProcessor.html" title="interface in org.apache.mina.common"><CODE>IoProcessor</CODE></A> instances. It tries to instantiate the processor in the following order: <ol> <li>A public constructor with one <A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/util/concurrent/ExecutorService.html?is-external=true" title="class or interface in java.util.concurrent"><CODE>ExecutorService</CODE></A> parameter.</li> <li>A public constructor with one <A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/util/concurrent/Executor.html?is-external=true" title="class or interface in java.util.concurrent"><CODE>Executor</CODE></A> parameter.</li> <li>A public default constructor</li> </ol> The following is an example for the NIO socket transport: <pre><code> // Create a shared pool. SimpleIoProcessorPool&lt;NioSession&gt; pool =          new SimpleIoProcessorPool&lt;NioSession&gt;(NioProcessor.class, 16);  // Create two services that share the same pool. SocketAcceptor acceptor = new NioSocketAcceptor(pool); SocketConnector connector = new NioSocketConnector(pool);  ...  // Release related resources. connector.dispose(); acceptor.dispose(); pool.dispose(); </code></pre><P><P><DL><DT><B>Version:</B></DT>  <DD>$Rev: 609876 $, $Date: 2008-01-07 22:40:38 -0700 (Mon, 07 Jan 2008) $</DD><DT><B>Author:</B></DT>  <DD>The Apache MINA Project (dev@mina.apache.org)</DD></DL><HR><P><!-- ======== CONSTRUCTOR SUMMARY ======== --><A NAME="constructor_summary"><!-- --></A><TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""><TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"><TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"><B>Constructor Summary</B></FONT></TH></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD><CODE><B><A HREF="../../../../org/apache/mina/common/SimpleIoProcessorPool.html#SimpleIoProcessorPool(java.lang.Class)">SimpleIoProcessorPool</A></B>(<A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/Class.html?is-external=true" title="class or interface in java.lang">Class</A>&lt;? extends <A HREF="../../../../org/apache/mina/common/IoProcessor.html" title="interface in org.apache.mina.common">IoProcessor</A>&lt;<A HREF="../../../../org/apache/mina/common/SimpleIoProcessorPool.html" title="type parameter in SimpleIoProcessorPool">T</A>&gt;&gt;&nbsp;processorType)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD><CODE><B><A HREF="../../../../org/apache/mina/common/SimpleIoProcessorPool.html#SimpleIoProcessorPool(java.lang.Class, java.util.concurrent.Executor)">SimpleIoProcessorPool</A></B>(<A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/Class.html?is-external=true" title="class or interface in java.lang">Class</A>&lt;? extends <A HREF="../../../../org/apache/mina/common/IoProcessor.html" title="interface in org.apache.mina.common">IoProcessor</A>&lt;<A HREF="../../../../org/apache/mina/common/SimpleIoProcessorPool.html" title="type parameter in SimpleIoProcessorPool">T</A>&gt;&gt;&nbsp;processorType,                      <A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/util/concurrent/Executor.html?is-external=true" title="class or interface in java.util.concurrent">Executor</A>&nbsp;executor)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -