01: /*
02: * Copyright (c) 2000 by Matt Welsh and The Regents of the University of
03: * California. All rights reserved.
04: *
05: * Permission to use, copy, modify, and distribute this software and its
06: * documentation for any purpose, without fee, and without written agreement is
07: * hereby granted, provided that the above copyright notice and the following
08: * two paragraphs appear in all copies of this software.
09: *
10: * IN NO EVENT SHALL THE UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY PARTY FOR
11: * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT
12: * OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF THE UNIVERSITY OF
13: * CALIFORNIA HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
14: *
15: * THE UNIVERSITY OF CALIFORNIA SPECIFICALLY DISCLAIMS ANY WARRANTIES,
16: * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
17: * AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS
18: * ON AN "AS IS" BASIS, AND THE UNIVERSITY OF CALIFORNIA HAS NO OBLIGATION TO
19: * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
20: *
21: * Author: Matt Welsh <mdw@cs.berkeley.edu>
22: *
23: */
24:
25: package seda.nbio;
26:
27: /**
28: * Selectable is an interface which represents an object (such as a socket
29: * or file descriptor) which may be used with the SelectItem and SelectSet
30: * classes. It defines no methods.
31: *
32: * The static final fields of this interface specify the event types that
33: * may be used with SelectItem and SelectSet.
34: */
35: public interface Selectable {
36:
37: /**
38: * Event mask specifying that data can be read without blocking.
39: */
40: public static final short READ_READY = (short) 0x01;
41:
42: /**
43: * Event mask specifying that data can be written without blocking.
44: */
45: public static final short WRITE_READY = (short) 0x02;
46:
47: /**
48: * Event mask specifying that a new incoming connection is pending.
49: */
50: public static final short ACCEPT_READY = READ_READY;
51:
52: /**
53: * Event mask specifying that a pending outgoing connection has
54: * been established.
55: */
56: public static final short CONNECT_READY = WRITE_READY;
57:
58: /**
59: * Specifies that an error has occured on this SelectItem.
60: * Invoking the requested read, write, connect, etc. operation will
61: * throw the appropriate exception. Only valid for revents.
62: */
63: public static final short SELECT_ERROR = (short) 0x80;
64:
65: }
|