KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > sapia > ubik > net > mplex > StreamSelector


1 package org.sapia.ubik.net.mplex;
2
3
4 /**
5  * This interface derfines the contract of a selector that defines, from a preview
6  * of a stream of data, if it can handle the entire stream or not. This interface is
7  * used by the <code>MultiplexServerSocket</code> to determine which socket connector
8  * will handle a new socket connection.
9  *
10  * @see MultiplexServerSocket
11  * @see HttpStreamSelector
12  * @see ObjectStreamSelector
13  * @see SimpleStreamSelector
14  * @author <a HREF="mailto:jc@sapia-oss.org">Jean-Cedric Desrochers</a>
15  * <dl>
16  * <dt><b>Copyright:</b><dd>Copyright &#169; 2002-2004 <a HREF="http://www.sapia-oss.org">
17  * Sapia Open Source Software</a>. All Rights Reserved.</dd></dt>
18  * <dt><b>License:</b><dd>Read the license.txt file of the jar or visit the
19  * <a HREF="http://www.sapia-oss.org/license.html" target="sapia-license">license page</a>
20  * at the Sapia OSS web site</dd></dt>
21  * </dl>
22  */

23 public interface StreamSelector {
24   /**
25    * Selects or not a stream by analyzing the header of the stream passed in.
26    *
27    * @param header The first bytes of the stream.
28    * @return True if the header is accepted by this selector, false otherwise.
29    */

30   public boolean selectStream(byte[] header);
31 }
32
Popular Tags