Class RecordingImpl

  • All Implemented Interfaces:
    AutoCloseable

    public final class RecordingImpl
    extends Recording
    The main entry point to JFR recording functionality. Allows to define custom types and initiate chunks for writing user events.
    • Method Detail

      • registerEventType

        public TypeImpl registerEventType​(String name)
        Description copied from class: Recording
        Try registering a user event type with no additional attributes. If a same-named event already exists it will be returned.
        Specified by:
        registerEventType in class Recording
        Parameters:
        name - the event name
        Returns:
        a user event type of the given name
      • registerEventType

        public TypeImpl registerEventType​(String name,
                                          Consumer<TypeStructureBuilder> builderCallback)
        Description copied from class: Recording
        Try registering a user event type. If a same-named event already exists it will be returned.
        Specified by:
        registerEventType in class Recording
        Parameters:
        name - the event name
        builderCallback - will be called with the active TypeStructureBuilder when the event is newly registered
        Returns:
        a user event type of the given name
      • registerAnnotationType

        public TypeImpl registerAnnotationType​(String name)
        Description copied from class: Recording
        Try registering a user annotation type. If a same-named annotation already exists it will be returned.
        Specified by:
        registerAnnotationType in class Recording
        Parameters:
        name - the annotation name
        Returns:
        a user annotation type of the given name
      • registerAnnotationType

        public TypeImpl registerAnnotationType​(String name,
                                               Consumer<TypeStructureBuilder> builderCallback)
        Description copied from class: Recording
        Try registering a user annotation type. If a same-named annotation already exists it will be returned.
        Specified by:
        registerAnnotationType in class Recording
        Parameters:
        name - the annotation name
        builderCallback - will be called with the active TypeStructureBuilder when the annotation is newly registered
        Returns:
        a user annotation type of the given name
      • registerType

        public TypeImpl registerType​(String name,
                                     Consumer<TypeStructureBuilder> builderCallback)
        Description copied from class: Recording
        Try registering a custom type. If a same-named type already exists it will be returned.
        Specified by:
        registerType in class Recording
        Parameters:
        name - the type name
        builderCallback - will be called with the active TypeStructureBuilder when the type is newly registered
        Returns:
        a custom type of the given name
      • registerType

        public TypeImpl registerType​(String name,
                                     String supertype,
                                     Consumer<TypeStructureBuilder> builderCallback)
        Description copied from class: Recording
        Try registering a custom type. If a same-named type already exists it will be returned.
        Specified by:
        registerType in class Recording
        Parameters:
        name - the type name
        supertype - the super type name
        builderCallback - will be called with the active TypeStructureBuilder when the type is newly registered
        Returns:
        a custom type of the given name
      • getType

        public TypeImpl getType​(Types.JDK type)
        Description copied from class: Recording
        A convenience method to easily get to JDK registered custom types in type-safe manner.
        Specified by:
        getType in class Recording
        Parameters:
        type - the type
        Returns:
        the previously registered JDK type
      • getType

        public TypeImpl getType​(String typeName)
        Description copied from class: Recording
        Try retrieving a previously registered custom type.
        Specified by:
        getType in class Recording
        Parameters:
        typeName - the type name
        Returns:
        the previously registered custom type