KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > sapia > ubik > net > nio > acceptor > ReadStateHandler


1 package org.sapia.ubik.net.nio.acceptor;
2
3 import java.io.IOException JavaDoc;
4
5 import org.sapia.ubik.net.nio.Cycle;
6 import org.sapia.ubik.net.nio.util.ReadHelper;
7
8 /**
9  * @author Yanick Duchesne
10  *
11  * <dl>
12  * <dt><b>Copyright: </b>
13  * <dd>Copyright &#169; 2002-2005 <a HREF="http://www.sapia-oss.org">Sapia Open
14  * Source Software </a>. All Rights Reserved.</dd>
15  * </dt>
16  * <dt><b>License: </b>
17  * <dd>Read the license.txt file of the jar or visit the <a
18  * HREF="http://www.sapia-oss.org/license.html">license page </a> at the Sapia
19  * OSS web site</dd>
20  * </dt>
21  * </dl>
22  */

23 class ReadStateHandler extends AbstractStateHandler {
24
25   private ReadHelper _helper = new ReadHelper();
26
27   ReadStateHandler(AcceptorConfig config) {
28     super(config);
29   }
30
31   /**
32    * @see org.sapia.ubik.net.nio.acceptor.StateHandler#handle(org.sapia.ubik.net.nio.Cycle)
33    */

34   public void handle(Cycle cycle) throws HandlerException {
35     if(_config.debug.on())
36       _config.debug.out(getClass(), "READ...");
37
38     try {
39       _config.dispatcher.dispatch(cycle);
40     } catch(IOException JavaDoc e) {
41       cycle.error(e);
42       cycle.next();
43     }
44   }
45
46 }
47
Popular Tags