jdk.jfr.internal.SecuritySupport.SecureRecorderListener Java Examples

The following examples show how to use jdk.jfr.internal.SecuritySupport.SecureRecorderListener. 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: PlatformRecorder.java    From dragonwell8_jdk with GNU General Public License v2.0 5 votes vote down vote up
public synchronized static void addListener(FlightRecorderListener changeListener) {
    AccessControlContext context = AccessController.getContext();
    SecureRecorderListener sl = new SecureRecorderListener(context, changeListener);
    boolean runInitialized;
    synchronized (PlatformRecorder.class) {
        runInitialized = FlightRecorder.isInitialized();
        changeListeners.add(sl);
    }
    if (runInitialized) {
        sl.recorderInitialized(FlightRecorder.getFlightRecorder());
    }
}
 
Example #2
Source File: PlatformRecorder.java    From dragonwell8_jdk with GNU General Public License v2.0 5 votes vote down vote up
public synchronized static boolean removeListener(FlightRecorderListener changeListener) {
    for (SecureRecorderListener s : new ArrayList<>(changeListeners)) {
        if (s.getChangeListener() == changeListener) {
            changeListeners.remove(s);
            return true;
        }
    }
    return false;
}
 
Example #3
Source File: PlatformRecorder.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
public synchronized static void addListener(FlightRecorderListener changeListener) {
    AccessControlContext context = AccessController.getContext();
    SecureRecorderListener sl = new SecureRecorderListener(context, changeListener);
    boolean runInitialized;
    synchronized (PlatformRecorder.class) {
        runInitialized = FlightRecorder.isInitialized();
        changeListeners.add(sl);
    }
    if (runInitialized) {
        sl.recorderInitialized(FlightRecorder.getFlightRecorder());
    }
}
 
Example #4
Source File: PlatformRecorder.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
public synchronized static boolean removeListener(FlightRecorderListener changeListener) {
    for (SecureRecorderListener s : new ArrayList<>(changeListeners)) {
        if (s.getChangeListener() == changeListener) {
            changeListeners.remove(s);
            return true;
        }
    }
    return false;
}
 
Example #5
Source File: PlatformRecorder.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
public synchronized static void addListener(FlightRecorderListener changeListener) {
    AccessControlContext context = AccessController.getContext();
    SecureRecorderListener sl = new SecureRecorderListener(context, changeListener);
    boolean runInitialized;
    synchronized (PlatformRecorder.class) {
        runInitialized = FlightRecorder.isInitialized();
        changeListeners.add(sl);
    }
    if (runInitialized) {
        sl.recorderInitialized(FlightRecorder.getFlightRecorder());
    }
}
 
Example #6
Source File: PlatformRecorder.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
public synchronized static boolean removeListener(FlightRecorderListener changeListener) {
    for (SecureRecorderListener s : new ArrayList<>(changeListeners)) {
        if (s.getChangeListener() == changeListener) {
            changeListeners.remove(s);
            return true;
        }
    }
    return false;
}