1
1
/*
2
- * Copyright (c) 2016, 2021 , Oracle and/or its affiliates. All rights reserved.
2
+ * Copyright (c) 2016, 2023 , Oracle and/or its affiliates. All rights reserved.
3
3
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4
4
*
5
5
* This code is free software; you can redistribute it and/or modify it
44
44
import jdk .jfr .internal .PlatformRecorder ;
45
45
import jdk .jfr .internal .PlatformRecording ;
46
46
import jdk .jfr .internal .Repository ;
47
- import jdk .jfr .internal .Utils ;
47
+ import jdk .jfr .internal .SecuritySupport ;
48
+ import jdk .jfr .internal .util .Utils ;
48
49
import jdk .jfr .internal .periodic .PeriodicEvents ;
49
50
50
51
/**
@@ -164,7 +165,7 @@ public static void unregister(Class<? extends Event> eventClass) {
164
165
*/
165
166
public static FlightRecorder getFlightRecorder () throws IllegalStateException , SecurityException {
166
167
synchronized (PlatformRecorder .class ) {
167
- Utils .checkAccessFlightRecorder ();
168
+ SecuritySupport .checkAccessFlightRecorder ();
168
169
JVMSupport .ensureWithIllegalStateException ();
169
170
if (platformRecorder == null ) {
170
171
try {
@@ -222,7 +223,7 @@ public static void addPeriodicEvent(Class<? extends Event> eventClass, Runnable
222
223
}
223
224
224
225
Utils .ensureValidEventSubclass (eventClass );
225
- Utils .checkRegisterPermission ();
226
+ SecuritySupport .checkRegisterPermission ();
226
227
@ SuppressWarnings ("removal" )
227
228
AccessControlContext acc = AccessController .getContext ();
228
229
PeriodicEvents .addUserEvent (acc , eventClass , hook );
@@ -238,7 +239,7 @@ public static void addPeriodicEvent(Class<? extends Event> eventClass, Runnable
238
239
*/
239
240
public static boolean removePeriodicEvent (Runnable hook ) throws SecurityException {
240
241
Objects .requireNonNull (hook , "hook" );
241
- Utils .checkRegisterPermission ();
242
+ SecuritySupport .checkRegisterPermission ();
242
243
if (JVMSupport .isNotAvailable ()) {
243
244
return false ;
244
245
}
@@ -275,7 +276,7 @@ public List<EventType> getEventTypes() {
275
276
*/
276
277
public static void addListener (FlightRecorderListener changeListener ) {
277
278
Objects .requireNonNull (changeListener , "changeListener" );
278
- Utils .checkAccessFlightRecorder ();
279
+ SecuritySupport .checkAccessFlightRecorder ();
279
280
if (JVMSupport .isNotAvailable ()) {
280
281
return ;
281
282
}
@@ -299,7 +300,7 @@ public static void addListener(FlightRecorderListener changeListener) {
299
300
*/
300
301
public static boolean removeListener (FlightRecorderListener changeListener ) {
301
302
Objects .requireNonNull (changeListener , "changeListener" );
302
- Utils .checkAccessFlightRecorder ();
303
+ SecuritySupport .checkAccessFlightRecorder ();
303
304
if (JVMSupport .isNotAvailable ()) {
304
305
return false ;
305
306
}
0 commit comments