KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > sapia > ubik > net > nio > Dispatcher


1 package org.sapia.ubik.net.nio;
2
3 import java.io.IOException JavaDoc;
4
5 /**
6  * This interface specifies dispatching behavior: instances of this interface
7  * are expected to dispatch <code>Cycle</code> instances that should be
8  * handled according to their current state.
9  * <p>
10  * This interface has been introduced to allow handling of cycle states
11  * according to different strategies; it is indeed common for servers to handle
12  * requests according to the state in which the requests currently are. More
13  * precisely, in a given server implementation, one could choose that handle
14  * requests with different thread pools: a pool could be dedicated to read
15  * operations; another to processing operations; and another to write
16  * operations.
17  *
18  * @author Yanick Duchesne
19  *
20  * <dl>
21  * <dt><b>Copyright: </b>
22  * <dd>Copyright &#169; 2002-2005 <a HREF="http://www.sapia-oss.org">Sapia Open
23  * Source Software </a>. All Rights Reserved.</dd>
24  * </dt>
25  * <dt><b>License: </b>
26  * <dd>Read the license.txt file of the jar or visit the <a
27  * HREF="http://www.sapia-oss.org/license.html">license page </a> at the Sapia
28  * OSS web site</dd>
29  * </dt>
30  * </dl>
31  */

32 public interface Dispatcher {
33
34   /**
35    * This method dispatches the given event so that it can be handled properly.
36    *
37    * @param cycle
38    * a <code>Cycle</code> to dispatch.
39    * @throws IOException
40    * if this instance could not dispatch the cycle object.
41    */

42   public void dispatch(Cycle cycle) throws IOException JavaDoc;
43
44   /**
45    * Closes this instance.
46    */

47   public void close();
48
49 }
50
Popular Tags