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

📄 iohandlerchain.html

📁 MINA+API 关于MINA的API
💻 HTML
📖 第 1 页 / 共 3 页
字号:
<a name="231" href="#231">231</a>         <strong class="jxr_keyword">while</strong> (e != tail) {<a name="232" href="#232">232</a>             <strong class="jxr_keyword">if</strong> (e.getCommand() == command) {<a name="233" href="#233">233</a>                 <strong class="jxr_keyword">return</strong> <strong class="jxr_keyword">true</strong>;<a name="234" href="#234">234</a>             }<a name="235" href="#235">235</a>             e = e.nextEntry;<a name="236" href="#236">236</a>         }<a name="237" href="#237">237</a>         <strong class="jxr_keyword">return</strong> false;<a name="238" href="#238">238</a>     }<a name="239" href="#239">239</a> <a name="240" href="#240">240</a>     <strong class="jxr_keyword">public</strong> <strong class="jxr_keyword">boolean</strong> contains(Class&lt;? <strong class="jxr_keyword">extends</strong> IoHandlerCommand&gt; commandType) {<a name="241" href="#241">241</a>         <a href="../../../../../org/apache/mina/common/IoFilterChain.html">Entry</a> e = head.nextEntry;<a name="242" href="#242">242</a>         <strong class="jxr_keyword">while</strong> (e != tail) {<a name="243" href="#243">243</a>             <strong class="jxr_keyword">if</strong> (commandType.isAssignableFrom(e.getCommand().getClass())) {<a name="244" href="#244">244</a>                 <strong class="jxr_keyword">return</strong> <strong class="jxr_keyword">true</strong>;<a name="245" href="#245">245</a>             }<a name="246" href="#246">246</a>             e = e.nextEntry;<a name="247" href="#247">247</a>         }<a name="248" href="#248">248</a>         <strong class="jxr_keyword">return</strong> false;<a name="249" href="#249">249</a>     }<a name="250" href="#250">250</a> <a name="251" href="#251">251</a>     @Override<a name="252" href="#252">252</a>     <strong class="jxr_keyword">public</strong> String toString() {<a name="253" href="#253">253</a>         StringBuffer buf = <strong class="jxr_keyword">new</strong> StringBuffer();<a name="254" href="#254">254</a>         buf.append(<span class="jxr_string">"{ "</span>);<a name="255" href="#255">255</a> <a name="256" href="#256">256</a>         <strong class="jxr_keyword">boolean</strong> empty = <strong class="jxr_keyword">true</strong>;<a name="257" href="#257">257</a> <a name="258" href="#258">258</a>         <a href="../../../../../org/apache/mina/common/IoFilterChain.html">Entry</a> e = head.nextEntry;<a name="259" href="#259">259</a>         <strong class="jxr_keyword">while</strong> (e != tail) {<a name="260" href="#260">260</a>             <strong class="jxr_keyword">if</strong> (!empty) {<a name="261" href="#261">261</a>                 buf.append(<span class="jxr_string">", "</span>);<a name="262" href="#262">262</a>             } <strong class="jxr_keyword">else</strong> {<a name="263" href="#263">263</a>                 empty = false;<a name="264" href="#264">264</a>             }<a name="265" href="#265">265</a> <a name="266" href="#266">266</a>             buf.append('(');<a name="267" href="#267">267</a>             buf.append(e.getName());<a name="268" href="#268">268</a>             buf.append(':');<a name="269" href="#269">269</a>             buf.append(e.getCommand());<a name="270" href="#270">270</a>             buf.append(')');<a name="271" href="#271">271</a> <a name="272" href="#272">272</a>             e = e.nextEntry;<a name="273" href="#273">273</a>         }<a name="274" href="#274">274</a> <a name="275" href="#275">275</a>         <strong class="jxr_keyword">if</strong> (empty) {<a name="276" href="#276">276</a>             buf.append(<span class="jxr_string">"empty"</span>);<a name="277" href="#277">277</a>         }<a name="278" href="#278">278</a> <a name="279" href="#279">279</a>         buf.append(<span class="jxr_string">" }"</span>);<a name="280" href="#280">280</a> <a name="281" href="#281">281</a>         <strong class="jxr_keyword">return</strong> buf.toString();<a name="282" href="#282">282</a>     }<a name="283" href="#283">283</a> <a name="284" href="#284">284</a>     <em class="jxr_javadoccomment">/**</em><a name="285" href="#285">285</a> <em class="jxr_javadoccomment">     * Represents a name-command pair that an {@link IoHandlerChain} contains.</em><a name="286" href="#286">286</a> <em class="jxr_javadoccomment">     *</em><a name="287" href="#287">287</a> <em class="jxr_javadoccomment">     * @author The Apache MINA Project (dev@mina.apache.org)</em><a name="288" href="#288">288</a> <em class="jxr_javadoccomment">     * @version $Rev: 576217 $, $Date: 2007-09-16 17:55:27 -0600 (Sun, 16 Sep 2007) $</em><a name="289" href="#289">289</a> <em class="jxr_javadoccomment">     */</em><a name="290" href="#290">290</a>     <strong class="jxr_keyword">public</strong> <strong class="jxr_keyword">class</strong> <a href="../../../../../org/apache/mina/common/IoFilterChain.html">Entry</a> {<a name="291" href="#291">291</a>         <strong class="jxr_keyword">private</strong> <a href="../../../../../org/apache/mina/common/IoFilterChain.html">Entry</a> prevEntry;<a name="292" href="#292">292</a> <a name="293" href="#293">293</a>         <strong class="jxr_keyword">private</strong> <a href="../../../../../org/apache/mina/common/IoFilterChain.html">Entry</a> nextEntry;<a name="294" href="#294">294</a> <a name="295" href="#295">295</a>         <strong class="jxr_keyword">private</strong> <strong class="jxr_keyword">final</strong> String name;<a name="296" href="#296">296</a> <a name="297" href="#297">297</a>         <strong class="jxr_keyword">private</strong> <strong class="jxr_keyword">final</strong> <a href="../../../../../org/apache/mina/handler/chain/IoHandlerCommand.html">IoHandlerCommand</a> command;<a name="298" href="#298">298</a> <a name="299" href="#299">299</a>         <strong class="jxr_keyword">private</strong> <strong class="jxr_keyword">final</strong> <a href="../../../../../org/apache/mina/handler/chain/IoHandlerCommand.html">NextCommand</a> nextCommand;<a name="300" href="#300">300</a> <a name="301" href="#301">301</a>         <strong class="jxr_keyword">private</strong> <a href="../../../../../org/apache/mina/common/IoFilterChain.html">Entry</a>(<a href="../../../../../org/apache/mina/common/IoFilterChain.html">Entry</a> prevEntry, <a href="../../../../../org/apache/mina/common/IoFilterChain.html">Entry</a> nextEntry, String name,<a name="302" href="#302">302</a>                 <a href="../../../../../org/apache/mina/handler/chain/IoHandlerCommand.html">IoHandlerCommand</a> command) {<a name="303" href="#303">303</a>             <strong class="jxr_keyword">if</strong> (command == <strong class="jxr_keyword">null</strong>) {<a name="304" href="#304">304</a>                 <strong class="jxr_keyword">throw</strong> <strong class="jxr_keyword">new</strong> NullPointerException(<span class="jxr_string">"command"</span>);<a name="305" href="#305">305</a>             }<a name="306" href="#306">306</a>             <strong class="jxr_keyword">if</strong> (name == <strong class="jxr_keyword">null</strong>) {<a name="307" href="#307">307</a>                 <strong class="jxr_keyword">throw</strong> <strong class="jxr_keyword">new</strong> NullPointerException(<span class="jxr_string">"name"</span>);<a name="308" href="#308">308</a>             }<a name="309" href="#309">309</a> <a name="310" href="#310">310</a>             <strong class="jxr_keyword">this</strong>.prevEntry = prevEntry;<a name="311" href="#311">311</a>             <strong class="jxr_keyword">this</strong>.nextEntry = nextEntry;<a name="312" href="#312">312</a>             <strong class="jxr_keyword">this</strong>.name = name;<a name="313" href="#313">313</a>             <strong class="jxr_keyword">this</strong>.command = command;<a name="314" href="#314">314</a>             <strong class="jxr_keyword">this</strong>.nextCommand = <strong class="jxr_keyword">new</strong> <a href="../../../../../org/apache/mina/handler/chain/IoHandlerCommand.html">NextCommand</a>() {<a name="315" href="#315">315</a>                 <strong class="jxr_keyword">public</strong> <strong class="jxr_keyword">void</strong> execute(<a href="../../../../../org/apache/mina/common/IoSession.html">IoSession</a> session, Object message)<a name="316" href="#316">316</a>                         <strong class="jxr_keyword">throws</strong> Exception {<a name="317" href="#317">317</a>                     <a href="../../../../../org/apache/mina/common/IoFilterChain.html">Entry</a> nextEntry = Entry.<strong class="jxr_keyword">this</strong>.nextEntry;<a name="318" href="#318">318</a>                     callNextCommand(nextEntry, session, message);<a name="319" href="#319">319</a>                 }<a name="320" href="#320">320</a>             };<a name="321" href="#321">321</a>         }<a name="322" href="#322">322</a> <a name="323" href="#323">323</a>         <em class="jxr_javadoccomment">/**</em><a name="324" href="#324">324</a> <em class="jxr_javadoccomment">         * Returns the name of the command.</em><a name="325" href="#325">325</a> <em class="jxr_javadoccomment">         */</em><a name="326" href="#326">326</a>         <strong class="jxr_keyword">public</strong> String getName() {<a name="327" href="#327">327</a>             <strong class="jxr_keyword">return</strong> name;<a name="328" href="#328">328</a>         }<a name="329" href="#329">329</a> <a name="330" href="#330">330</a>         <em class="jxr_javadoccomment">/**</em><a name="331" href="#331">331</a> <em class="jxr_javadoccomment">         * Returns the command.</em><a name="332" href="#332">332</a> <em class="jxr_javadoccomment">         */</em><a name="333" href="#333">333</a>         <strong class="jxr_keyword">public</strong> <a href="../../../../../org/apache/mina/handler/chain/IoHandlerCommand.html">IoHandlerCommand</a> getCommand() {<a name="334" href="#334">334</a>             <strong class="jxr_keyword">return</strong> command;<a name="335" href="#335">335</a>         }<a name="336" href="#336">336</a> <a name="337" href="#337">337</a>         <em class="jxr_javadoccomment">/**</em><a name="338" href="#338">338</a> <em class="jxr_javadoccomment">         * Returns the {@link IoHandlerCommand.NextCommand} of the command.</em><a name="339" href="#339">339</a> <em class="jxr_javadoccomment">         */</em><a name="340" href="#340">340</a>         <strong class="jxr_keyword">public</strong> <a href="../../../../../org/apache/mina/handler/chain/IoHandlerCommand.html">NextCommand</a> getNextCommand() {<a name="341" href="#341">341</a>             <strong class="jxr_keyword">return</strong> nextCommand;<a name="342" href="#342">342</a>         }<a name="343" href="#343">343</a>     }<a name="344" href="#344">344</a> }</pre><hr/><div id="footer">This page was automatically generated by <a href="http://maven.apache.org/">Maven</a></div></body></html>

⌨️ 快捷键说明

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