KickJava   Java API By Example, From Geeks To Geeks.

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


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

22 class RecycleStateHandler extends AbstractStateHandler {
23
24   RecycleStateHandler(AcceptorConfig config) {
25     super(config);
26   }
27
28   /**
29    * @see org.sapia.ubik.net.nio.acceptor.StateHandler#handle(org.sapia.ubik.net.nio.Cycle)
30    */

31   public void handle(Cycle cycle) throws HandlerException {
32     ByteBuffer JavaDoc buf = cycle.getByteBuffer();
33     buf.clear();
34     cycle.getHandler().completed(cycle);
35     cycle.state(Cycle.STATE_READ);
36     cycle.releaseByteBuffer();
37     cycle.next();
38   }
39
40 }
41
Popular Tags