Skip to content

Package: IOEvent

IOEvent

nameinstructionbranchcomplexitylinemethod
IOEvent(String, int, int)
M: 8 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 3 C: 0
0%
M: 1 C: 0
0%
getSelectionKeyInterest()
M: 3 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 1 C: 0
0%
M: 1 C: 0
0%
static {...}
M: 92 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 9 C: 0
0%
M: 1 C: 0
0%

Coverage

1: /*
2: * Copyright (c) 2008, 2020 Oracle and/or its affiliates. All rights reserved.
3: *
4: * This program and the accompanying materials are made available under the
5: * terms of the Eclipse Public License v. 2.0, which is available at
6: * http://www.eclipse.org/legal/epl-2.0.
7: *
8: * This Source Code may also be made available under the following Secondary
9: * Licenses when the conditions for such availability set forth in the
10: * Eclipse Public License v. 2.0 are satisfied: GNU General Public License,
11: * version 2 with the GNU Classpath Exception, which is available at
12: * https://www.gnu.org/software/classpath/license.html.
13: *
14: * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
15: */
16:
17: package org.glassfish.grizzly;
18:
19: import java.nio.channels.SelectionKey;
20:
21: /**
22: * Enumeration represents the I/O events, occurred on a {@link Connection}.
23: *
24: * @see Connection
25: *
26: * @author Alexey Stashok
27: */
28: public enum IOEvent {
29:
30: /**
31: * no event
32: */
33: NONE(0),
34:
35: /**
36: * Event occurs on a {@link Connection}, once it gets available for read.
37: */
38: READ(SelectionKey.OP_READ),
39:
40: /**
41: * Event occurs on a {@link Connection}, once it gets available for write.
42: */
43: WRITE(SelectionKey.OP_WRITE),
44:
45: /**
46: * Event occurs on a server {@link Connection}, when it becomes ready to accept new client {@link Connection}.
47: *
48: * Note, this event occurs on server code for server {@link Connection}.
49: */
50: SERVER_ACCEPT(SelectionKey.OP_ACCEPT),
51:
52: /**
53: * Event occurs on a client {@link Connection}, just after it was accepted by the server.
54: *
55: * Note, this event occurs on server code for client {@link Connection}.
56: */
57: ACCEPTED(0),
58:
59: /**
60: * Event occurs on a {@link Connection}, once it was connected to server.
61: *
62: * (this is service IOEvent, which is not getting propagated to a {@link Processor}
63: */
64: CLIENT_CONNECTED(SelectionKey.OP_CONNECT),
65:
66: /**
67: * Event occurs on a {@link Connection}, once it was connected to server.
68: */
69: CONNECTED(0),
70:
71: /**
72: * Event occurs on a {@link Connection}, once it gets closed.
73: */
74: CLOSED(0);
75:
76: private final int selectionKeyInterest;
77:
78: IOEvent(int selectionKeyInterest) {
79: this.selectionKeyInterest = selectionKeyInterest;
80: }
81:
82: public int getSelectionKeyInterest() {
83: return selectionKeyInterest;
84: }
85: }