src/jdk.jfr/share/classes/jdk/jfr/internal/management/ManagementSupport.java
changeset 55256 3b22c7e00573
parent 50113 caf115bb98ad
child 58480 8ca46e186a63
equal deleted inserted replaced
55255:d49b72808414 55256:3b22c7e00573
    29 import java.util.ArrayList;
    29 import java.util.ArrayList;
    30 import java.util.Collections;
    30 import java.util.Collections;
    31 import java.util.List;
    31 import java.util.List;
    32 
    32 
    33 import jdk.jfr.EventType;
    33 import jdk.jfr.EventType;
       
    34 import jdk.jfr.Recording;
    34 import jdk.jfr.internal.JVMSupport;
    35 import jdk.jfr.internal.JVMSupport;
    35 import jdk.jfr.internal.LogLevel;
    36 import jdk.jfr.internal.LogLevel;
    36 import jdk.jfr.internal.LogTag;
    37 import jdk.jfr.internal.LogTag;
    37 import jdk.jfr.internal.Logger;
    38 import jdk.jfr.internal.Logger;
    38 import jdk.jfr.internal.MetadataRepository;
    39 import jdk.jfr.internal.MetadataRepository;
       
    40 import jdk.jfr.internal.PlatformRecording;
       
    41 import jdk.jfr.internal.PrivateAccess;
    39 import jdk.jfr.internal.Utils;
    42 import jdk.jfr.internal.Utils;
       
    43 import jdk.jfr.internal.WriteableUserPath;
    40 import jdk.jfr.internal.instrument.JDKEvents;
    44 import jdk.jfr.internal.instrument.JDKEvents;
    41 
    45 
    42 /**
    46 /**
    43  * The management API in module jdk.management.jfr should be built on top of the
    47  * The management API in module jdk.management.jfr should be built on top of the
    44  * public API in jdk.jfr. Before putting more functionality here, consider if it
    48  * public API in jdk.jfr. Before putting more functionality here, consider if it
    84 
    88 
    85     // Reuse internal logging mechanism
    89     // Reuse internal logging mechanism
    86     public static void logError(String message) {
    90     public static void logError(String message) {
    87         Logger.log(LogTag.JFR, LogLevel.ERROR, message);
    91         Logger.log(LogTag.JFR, LogLevel.ERROR, message);
    88     }
    92     }
       
    93 
       
    94     // Get the textual representation when the destination was set, which
       
    95     // requires access to jdk.jfr.internal.PlatformRecording
       
    96     public static String getDestinationOriginalText(Recording recording) {
       
    97         PlatformRecording pr = PrivateAccess.getInstance().getPlatformRecording(recording);
       
    98         WriteableUserPath wup = pr.getDestination();
       
    99         return wup == null ? null : wup.getOriginalText();
       
   100     }
    89 }
   101 }