author | egahlin |
Mon, 16 Sep 2019 15:12:10 +0200 | |
branch | JEP-349-branch |
changeset 58152 | ed7e71dd188b |
parent 58145 | bc54ed8d908a |
child 58180 | 0a8943b4d0dd |
permissions | -rw-r--r-- |
57361 | 1 |
/* |
2 |
* Copyright (c) 2019, Oracle and/or its affiliates. All rights reserved. |
|
3 |
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
|
4 |
* |
|
5 |
* This code is free software; you can redistribute it and/or modify it |
|
6 |
* under the terms of the GNU General Public License version 2 only, as |
|
7 |
* published by the Free Software Foundation. Oracle designates this |
|
8 |
* particular file as subject to the "Classpath" exception as provided |
|
9 |
* by Oracle in the LICENSE file that accompanied this code. |
|
10 |
* |
|
11 |
* This code is distributed in the hope that it will be useful, but WITHOUT |
|
12 |
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
|
13 |
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
|
14 |
* version 2 for more details (a copy is included in the LICENSE file that |
|
15 |
* accompanied this code). |
|
16 |
* |
|
17 |
* You should have received a copy of the GNU General Public License version |
|
18 |
* 2 along with this work; if not, write to the Free Software Foundation, |
|
19 |
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
|
20 |
* |
|
21 |
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
|
22 |
* or visit www.oracle.com if you need additional information or have any |
|
23 |
* questions. |
|
24 |
*/ |
|
25 |
||
26 |
package jdk.jfr.consumer; |
|
27 |
||
28 |
import java.io.IOException; |
|
29 |
import java.nio.file.Path; |
|
57690
9316d02dd4a5
Add EventStream::setEndTime(...) and a first stab at priviliged access to local repository
egahlin
parents:
57627
diff
changeset
|
30 |
import java.security.AccessControlContext; |
57434 | 31 |
import java.security.AccessController; |
57361 | 32 |
import java.time.Duration; |
57372
50ca040843ea
Prepare infrastructure for multiple implementations of EventStream
egahlin
parents:
57361
diff
changeset
|
33 |
import java.time.Instant; |
57690
9316d02dd4a5
Add EventStream::setEndTime(...) and a first stab at priviliged access to local repository
egahlin
parents:
57627
diff
changeset
|
34 |
import java.util.Objects; |
57361 | 35 |
import java.util.function.Consumer; |
36 |
||
57717
4ce66d271065
Security handling, but two tests fails with driver
egahlin
parents:
57690
diff
changeset
|
37 |
import jdk.jfr.internal.SecuritySupport; |
57690
9316d02dd4a5
Add EventStream::setEndTime(...) and a first stab at priviliged access to local repository
egahlin
parents:
57627
diff
changeset
|
38 |
import jdk.jfr.internal.Utils; |
58145
bc54ed8d908a
Move implementation into jdk.jfr.internal.consumer
egahlin
parents:
58129
diff
changeset
|
39 |
import jdk.jfr.internal.consumer.EventDirectoryStream; |
bc54ed8d908a
Move implementation into jdk.jfr.internal.consumer
egahlin
parents:
58129
diff
changeset
|
40 |
import jdk.jfr.internal.consumer.EventFileStream; |
57690
9316d02dd4a5
Add EventStream::setEndTime(...) and a first stab at priviliged access to local repository
egahlin
parents:
57627
diff
changeset
|
41 |
import jdk.jfr.internal.consumer.FileAccess; |
57627 | 42 |
|
57361 | 43 |
/** |
57690
9316d02dd4a5
Add EventStream::setEndTime(...) and a first stab at priviliged access to local repository
egahlin
parents:
57627
diff
changeset
|
44 |
* Represents a stream of events. |
58129 | 45 |
* <p> |
46 |
* A stream is a sequence of events and the way to interact with a stream is to |
|
47 |
* register actions. |
|
48 |
* <p> |
|
49 |
* To receive a notification when an event arrives, register an action using the |
|
50 |
* {@link #onEvent(Consumer)} method. To filter the stream for an event with a |
|
51 |
* specific name, use {@link #onEvent(String, Consumer)} method. |
|
52 |
* |
|
53 |
* By default, the same {@code RecordedEvent} object can be used for |
|
54 |
* representing two or more distinct events. The object can be delivered |
|
55 |
* multiple times to the same action as well as to other actions. If the life |
|
56 |
* cycle of the event object is needed outside the scope of an action, the |
|
57 |
* {@link #setReuse(boolean)} method should be set to {@code false} so that a |
|
58 |
* new object is allocated for each event. |
|
59 |
* |
|
60 |
* <p> |
|
61 |
* Events are delivered in batches. To receive a notification when a batch is |
|
62 |
* complete, register an action using the {@link #onFlush(Runnable)} method. |
|
63 |
* This is an opportunity to aggregate or push data to external systems while |
|
64 |
* the Java Virtual Machine (JVM) is preparing the next batch. |
|
65 |
* <p> |
|
66 |
* Events within a batch are sorted chronologically by their end time. If |
|
67 |
* ordering is not a concern, sorting can be disabled using the |
|
68 |
* {@link #setOrdered(boolean)} method. |
|
69 |
* <p> |
|
70 |
* To dispatch events to registered actions, the stream must be started. To |
|
71 |
* start processing in the current thread, invoke the {@link #start()} method. |
|
72 |
* To process actions asynchronously in a separate thread, invoke the |
|
73 |
* {@link #startAsync()} method. To await completion of the stream, use the |
|
74 |
* awaitTermination {@link #awaitTermination()} or the {link |
|
75 |
* {@link #awaitTermination(Duration)} method. |
|
76 |
* <p> |
|
77 |
* When a stream ends it is automatically closed. To manually stop processing of |
|
78 |
* events, close the stream with the {@link #close()} method. A stream can also |
|
79 |
* be automatically closed in exceptional circumstances, for instance if the JVM |
|
80 |
* exits. To receive a notification in any of these occasions, use the |
|
81 |
* {@link #onClose(Runnable)} method to register an action. |
|
82 |
* <p> |
|
83 |
* If an unexpected exception occurs in an action, it is possible to catch the |
|
84 |
* exception in an error handler. An error handler can be registered using the |
|
85 |
* {@link #onError(Runnable)} method. If no error handler is registered, the |
|
86 |
* default behavior is to print the exception and its backtrace to the standard |
|
87 |
* error stream. |
|
88 |
* <p> |
|
58152 | 89 |
* The following example shows how an {@code EventStream} can be used to |
90 |
* listen to events on a JVM running Flight Recorder |
|
91 |
* <pre> |
|
92 |
* <code> |
|
93 |
* try (EventStream es = EventStream.openRepository()) { |
|
94 |
* es.onEvent("jdk.CPULoad", event -> { |
|
95 |
* System.out.println("CPU Load " + event.getEndTime()); |
|
96 |
* System.out.println(" Machine total: " + 100 * event.getFloat("machineTotal") + "%"); |
|
97 |
* System.out.println(" JVM User: " + 100 * event.getFloat("jvmUser") + "%"); |
|
98 |
* System.out.println(" JVM System: " + 100 * event.getFloat("jvmSystem") + "%"); |
|
99 |
* System.out.println(); |
|
100 |
* System.gc(); |
|
101 |
* }); |
|
102 |
* es.onEvent("jdk.GarbageCollection", event -> { |
|
103 |
* System.out.println("Garbage collection: " + event.getLong("gcId")); |
|
104 |
* System.out.println(" Cause: " + event.getString("cause")); |
|
105 |
* System.out.println(" Total pause: " + event.getDuration("sumOfPauses")); |
|
106 |
* System.out.println(" Longest pause: " + event.getDuration("longestPause")); |
|
107 |
* System.out.println(); |
|
108 |
* }); |
|
109 |
* es.start(); |
|
110 |
* } |
|
111 |
* </code> |
|
112 |
* </pre> |
|
58129 | 113 |
* <p> |
58152 | 114 |
* To start recording together with the stream, see {@link RecordingStream}. |
58129 | 115 |
* |
57361 | 116 |
*/ |
117 |
public interface EventStream extends AutoCloseable { |
|
118 |
/** |
|
58129 | 119 |
* Creates a stream from the repository of the current Java Virtual Machine |
120 |
* (JVM). |
|
57627 | 121 |
* <p> |
122 |
* By default, the stream starts with the next event flushed by Flight |
|
123 |
* Recorder. |
|
124 |
* |
|
125 |
* @return an event stream, not {@code null} |
|
126 |
* |
|
127 |
* @throws IOException if a stream can't be opened, or an I/O error occurs |
|
128 |
* when trying to access the repository |
|
57690
9316d02dd4a5
Add EventStream::setEndTime(...) and a first stab at priviliged access to local repository
egahlin
parents:
57627
diff
changeset
|
129 |
* |
9316d02dd4a5
Add EventStream::setEndTime(...) and a first stab at priviliged access to local repository
egahlin
parents:
57627
diff
changeset
|
130 |
* @throws SecurityException if a security manager exists and the caller |
9316d02dd4a5
Add EventStream::setEndTime(...) and a first stab at priviliged access to local repository
egahlin
parents:
57627
diff
changeset
|
131 |
* does not have |
9316d02dd4a5
Add EventStream::setEndTime(...) and a first stab at priviliged access to local repository
egahlin
parents:
57627
diff
changeset
|
132 |
* {@code FlightRecorderPermission("accessFlightRecorder")} |
57627 | 133 |
*/ |
134 |
public static EventStream openRepository() throws IOException { |
|
57690
9316d02dd4a5
Add EventStream::setEndTime(...) and a first stab at priviliged access to local repository
egahlin
parents:
57627
diff
changeset
|
135 |
Utils.checkAccessFlightRecorder(); |
57717
4ce66d271065
Security handling, but two tests fails with driver
egahlin
parents:
57690
diff
changeset
|
136 |
return new EventDirectoryStream(AccessController.getContext(), null, SecuritySupport.PRIVILIGED, false); |
57627 | 137 |
} |
138 |
||
139 |
/** |
|
57690
9316d02dd4a5
Add EventStream::setEndTime(...) and a first stab at priviliged access to local repository
egahlin
parents:
57627
diff
changeset
|
140 |
* Creates an event stream from a disk repository. |
57449 | 141 |
* <p> |
57627 | 142 |
* By default, the stream starts with the next event flushed by Flight |
143 |
* Recorder. |
|
57361 | 144 |
* |
145 |
* @param directory location of the disk repository, not {@code null} |
|
57449 | 146 |
* |
57361 | 147 |
* @return an event stream, not {@code null} |
57449 | 148 |
* |
57690
9316d02dd4a5
Add EventStream::setEndTime(...) and a first stab at priviliged access to local repository
egahlin
parents:
57627
diff
changeset
|
149 |
* @throws IOException if a stream can't be opened, or an I/O error occurs |
57627 | 150 |
* when trying to access the repository |
57690
9316d02dd4a5
Add EventStream::setEndTime(...) and a first stab at priviliged access to local repository
egahlin
parents:
57627
diff
changeset
|
151 |
* |
9316d02dd4a5
Add EventStream::setEndTime(...) and a first stab at priviliged access to local repository
egahlin
parents:
57627
diff
changeset
|
152 |
* @throws SecurityException if a security manager exists and its |
9316d02dd4a5
Add EventStream::setEndTime(...) and a first stab at priviliged access to local repository
egahlin
parents:
57627
diff
changeset
|
153 |
* {@code checkRead} method denies read access to the directory, or |
9316d02dd4a5
Add EventStream::setEndTime(...) and a first stab at priviliged access to local repository
egahlin
parents:
57627
diff
changeset
|
154 |
* files in the directory. |
57361 | 155 |
*/ |
156 |
public static EventStream openRepository(Path directory) throws IOException { |
|
57690
9316d02dd4a5
Add EventStream::setEndTime(...) and a first stab at priviliged access to local repository
egahlin
parents:
57627
diff
changeset
|
157 |
Objects.nonNull(directory); |
9316d02dd4a5
Add EventStream::setEndTime(...) and a first stab at priviliged access to local repository
egahlin
parents:
57627
diff
changeset
|
158 |
AccessControlContext acc = AccessController.getContext(); |
9316d02dd4a5
Add EventStream::setEndTime(...) and a first stab at priviliged access to local repository
egahlin
parents:
57627
diff
changeset
|
159 |
return new EventDirectoryStream(acc, directory, FileAccess.UNPRIVILIGED, false); |
57361 | 160 |
} |
161 |
||
162 |
/** |
|
57449 | 163 |
* Creates an event stream from a file. |
164 |
* <p> |
|
57452
6fabe73e5d9a
Reduced allocation pressure. Fix getValue for startTime and duration
egahlin
parents:
57449
diff
changeset
|
165 |
* By default, the stream starts with the first event in the file. |
57361 | 166 |
* |
167 |
* @param file location of the file, not {@code null} |
|
57449 | 168 |
* |
57361 | 169 |
* @return an event stream, not {@code null} |
57372
50ca040843ea
Prepare infrastructure for multiple implementations of EventStream
egahlin
parents:
57361
diff
changeset
|
170 |
* |
58129 | 171 |
* @throws IOException if the file can't be opened, or an I/O error occurs |
57376 | 172 |
* during reading |
57690
9316d02dd4a5
Add EventStream::setEndTime(...) and a first stab at priviliged access to local repository
egahlin
parents:
57627
diff
changeset
|
173 |
* |
9316d02dd4a5
Add EventStream::setEndTime(...) and a first stab at priviliged access to local repository
egahlin
parents:
57627
diff
changeset
|
174 |
* @throws SecurityException if a security manager exists and its |
9316d02dd4a5
Add EventStream::setEndTime(...) and a first stab at priviliged access to local repository
egahlin
parents:
57627
diff
changeset
|
175 |
* {@code checkRead} method denies read access to the file |
57361 | 176 |
*/ |
177 |
public static EventStream openFile(Path file) throws IOException { |
|
57985 | 178 |
return new EventFileStream(AccessController.getContext(), file); |
57372
50ca040843ea
Prepare infrastructure for multiple implementations of EventStream
egahlin
parents:
57361
diff
changeset
|
179 |
} |
50ca040843ea
Prepare infrastructure for multiple implementations of EventStream
egahlin
parents:
57361
diff
changeset
|
180 |
|
50ca040843ea
Prepare infrastructure for multiple implementations of EventStream
egahlin
parents:
57361
diff
changeset
|
181 |
/** |
58129 | 182 |
* Registers an action to perform on all events in the stream. |
57361 | 183 |
* |
58129 | 184 |
* @param action an action to perform on each {@code RecordedEvent}, not |
185 |
* {@code null} |
|
57361 | 186 |
*/ |
187 |
void onEvent(Consumer<RecordedEvent> action); |
|
188 |
||
189 |
/** |
|
58129 | 190 |
* Registers an action to perform on all events matching a name. |
57361 | 191 |
* |
192 |
* @param eventName the name of the event, not {@code null} |
|
57449 | 193 |
* |
58129 | 194 |
* @param action an action to perform on each {@code RecordedEvent} matching |
195 |
* the event name, not {@code null} |
|
57361 | 196 |
*/ |
197 |
void onEvent(String eventName, Consumer<RecordedEvent> action); |
|
198 |
||
199 |
/** |
|
58129 | 200 |
* Registers an action to perform after the stream has been flushed. |
57361 | 201 |
* |
58129 | 202 |
* @param action an action to perform after the stream has been |
203 |
* flushed, not {@code null} |
|
57361 | 204 |
*/ |
205 |
void onFlush(Runnable action); |
|
206 |
||
207 |
/** |
|
58129 | 208 |
* Registers an action to perform if an exception occurs. |
57971 | 209 |
* <p> |
58129 | 210 |
* if an action is not registered, an exception stack trace is printed to |
211 |
* standard error. |
|
57971 | 212 |
* <p> |
58129 | 213 |
* Registering an action overrides the default behavior. If multiple actions |
214 |
* have been registered, they are performed in the order of registration. |
|
215 |
* <p> |
|
216 |
* If this method itself throws an exception, resulting behavior is |
|
217 |
* undefined. |
|
57971 | 218 |
* |
58129 | 219 |
* @param action an action to perform if an exception occurs, not |
57971 | 220 |
* {@code null} |
221 |
*/ |
|
222 |
void onError(Consumer<Throwable> action); |
|
223 |
||
224 |
/** |
|
58129 | 225 |
* Registers an action to perform when the stream is closed. |
57449 | 226 |
* <p> |
58129 | 227 |
* If the stream is already closed, the action will be performed immediately |
57449 | 228 |
* in the current thread. |
57361 | 229 |
* |
58129 | 230 |
* @param action an action to perform after the stream is closed, not |
231 |
* {@code null} |
|
232 |
* @see #close() |
|
57361 | 233 |
*/ |
234 |
void onClose(Runnable action); |
|
235 |
||
236 |
/** |
|
58129 | 237 |
* Releases all resources associated with this stream. |
57361 | 238 |
*/ |
239 |
void close(); |
|
240 |
||
241 |
/** |
|
58129 | 242 |
* Unregisters an action. |
57361 | 243 |
* <p> |
58129 | 244 |
* If the action has been registered multiple times, all instances are |
245 |
* unregistered. |
|
57361 | 246 |
* |
58129 | 247 |
* @param action the action to unregister, not {@code null} |
57449 | 248 |
* |
58129 | 249 |
* @return {@code true} if the action was unregistered, {@code false} |
250 |
* otherwise |
|
57361 | 251 |
* |
252 |
* @see #onEvent(Consumer) |
|
253 |
* @see #onEvent(String, Consumer) |
|
58020
f082177c5023
Improved handling of Thread.interrupt() + cleanup
egahlin
parents:
57985
diff
changeset
|
254 |
* @see #onFlush(Runnable) |
f082177c5023
Improved handling of Thread.interrupt() + cleanup
egahlin
parents:
57985
diff
changeset
|
255 |
* @see #onClose(Runnable) |
f082177c5023
Improved handling of Thread.interrupt() + cleanup
egahlin
parents:
57985
diff
changeset
|
256 |
* @see #onError(Consumer) |
57361 | 257 |
*/ |
258 |
boolean remove(Object action); |
|
259 |
||
260 |
/** |
|
57449 | 261 |
* Specifies that the event object in an {@link #onEvent(Consumer)} action |
58129 | 262 |
* can be reused. |
57376 | 263 |
* <p> |
58129 | 264 |
* If reuse is set to {@code true), an action should not keep a reference |
265 |
* to the event object after the action has completed. |
|
57380
6a7e7743b82f
setOrdered and setReuse implemented for file stream, incl. unit tests
egahlin
parents:
57377
diff
changeset
|
266 |
* |
58129 | 267 |
* @param reuse {@code true} if an event object can be reused, {@code false} |
268 |
* otherwise |
|
57376 | 269 |
*/ |
58129 | 270 |
void setReuse(boolean reuse); |
57376 | 271 |
|
272 |
/** |
|
57449 | 273 |
* Specifies that events arrives in chronological order, sorted by the time |
58129 | 274 |
* they were committed to the stream. |
57380
6a7e7743b82f
setOrdered and setReuse implemented for file stream, incl. unit tests
egahlin
parents:
57377
diff
changeset
|
275 |
* |
57449 | 276 |
* @param ordered if event objects arrive in chronological order to |
277 |
* {@code #onEvent(Consumer)} |
|
57380
6a7e7743b82f
setOrdered and setReuse implemented for file stream, incl. unit tests
egahlin
parents:
57377
diff
changeset
|
278 |
*/ |
58129 | 279 |
void setOrdered(boolean ordered); |
57380
6a7e7743b82f
setOrdered and setReuse implemented for file stream, incl. unit tests
egahlin
parents:
57377
diff
changeset
|
280 |
|
6a7e7743b82f
setOrdered and setReuse implemented for file stream, incl. unit tests
egahlin
parents:
57377
diff
changeset
|
281 |
/** |
58129 | 282 |
* Specifies the start time of the stream. |
57690
9316d02dd4a5
Add EventStream::setEndTime(...) and a first stab at priviliged access to local repository
egahlin
parents:
57627
diff
changeset
|
283 |
* <p> |
58129 | 284 |
* The start time must be set before starting the stream |
57449 | 285 |
* |
286 |
* @param startTime the start time, not {@code null} |
|
287 |
* |
|
58129 | 288 |
* @throws IllegalStateException if the stream is already started |
289 |
* |
|
290 |
* @see #start() |
|
291 |
* @see #startAsync() |
|
57449 | 292 |
*/ |
58129 | 293 |
void setStartTime(Instant startTime); |
57449 | 294 |
|
295 |
/** |
|
58129 | 296 |
* Specifies the end time of the stream. |
57690
9316d02dd4a5
Add EventStream::setEndTime(...) and a first stab at priviliged access to local repository
egahlin
parents:
57627
diff
changeset
|
297 |
* <p> |
58129 | 298 |
* The end time must be set before starting the stream. |
57690
9316d02dd4a5
Add EventStream::setEndTime(...) and a first stab at priviliged access to local repository
egahlin
parents:
57627
diff
changeset
|
299 |
* <p> |
58129 | 300 |
* At end time, the stream is closed. |
57690
9316d02dd4a5
Add EventStream::setEndTime(...) and a first stab at priviliged access to local repository
egahlin
parents:
57627
diff
changeset
|
301 |
* |
9316d02dd4a5
Add EventStream::setEndTime(...) and a first stab at priviliged access to local repository
egahlin
parents:
57627
diff
changeset
|
302 |
* @param endTime the end time, not {@code null} |
9316d02dd4a5
Add EventStream::setEndTime(...) and a first stab at priviliged access to local repository
egahlin
parents:
57627
diff
changeset
|
303 |
* |
58129 | 304 |
* @throws IllegalStateException if the stream is already started |
305 |
* |
|
306 |
* @see #start() |
|
307 |
* @see #startAsync() |
|
57690
9316d02dd4a5
Add EventStream::setEndTime(...) and a first stab at priviliged access to local repository
egahlin
parents:
57627
diff
changeset
|
308 |
*/ |
58129 | 309 |
void setEndTime(Instant endTime); |
57690
9316d02dd4a5
Add EventStream::setEndTime(...) and a first stab at priviliged access to local repository
egahlin
parents:
57627
diff
changeset
|
310 |
|
9316d02dd4a5
Add EventStream::setEndTime(...) and a first stab at priviliged access to local repository
egahlin
parents:
57627
diff
changeset
|
311 |
/** |
58129 | 312 |
* Start processing of actions. |
57361 | 313 |
* <p> |
58129 | 314 |
* Actions are performed in the current thread. |
57361 | 315 |
* |
58129 | 316 |
* @throws IllegalStateException if the stream is already started or closed |
57361 | 317 |
*/ |
318 |
void start(); |
|
319 |
||
320 |
/** |
|
58129 | 321 |
* Start asynchronous processing of actions. |
57361 | 322 |
* <p> |
58129 | 323 |
* Actions are performed in a single separate thread. |
57361 | 324 |
* |
58129 | 325 |
* @throws IllegalStateException if the stream is already started or closed |
57361 | 326 |
*/ |
327 |
void startAsync(); |
|
328 |
||
329 |
/** |
|
58129 | 330 |
* Blocks until all actions are completed, or the stream is closed, or the |
331 |
* timeout occurs, or the current thread is interrupted, whichever happens |
|
332 |
* first. |
|
57361 | 333 |
* |
334 |
* @param timeout the maximum time to wait, not {@code null} |
|
335 |
* |
|
58020
f082177c5023
Improved handling of Thread.interrupt() + cleanup
egahlin
parents:
57985
diff
changeset
|
336 |
* @throws IllegalArgumentException if timeout is negative |
58129 | 337 |
* @throws InterruptedException if interrupted while waiting |
58020
f082177c5023
Improved handling of Thread.interrupt() + cleanup
egahlin
parents:
57985
diff
changeset
|
338 |
* |
57361 | 339 |
* @see #start() |
340 |
* @see #startAsync() |
|
58129 | 341 |
* @see Thread#interrupt() |
57361 | 342 |
*/ |
58020
f082177c5023
Improved handling of Thread.interrupt() + cleanup
egahlin
parents:
57985
diff
changeset
|
343 |
void awaitTermination(Duration timeout) throws InterruptedException; |
57361 | 344 |
|
345 |
/** |
|
58129 | 346 |
* Blocks until all actions are completed, or the stream is closed, or the |
347 |
* current thread is interrupted, whichever happens first. |
|
57361 | 348 |
* |
58129 | 349 |
* @throws InterruptedException if interrupted while waiting |
58020
f082177c5023
Improved handling of Thread.interrupt() + cleanup
egahlin
parents:
57985
diff
changeset
|
350 |
* |
57361 | 351 |
* @see #start() |
352 |
* @see #startAsync() |
|
58129 | 353 |
* @see Thread#interrupt() |
57361 | 354 |
*/ |
58020
f082177c5023
Improved handling of Thread.interrupt() + cleanup
egahlin
parents:
57985
diff
changeset
|
355 |
void awaitTermination() throws InterruptedException; |
57361 | 356 |
} |