equal
deleted
inserted
replaced
77 public final static SafePath JFC_DIRECTORY = getPathInProperty("java.home", "lib/jfr"); |
77 public final static SafePath JFC_DIRECTORY = getPathInProperty("java.home", "lib/jfr"); |
78 |
78 |
79 static final SafePath USER_HOME = getPathInProperty("user.home", null); |
79 static final SafePath USER_HOME = getPathInProperty("user.home", null); |
80 static final SafePath JAVA_IO_TMPDIR = getPathInProperty("java.io.tmpdir", null); |
80 static final SafePath JAVA_IO_TMPDIR = getPathInProperty("java.io.tmpdir", null); |
81 |
81 |
|
82 static { |
|
83 // ensure module java.base can read module jdk.jfr as early as possible |
|
84 addReadEdge(Object.class); |
|
85 addHandlerExport(Object.class); |
|
86 addEventsExport(Object.class); |
|
87 addInstrumentExport(Object.class); |
|
88 } |
|
89 |
82 final static class SecureRecorderListener implements FlightRecorderListener { |
90 final static class SecureRecorderListener implements FlightRecorderListener { |
83 |
91 |
84 private final AccessControlContext context; |
92 private final AccessControlContext context; |
85 private final FlightRecorderListener changeListener; |
93 private final FlightRecorderListener changeListener; |
86 |
94 |
260 */ |
268 */ |
261 static void addHandlerExport(Class<?> clazz) { |
269 static void addHandlerExport(Class<?> clazz) { |
262 Modules.addExports(JFR_MODULE, Utils.HANDLERS_PACKAGE_NAME, clazz.getModule()); |
270 Modules.addExports(JFR_MODULE, Utils.HANDLERS_PACKAGE_NAME, clazz.getModule()); |
263 } |
271 } |
264 |
272 |
|
273 static void addEventsExport(Class<?> clazz) { |
|
274 Modules.addExports(JFR_MODULE, Utils.EVENTS_PACKAGE_NAME, clazz.getModule()); |
|
275 } |
|
276 |
|
277 static void addInstrumentExport(Class<?> clazz) { |
|
278 Modules.addExports(JFR_MODULE, Utils.INSTRUMENT_PACKAGE_NAME, clazz.getModule()); |
|
279 } |
|
280 |
|
281 static void addReadEdge(Class<?> clazz) { |
|
282 Modules.addReads(clazz.getModule(), JFR_MODULE); |
|
283 } |
|
284 |
265 public static void registerEvent(Class<? extends jdk.internal.event.Event> eventClass) { |
285 public static void registerEvent(Class<? extends jdk.internal.event.Event> eventClass) { |
266 doPrivileged(() -> MetadataRepository.getInstance().register(eventClass), new FlightRecorderPermission(Utils.REGISTER_EVENT)); |
286 doPrivileged(() -> MetadataRepository.getInstance().register(eventClass), new FlightRecorderPermission(Utils.REGISTER_EVENT)); |
267 } |
287 } |
268 |
288 |
269 public static void registerMirror(Class<? extends Event> eventClass) { |
289 public static void registerMirror(Class<? extends Event> eventClass) { |