📄 channel.html
字号:
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"><TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2"><B>Constructor Detail</B></FONT></TH></TR></TABLE><A NAME="Channel(java.lang.String, org.jivesoftware.openfire.ChannelHandler)"><!-- --></A><H3>Channel</H3><PRE>public <B>Channel</B>(<A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A> name, <A HREF="../../../org/jivesoftware/openfire/ChannelHandler.html" title="interface in org.jivesoftware.openfire">ChannelHandler</A><<A HREF="../../../org/jivesoftware/openfire/Channel.html" title="type parameter in Channel">T</A>> channelHandler)</PRE><DL><DD>Creates a new channel. The channel should be registered after it's created.<P><DL><DT><B>Parameters:</B><DD><CODE>name</CODE> - the name of the channel.<DD><CODE>channelHandler</CODE> - the handler for this channel.</DL></DL><!-- ============ METHOD DETAIL ========== --><A NAME="method_detail"><!-- --></A><TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""><TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"><TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2"><B>Method Detail</B></FONT></TH></TR></TABLE><A NAME="getName()"><!-- --></A><H3>getName</H3><PRE>public <A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A> <B>getName</B>()</PRE><DL><DD>Returns the name of the channel.<P><DD><DL><DT><B>Returns:</B><DD>the name of the channel.</DL></DD></DL><HR><A NAME="add(org.xmpp.packet.Packet)"><!-- --></A><A NAME="add(T)"><!-- --></A><H3>add</H3><PRE>public void <B>add</B>(<A HREF="../../../org/jivesoftware/openfire/Channel.html" title="type parameter in Channel">T</A> packet)</PRE><DL><DD>Enqueus a message to be handled by this channel. After the ChannelHandler is done processing the message, it will be sent to the next channel. Messages with a higher priority will be handled first.<P><DD><DL><DT><B>Parameters:</B><DD><CODE>packet</CODE> - an XMPP packet to add to the channel for processing.</DL></DD></DL><HR><A NAME="isRunning()"><!-- --></A><H3>isRunning</H3><PRE>public boolean <B>isRunning</B>()</PRE><DL><DD>Returns true if the channel is currently running. The channel can be started and stopped by calling the start() and stop() methods.<P><DD><DL><DT><B>Returns:</B><DD>true if the channel is running.</DL></DD></DL><HR><A NAME="start()"><!-- --></A><H3>start</H3><PRE>public void <B>start</B>()</PRE><DL><DD>Starts the channel, which means that worker threads will start processing messages from the queue. If the server isn't running, messages can still be enqueued.<P><DD><DL></DL></DD></DL><HR><A NAME="stop()"><!-- --></A><H3>stop</H3><PRE>public void <B>stop</B>()</PRE><DL><DD>Stops the channel, which means that worker threads will stop processing messages from the queue. If the server isn't running, messages can still be enqueued.<P><DD><DL></DL></DD></DL><HR><A NAME="getThreadCount()"><!-- --></A><H3>getThreadCount</H3><PRE>public int <B>getThreadCount</B>()</PRE><DL><DD>Returns the number of currently active worker threads in the channel. This value will always fall in between the min a max thread count.<P><DD><DL><DT><B>Returns:</B><DD>the current number of worker threads.</DL></DD></DL><HR><A NAME="getMinThreadCount()"><!-- --></A><H3>getMinThreadCount</H3><PRE>public int <B>getMinThreadCount</B>()</PRE><DL><DD>Returns the min number of threads the channel will use for processing messages. The channel will automatically de-allocate worker threads as the queue load shrinks, down to the defined minimum. This lets the channel consume fewer resources when load is low.<P><DD><DL><DT><B>Returns:</B><DD>the min number of threads that can be used by the channel.</DL></DD></DL><HR><A NAME="setMinThreadCount(int)"><!-- --></A><H3>setMinThreadCount</H3><PRE>public void <B>setMinThreadCount</B>(int minThreadCount)</PRE><DL><DD>Sets the min number of threads the channel will use for processing messages. The channel will automatically de-allocate worker threads as the queue load shrinks, down to the defined minimum. This lets the channel consume fewer resources when load is low.<P><DD><DL><DT><B>Parameters:</B><DD><CODE>minThreadCount</CODE> - the min number of threads that can be used by the channel.</DL></DD></DL><HR><A NAME="getMaxThreadCount()"><!-- --></A><H3>getMaxThreadCount</H3><PRE>public int <B>getMaxThreadCount</B>()</PRE><DL><DD>Returns the max number of threads the channel will use for processing messages. The channel will automatically allocate new worker threads as the queue load grows, up to the defined maximum. This lets the channel meet higher concurrency needs, but prevents too many threads from being allocated, which decreases overall system performance.<P><DD><DL><DT><B>Returns:</B><DD>the max number of threads that can be used by the channel.</DL></DD></DL><HR><A NAME="setMaxThreadCount(int)"><!-- --></A><H3>setMaxThreadCount</H3><PRE>public void <B>setMaxThreadCount</B>(int maxThreadCount)</PRE><DL><DD>Sets the max number of threads the channel will use for processing messages. The channel will automatically allocate new worker threads as the queue size grows, up to the defined maximum. This lets the channel meet higher concurrency needs, but prevents too many threads from being allocated, which decreases overall system performance.<P><DD><DL><DT><B>Parameters:</B><DD><CODE>maxThreadCount</CODE> - the max number of threads that can be used by the channel.</DL></DD></DL><HR><A NAME="getQueueSize()"><!-- --></A><H3>getQueueSize</H3><PRE>public int <B>getQueueSize</B>()</PRE><DL><DD>Returns the current number of ChannelMessage objects waiting to be processed by the channel.<P><DD><DL><DT><B>Returns:</B><DD>the current number of elements in the processing queue.</DL></DD></DL><!-- ========= END OF CLASS DATA ========= --><HR><!-- ======= START OF BOTTOM NAVBAR ====== --><A NAME="navbar_bottom"><!-- --></A><A HREF="#skip-navbar_bottom" 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_bottom_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> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD> <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD> </TR></TABLE></TD><TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM><b>Openfire 3.6.0a Javadoc</b></EM></TD></TR><TR><TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> PREV CLASS <A HREF="../../../org/jivesoftware/openfire/ChannelHandler.html" title="interface in org.jivesoftware.openfire"><B>NEXT CLASS</B></A></FONT></TD><TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../../index.html?org/jivesoftware/openfire/Channel.html" target="_top"><B>FRAMES</B></A> <A HREF="Channel.html" target="_top"><B>NO FRAMES</B></A> <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: NESTED | FIELD | <A HREF="#constructor_summary">CONSTR</A> | <A HREF="#method_summary">METHOD</A></FONT></TD><TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">DETAIL: FIELD | <A HREF="#constructor_detail">CONSTR</A> | <A HREF="#method_detail">METHOD</A></FONT></TD></TR></TABLE><A NAME="skip-navbar_bottom"></A><!-- ======== END OF BOTTOM NAVBAR ======= --><HR><i>Copyright © 2003-2008 Jive Software.</i></BODY></HTML>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -