Class RecordingImpl
- java.lang.Object
-
- org.openjdk.jmc.flightrecorder.writer.api.Recording
-
- org.openjdk.jmc.flightrecorder.writer.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 initiatechunksfor writing user events.
-
-
Constructor Summary
Constructors Constructor Description RecordingImpl(OutputStream output, RecordingSettings settings)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()TypeImplgetType(String typeName)Try retrieving a previously registered custom type.TypeImplgetType(Types.JDK type)A convenience method to easily get to JDK registered custom types in type-safe manner.TypesImplgetTypes()TypeImplregisterAnnotationType(String name)Try registering a user annotation type.TypeImplregisterAnnotationType(String name, Consumer<TypeStructureBuilder> builderCallback)Try registering a user annotation type.TypeImplregisterEventType(String name)Try registering a user event type with no additional attributes.TypeImplregisterEventType(String name, Consumer<TypeStructureBuilder> builderCallback)Try registering a user event type.TypeImplregisterType(String name, String supertype, Consumer<TypeStructureBuilder> builderCallback)Try registering a custom type.TypeImplregisterType(String name, Consumer<TypeStructureBuilder> builderCallback)Try registering a custom type.RecordingImplrotateChunk()RecordingImplwriteEvent(TypedValue event)Write a custom event
-
-
-
Constructor Detail
-
RecordingImpl
public RecordingImpl(OutputStream output, RecordingSettings settings)
-
-
Method Detail
-
rotateChunk
public RecordingImpl rotateChunk()
- Specified by:
rotateChunkin classRecording
-
close
public void close() throws IOException- Specified by:
closein interfaceAutoCloseable- Specified by:
closein classRecording- Throws:
IOException
-
writeEvent
public RecordingImpl writeEvent(TypedValue event)
Description copied from class:RecordingWrite a custom event- Specified by:
writeEventin classRecording- Parameters:
event- the event value- Returns:
- this for chaining
-
registerEventType
public TypeImpl registerEventType(String name)
Description copied from class:RecordingTry registering a user event type with no additional attributes. If a same-named event already exists it will be returned.- Specified by:
registerEventTypein classRecording- 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:RecordingTry registering a user event type. If a same-named event already exists it will be returned.- Specified by:
registerEventTypein classRecording- Parameters:
name- the event namebuilderCallback- 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:RecordingTry registering a user annotation type. If a same-named annotation already exists it will be returned.- Specified by:
registerAnnotationTypein classRecording- 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:RecordingTry registering a user annotation type. If a same-named annotation already exists it will be returned.- Specified by:
registerAnnotationTypein classRecording- Parameters:
name- the annotation namebuilderCallback- 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:RecordingTry registering a custom type. If a same-named type already exists it will be returned.- Specified by:
registerTypein classRecording- Parameters:
name- the type namebuilderCallback- 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:RecordingTry registering a custom type. If a same-named type already exists it will be returned.- Specified by:
registerTypein classRecording- Parameters:
name- the type namesupertype- the super type namebuilderCallback- 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:RecordingA convenience method to easily get to JDK registered custom types in type-safe manner.
-
getType
public TypeImpl getType(String typeName)
Description copied from class:RecordingTry retrieving a previously registered custom type.
-
-