equal
deleted
inserted
replaced
40 import jdk.jfr.internal.consumer.EventFileStream; |
40 import jdk.jfr.internal.consumer.EventFileStream; |
41 import jdk.jfr.internal.consumer.FileAccess; |
41 import jdk.jfr.internal.consumer.FileAccess; |
42 |
42 |
43 /** |
43 /** |
44 * Represents a stream of events. |
44 * Represents a stream of events. |
|
45 * <p> |
|
46 * The EventStream interface is not to be implemented and future version may |
|
47 * prevent this completely. |
45 * <p> |
48 * <p> |
46 * A stream is a sequence of events and the way to interact with a stream is to |
49 * A stream is a sequence of events and the way to interact with a stream is to |
47 * register actions. |
50 * register actions. |
48 * <p> |
51 * <p> |
49 * To receive a notification when an event arrives, register an action using the |
52 * To receive a notification when an event arrives, register an action using the |
172 * during reading |
175 * during reading |
173 * |
176 * |
174 * @throws SecurityException if a security manager exists and its |
177 * @throws SecurityException if a security manager exists and its |
175 * {@code checkRead} method denies read access to the file |
178 * {@code checkRead} method denies read access to the file |
176 */ |
179 */ |
177 public static EventStream openFile(Path file) throws IOException { |
180 static EventStream openFile(Path file) throws IOException { |
178 return new EventFileStream(AccessController.getContext(), file); |
181 return new EventFileStream(AccessController.getContext(), file); |
179 } |
182 } |
180 |
183 |
181 /** |
184 /** |
182 * Registers an action to perform on all events in the stream. |
185 * Registers an action to perform on all events in the stream. |