Skip to content

Package: IOEventLifeCycleListener$Adapter

IOEventLifeCycleListener$Adapter

nameinstructionbranchcomplexitylinemethod
IOEventLifeCycleListener.Adapter()
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%
onComplete(Context, Object)
M: 1 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 1 C: 0
0%
M: 1 C: 0
0%
onContextManualIOEventControl(Context)
M: 1 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 1 C: 0
0%
M: 1 C: 0
0%
onContextResume(Context)
M: 1 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 1 C: 0
0%
M: 1 C: 0
0%
onContextSuspend(Context)
M: 1 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 1 C: 0
0%
M: 1 C: 0
0%
onError(Context, Object)
M: 1 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 1 C: 0
0%
M: 1 C: 0
0%
onLeave(Context)
M: 1 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 1 C: 0
0%
M: 1 C: 0
0%
onNotRun(Context)
M: 1 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 1 C: 0
0%
M: 1 C: 0
0%
onReregister(Context)
M: 1 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 1 C: 0
0%
M: 1 C: 0
0%
onRerun(Context, Context)
M: 1 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 1 C: 0
0%
M: 1 C: 0
0%
onTerminate(Context)
M: 1 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 1 C: 0
0%
M: 1 C: 0
0%

Coverage

1: /*
2: * Copyright (c) 2010, 2020 Oracle and/or its affiliates. All rights reserved.
3: * Copyright (c) 2018 Payara Services Ltd.
4: *
5: * This program and the accompanying materials are made available under the
6: * terms of the Eclipse Public License v. 2.0, which is available at
7: * http://www.eclipse.org/legal/epl-2.0.
8: *
9: * This Source Code may also be made available under the following Secondary
10: * Licenses when the conditions for such availability set forth in the
11: * Eclipse Public License v. 2.0 are satisfied: GNU General Public License,
12: * version 2 with the GNU Classpath Exception, which is available at
13: * https://www.gnu.org/software/classpath/license.html.
14: *
15: * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
16: */
17:
18: package org.glassfish.grizzly;
19:
20: import java.io.IOException;
21:
22: /**
23: * The {@link IOEvent} life-cycle listener, which will be notified about changes in {@link IOEvent} processing statuses.
24: *
25: * @author Alexey Stashok
26: */
27: public interface IOEventLifeCycleListener {
28: /**
29: * {@link IOEvent} processing suspended.
30: *
31: * @param context IO Context
32: * @throws IOException on error
33: */
34: void onContextSuspend(Context context) throws IOException;
35:
36: /**
37: * {@link IOEvent} processing resumed.
38: *
39: * @param context IO Context
40: * @throws IOException on error
41: */
42: void onContextResume(Context context) throws IOException;
43:
44: /**
45: * Processing switched to the manual IOEvent control. {@link Connection#enableIOEvent(org.glassfish.grizzly.IOEvent)} or
46: * {@link Connection#disableIOEvent(org.glassfish.grizzly.IOEvent)} might be explicitly called.
47: *
48: * @param context IO Context on error
49: */
50: void onContextManualIOEventControl(final Context context) throws IOException;
51:
52: /**
53: * Reregister {@link IOEvent} interest.
54: *
55: * @param context IO Context
56: * @throws IOException on error
57: */
58: void onReregister(Context context) throws IOException;
59:
60: /**
61: * {@link IOEvent} processing completed.
62: *
63: * @param context IO Context
64: * @param data data produced
65: * @throws IOException on error
66: */
67: void onComplete(Context context, Object data) throws IOException;
68:
69: /**
70: * Detaching {@link IOEvent} processing out of this {@link Context}.
71: *
72: * @param context IO Context
73: * @throws IOException on error
74: */
75: void onLeave(Context context) throws IOException;
76:
77: /**
78: * Terminate {@link IOEvent} processing in this thread, but it's going to be continued later.
79: *
80: * @param context IO Context
81: * @throws IOException on error
82: *
83: * @deprecated will never be invoked
84: */
85: @Deprecated
86: void onTerminate(Context context) throws IOException;
87:
88: /**
89: * Re-run {@link IOEvent} processing.
90: *
91: * @param context original {@link Context} to be rerun
92: * @param newContext new context, which will replace original {@link Context}
93: * @throws IOException on error
94: */
95: void onRerun(Context context, Context newContext) throws IOException;
96:
97: /**
98: * Error occurred during {@link IOEvent} processing.
99: *
100: * @param context IO Context
101: * @param description description of error. This may be ignored.
102: * @throws java.io.IOException on error
103: */
104: void onError(Context context, Object description) throws IOException;
105:
106: /**
107: * {@link IOEvent} wasn't processed.
108: *
109: * @param context IO Context on error
110: * @throws java.io.IOException on error
111: */
112: void onNotRun(Context context) throws IOException;
113:
114: /**
115: * Empty {@link IOEventLifeCycleListener} implementation.
116: */
117: class Adapter implements IOEventLifeCycleListener {
118:
119: /**
120: * {@inheritDoc}
121: */
122: @Override
123: public void onContextSuspend(Context context) throws IOException {
124: }
125:
126: /**
127: * {@inheritDoc}
128: */
129: @Override
130: public void onContextResume(Context context) throws IOException {
131: }
132:
133: /**
134: * {@inheritDoc}
135: */
136: @Override
137: public void onComplete(Context context, Object data) throws IOException {
138: }
139:
140: /**
141: * {@inheritDoc}
142: */
143: @Override
144: public void onTerminate(Context context) throws IOException {
145: }
146:
147: /**
148: * {@inheritDoc}
149: */
150: @Override
151: public void onError(Context context, Object description) throws IOException {
152: }
153:
154: /**
155: * {@inheritDoc}
156: */
157: @Override
158: public void onNotRun(Context context) throws IOException {
159: }
160:
161: /**
162: * {@inheritDoc}
163: */
164: @Override
165: public void onContextManualIOEventControl(Context context) throws IOException {
166: }
167:
168: /**
169: * {@inheritDoc}
170: */
171: @Override
172: public void onReregister(Context context) throws IOException {
173: }
174:
175: /**
176: * {@inheritDoc}
177: */
178: @Override
179: public void onLeave(Context context) throws IOException {
180: }
181:
182: /**
183: * {@inheritDoc}
184: */
185: @Override
186: public void onRerun(Context context, Context newContext) throws IOException {
187: }
188: }
189: }