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 initiatechunks
for 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 void
close()
TypeImpl
getType(String typeName)
Try retrieving a previously registered custom type.TypeImpl
getType(Types.JDK type)
A convenience method to easily get to JDK registered custom types in type-safe manner.TypesImpl
getTypes()
TypeImpl
registerAnnotationType(String name)
Try registering a user annotation type.TypeImpl
registerAnnotationType(String name, Consumer<TypeStructureBuilder> builderCallback)
Try registering a user annotation type.TypeImpl
registerEventType(String name)
Try registering a user event type with no additional attributes.TypeImpl
registerEventType(String name, Consumer<TypeStructureBuilder> builderCallback)
Try registering a user event type.TypeImpl
registerType(String name, String supertype, Consumer<TypeStructureBuilder> builderCallback)
Try registering a custom type.TypeImpl
registerType(String name, Consumer<TypeStructureBuilder> builderCallback)
Try registering a custom type.RecordingImpl
rotateChunk()
RecordingImpl
writeEvent(TypedValue event)
Write a custom event
-
-
-
Constructor Detail
-
RecordingImpl
public RecordingImpl(OutputStream output, RecordingSettings settings)
-
-
Method Detail
-
rotateChunk
public RecordingImpl rotateChunk()
- Specified by:
rotateChunk
in classRecording
-
close
public void close() throws IOException
- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in classRecording
- Throws:
IOException
-
writeEvent
public RecordingImpl writeEvent(TypedValue event)
Description copied from class:Recording
Write a custom event- Specified by:
writeEvent
in classRecording
- Parameters:
event
- the event value- Returns:
- this for chaining
-
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 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:Recording
Try registering a user event type. If a same-named event already exists it will be returned.- Specified by:
registerEventType
in 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:Recording
Try registering a user annotation type. If a same-named annotation already exists it will be returned.- Specified by:
registerAnnotationType
in 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:Recording
Try registering a user annotation type. If a same-named annotation already exists it will be returned.- Specified by:
registerAnnotationType
in 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:Recording
Try registering a custom type. If a same-named type already exists it will be returned.- Specified by:
registerType
in 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:Recording
Try registering a custom type. If a same-named type already exists it will be returned.- Specified by:
registerType
in 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:Recording
A convenience method to easily get to JDK registered custom types in type-safe manner.
-
getType
public TypeImpl getType(String typeName)
Description copied from class:Recording
Try retrieving a previously registered custom type.
-
-