KickJava   Java API By Example, From Geeks To Geeks.

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


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.WriteHelper;
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 public class WriteStateHandler extends AbstractStateHandler {
24
25   private WriteHelper _helper = new WriteHelper();
26
27   public WriteStateHandler(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(), "WRITE...");
37     try {
38       _config.dispatcher.dispatch(cycle);
39     } catch(IOException JavaDoc e) {
40       cycle.error(e);
41       cycle.next();
42     }
43   }
44 }
45
Popular Tags