Java Code Examples for jdk.jfr.internal.PlatformRecorder#addListener()

The following examples show how to use jdk.jfr.internal.PlatformRecorder#addListener() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: FlightRecorder.java    From dragonwell8_jdk with GNU General Public License v2.0 3 votes vote down vote up
/**
 * Adds a recorder listener and captures the {@code AccessControlContext} to
 * use when invoking the listener.
 * <p>
 * If Flight Recorder is already initialized when the listener is added, the the method
 * {@link FlightRecorderListener#recorderInitialized(FlightRecorder)} method is
 * invoked before returning from this method.
 *
 * @param changeListener the listener to add, not {@code null}
 *
 * @throws SecurityException if a security manager exists and the caller
 *         does not have
 *         {@code FlightRecorderPermission("accessFlightRecorder")}
 */
public static void addListener(FlightRecorderListener changeListener) {
    Objects.requireNonNull(changeListener);
    Utils.checkAccessFlightRecorder();
    if (JVMSupport.isNotAvailable()) {
        return;
    }
    PlatformRecorder.addListener(changeListener);
}
 
Example 2
Source File: FlightRecorder.java    From TencentKona-8 with GNU General Public License v2.0 3 votes vote down vote up
/**
 * Adds a recorder listener and captures the {@code AccessControlContext} to
 * use when invoking the listener.
 * <p>
 * If Flight Recorder is already initialized when the listener is added, then the method
 * {@link FlightRecorderListener#recorderInitialized(FlightRecorder)} method is
 * invoked before returning from this method.
 *
 * @param changeListener the listener to add, not {@code null}
 *
 * @throws SecurityException if a security manager exists and the caller
 *         does not have
 *         {@code FlightRecorderPermission("accessFlightRecorder")}
 */
public static void addListener(FlightRecorderListener changeListener) {
    Objects.requireNonNull(changeListener);
    Utils.checkAccessFlightRecorder();
    if (JVMSupport.isNotAvailable()) {
        return;
    }
    PlatformRecorder.addListener(changeListener);
}
 
Example 3
Source File: FlightRecorder.java    From openjdk-jdk8u with GNU General Public License v2.0 3 votes vote down vote up
/**
 * Adds a recorder listener and captures the {@code AccessControlContext} to
 * use when invoking the listener.
 * <p>
 * If Flight Recorder is already initialized when the listener is added, then the method
 * {@link FlightRecorderListener#recorderInitialized(FlightRecorder)} method is
 * invoked before returning from this method.
 *
 * @param changeListener the listener to add, not {@code null}
 *
 * @throws SecurityException if a security manager exists and the caller
 *         does not have
 *         {@code FlightRecorderPermission("accessFlightRecorder")}
 */
public static void addListener(FlightRecorderListener changeListener) {
    Objects.requireNonNull(changeListener);
    Utils.checkAccessFlightRecorder();
    if (JVMSupport.isNotAvailable()) {
        return;
    }
    PlatformRecorder.addListener(changeListener);
}