src/jdk.jfr/share/classes/jdk/jfr/internal/PlatformRecording.java
branchJEP-349-branch
changeset 58495 465ba4fefe62
parent 58168 945212abbac0
parent 58480 8ca46e186a63
equal deleted inserted replaced
58485:f40923eeb559 58495:465ba4fefe62
   368         }
   368         }
   369     }
   369     }
   370 
   370 
   371     public void setDestination(WriteableUserPath userSuppliedPath) throws IOException {
   371     public void setDestination(WriteableUserPath userSuppliedPath) throws IOException {
   372         synchronized (recorder) {
   372         synchronized (recorder) {
       
   373             checkSetDestination(userSuppliedPath);
       
   374             this.destination = userSuppliedPath;
       
   375         }
       
   376     }
       
   377 
       
   378     public void checkSetDestination(WriteableUserPath userSuppliedPath) throws IOException {
       
   379         synchronized (recorder) {
   373             if (Utils.isState(getState(), RecordingState.STOPPED, RecordingState.CLOSED)) {
   380             if (Utils.isState(getState(), RecordingState.STOPPED, RecordingState.CLOSED)) {
   374                 throw new IllegalStateException("Destination can't be set on a recording that has been stopped/closed");
   381                 throw new IllegalStateException("Destination can't be set on a recording that has been stopped/closed");
   375             }
   382             }
   376             this.destination = userSuppliedPath;
       
   377         }
   383         }
   378     }
   384     }
   379 
   385 
   380     public WriteableUserPath getDestination() {
   386     public WriteableUserPath getDestination() {
   381         synchronized (recorder) {
   387         synchronized (recorder) {