Class Recording
- java.lang.Object
-
- org.openjdk.jmc.flightrecorder.writer.api.Recording
-
- All Implemented Interfaces:
AutoCloseable
- Direct Known Subclasses:
RecordingImpl
public abstract class Recording extends Object implements AutoCloseable
-
-
Constructor Summary
Constructors Constructor Description Recording()
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description abstract void
close()
abstract Type
getType(String typeName)
Try retrieving a previously registered custom type.abstract Type
getType(Types.JDK type)
A convenience method to easily get to JDK registered custom types in type-safe manner.abstract Types
getTypes()
abstract Type
registerAnnotationType(String name)
Try registering a user annotation type.abstract Type
registerAnnotationType(String name, Consumer<TypeStructureBuilder> builderCallback)
Try registering a user annotation type.abstract Type
registerEventType(String name)
Try registering a user event type with no additional attributes.abstract Type
registerEventType(String name, Consumer<TypeStructureBuilder> builderCallback)
Try registering a user event type.abstract Type
registerType(String name, String supertype, Consumer<TypeStructureBuilder> builderCallback)
Try registering a custom type.abstract Type
registerType(String name, Consumer<TypeStructureBuilder> builderCallback)
Try registering a custom type.abstract RecordingImpl
rotateChunk()
abstract RecordingImpl
writeEvent(TypedValue event)
Write a custom event
-
-
-
Method Detail
-
rotateChunk
public abstract RecordingImpl rotateChunk()
-
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 namebuilderCallback
- 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 namebuilderCallback
- 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 namebuilderCallback
- 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 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
- 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
-
close
public abstract void close() throws IOException
- Specified by:
close
in interfaceAutoCloseable
- Throws:
IOException
-
-