src/jdk.jfr/share/classes/jdk/jfr/consumer/EventDirectoryStream.java
branchJEP-349-branch
changeset 57373 400db63e4937
parent 57372 50ca040843ea
child 57376 8e8a06a3059c
equal deleted inserted replaced
57372:50ca040843ea 57373:400db63e4937
    34 
    34 
    35 import jdk.jfr.internal.consumer.EventConsumer;
    35 import jdk.jfr.internal.consumer.EventConsumer;
    36 
    36 
    37 final class EventDirectoryStream implements EventStream {
    37 final class EventDirectoryStream implements EventStream {
    38 
    38 
    39     private static class EventRunner extends EventConsumer {
    39     private static class EventSetConsumer extends EventConsumer {
    40         private EventSetLocation location;
    40         private EventSetLocation location;
    41         private EventSet eventSet;
    41         private EventSet eventSet;
    42         private int eventSetIndex;
    42         private int eventSetIndex;
    43         private int eventArrayIndex;
    43         private int eventArrayIndex;
    44         private RecordedEvent[] currentEventArray = new RecordedEvent[0];
    44         private RecordedEvent[] currentEventArray = new RecordedEvent[0];
    45 
    45 
    46         public EventRunner(AccessControlContext acc) throws IOException {
    46         public EventSetConsumer(AccessControlContext acc) throws IOException {
    47             super(acc);
    47             super(acc);
    48         }
    48         }
    49 
    49 
    50         public void process() throws Exception, IOException {
    50         public void process() throws Exception, IOException {
    51             this.location = EventSetLocation.current();
    51             this.location = EventSetLocation.current();
   102             }
   102             }
   103             runCloseActions();
   103             runCloseActions();
   104         }
   104         }
   105     }
   105     }
   106 
   106 
   107     private final EventRunner eventConsumer;
   107     private final EventSetConsumer eventConsumer;
   108 
   108 
   109     public EventDirectoryStream(AccessControlContext acc) throws IOException {
   109     public EventDirectoryStream(AccessControlContext acc) throws IOException {
   110         eventConsumer = new EventRunner(acc);
   110         eventConsumer = new EventSetConsumer(acc);
   111     }
   111     }
   112 
   112 
   113     public void close() {
   113     public void close() {
   114         eventConsumer.close();
   114         eventConsumer.close();
   115     }
   115     }