src/jdk.jfr/share/classes/jdk/jfr/internal/consumer/RecordingInternals.java
branchJEP-349-branch
changeset 57360 5d043a159d5c
parent 52850 f527b24990d7
child 57971 aa7b1ea52413
equal deleted inserted replaced
57359:4cab5edc2950 57360:5d043a159d5c
     1 /*
     1 /*
     2  * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved.
     2  * Copyright (c) 2019, Oracle and/or its affiliates. All rights reserved.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     4  *
     4  *
     5  * This code is free software; you can redistribute it and/or modify it
     5  * This code is free software; you can redistribute it and/or modify it
     6  * under the terms of the GNU General Public License version 2 only, as
     6  * under the terms of the GNU General Public License version 2 only, as
     7  * published by the Free Software Foundation.  Oracle designates this
     7  * published by the Free Software Foundation.  Oracle designates this
    32 import jdk.jfr.consumer.RecordingFile;
    32 import jdk.jfr.consumer.RecordingFile;
    33 import jdk.jfr.internal.Type;
    33 import jdk.jfr.internal.Type;
    34 
    34 
    35 public abstract class RecordingInternals {
    35 public abstract class RecordingInternals {
    36 
    36 
       
    37     public static RecordingInternals instance() {
       
    38         if (INSTANCE == null) {
       
    39             // Force initialization
       
    40             try {
       
    41                 Class<?> c = RecordedObject.class;
       
    42                 Class.forName(c.getName(), true, c.getClassLoader());
       
    43             } catch (ClassNotFoundException e) {
       
    44                 new InternalError("shuld not happen");
       
    45             }
       
    46         }
       
    47         return INSTANCE;
       
    48     }
       
    49 
    37     public static RecordingInternals INSTANCE;
    50     public static RecordingInternals INSTANCE;
    38 
    51 
    39     public abstract boolean isLastEventInChunk(RecordingFile file);
    52     public abstract boolean isLastEventInChunk(RecordingFile file);
    40 
    53 
    41     public abstract Object getOffsetDataTime(RecordedObject event, String name);
    54     public abstract Object getOffsetDataTime(RecordedObject event, String name);
    42 
    55 
    43     public abstract List<Type> readTypes(RecordingFile file) throws IOException;
    56     public abstract List<Type> readTypes(RecordingFile file) throws IOException;
    44 
    57 
    45     public abstract void sort(List<RecordedEvent> events);
    58     public abstract void sort(List<RecordedEvent> events);
    46 
    59 
       
    60     public abstract Parser newStringParser();
    47 }
    61 }