Class Recording

    • Constructor Detail

      • Recording

        public Recording()
    • Method Detail

      • writeEvent

        public abstract RecordingImpl writeEvent​(TypedValue event)
        Write a custom event
        Parameters:
        event - the event value
        Returns:
        this for chaining
        Throws:
        IllegalArgumentException - if the event type has not got 'jdk.jfr.Event' as its super type
      • registerEventType

        public abstract Type registerEventType​(String name)
        Try registering a user event type with no additional attributes. If a same-named event already exists it will be returned.
        Parameters:
        name - the event name
        Returns:
        a user event type of the given name
      • registerEventType

        public abstract Type registerEventType​(String name,
                                               Consumer<TypeStructureBuilder> builderCallback)
        Try registering a user event type. If a same-named event already exists it will be returned.
        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
        Throws:
        IllegalArgumentException - if 'name' or 'builderCallback' is null
      • registerAnnotationType

        public abstract Type registerAnnotationType​(String name)
        Try registering a user annotation type. If a same-named annotation already exists it will be returned.
        Parameters:
        name - the annotation name
        Returns:
        a user annotation type of the given name
        Throws:
        IllegalArgumentException - if 'name' is null
      • registerAnnotationType

        public abstract Type registerAnnotationType​(String name,
                                                    Consumer<TypeStructureBuilder> builderCallback)
        Try registering a user annotation type. If a same-named annotation already exists it will be returned.
        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
        Throws:
        IllegalArgumentException - if 'name' or 'builderCallback' is null
      • registerType

        public abstract Type registerType​(String name,
                                          Consumer<TypeStructureBuilder> builderCallback)
        Try registering a custom type. If a same-named type already exists it will be returned.
        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
        Throws:
        IllegalArgumentException - if 'name' or 'builderCallback' is null
      • registerType

        public abstract Type registerType​(String name,
                                          String supertype,
                                          Consumer<TypeStructureBuilder> builderCallback)
        Try registering a custom type. If a same-named type already exists it will be returned.
        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
        Throws:
        IllegalArgumentException - if 'name' or 'builderCallback' is null
      • getType

        public abstract Type getType​(Types.JDK type)
        A convenience method to easily get to JDK registered custom types in type-safe manner.
        Parameters:
        type - the type
        Returns:
        the previously registered JDK type
        Throws:
        IllegalArgumentException - if 'type' is null or an attempt to retrieve non-registered JDK type is made
      • getType

        public abstract Type getType​(String typeName)
        Try retrieving a previously registered custom type.
        Parameters:
        typeName - the type name
        Returns:
        the previously registered custom type
        Throws:
        IllegalArgumentException - if 'typeName' is null or an attempt to retrieve non-registered custom type is made
      • getTypes

        public abstract Types getTypes()
        Returns:
        the associated Types instance