APIdia Launch Partner
Top Description Fields Constructors Methods
jdk.internal.event

public Class SerializationMisdeclarationEvent

extends Event
Class Inheritance

A JFR event for serialization misdeclarations. This event is mirrored in jdk.jfr.events.SerializationMisdeclarationEvent where the metadata for the event is provided with annotations. Some of the methods are replaced by generated methods when jfr is enabled. Note that the order of the arguments of the commit(long, Class, String) method must be the same as the order of the fields.

Field Summary

Modifier and TypeField and Description
public String
public Class<?>

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public static void
commit(long
timestamp of the start of the operation
start
,
Class<?>
the affected class
misdeclaredClass
,
String
the specific event message
message
)

Commit a serialization misdeclaration event.

public static boolean

Returns:

whether serialization misdeclaration events are enabled
enabled
()

Determine if this kind of event is enabled.

public static boolean

Returns:

true if the event should be commited
shouldCommit
(long
time in nanoseconds to complete the operation
duration
)

Determine if an event should be emitted.

public static long

Returns:

the current timestamp value
timestamp
()

Fetch the current timestamp in nanoseconds.

Inherited from jdk.internal.event.Event:
begincommitendisEnabledsetshouldCommit

Field Detail

messageback to summary
public String message
misdeclaredClassback to summary
public Class<?> misdeclaredClass

Constructor Detail

SerializationMisdeclarationEventback to summary
public SerializationMisdeclarationEvent()

Method Detail

commitback to summary
public static void commit(long start, Class<?> misdeclaredClass, String message)

Commit a serialization misdeclaration event. The implementation of this method is generated automatically if jfr is enabled. The order of the fields must be the same as the parameters in this method. commit(long,Class,String)

Parameters
start:long

timestamp of the start of the operation

misdeclaredClass:Class<?>

the affected class

message:String

the specific event message

enabledback to summary
public static boolean enabled()

Determine if this kind of event is enabled. The implementation of this method is generated automatically if jfr is enabled.

Returns:boolean

whether serialization misdeclaration events are enabled

shouldCommitback to summary
public static boolean shouldCommit(long duration)

Determine if an event should be emitted. The duration of the operation must exceed some threshold in order to commit the event. The implementation of this method is generated automatically if jfr is enabled.

Parameters
duration:long

time in nanoseconds to complete the operation

Returns:boolean

true if the event should be commited

timestampback to summary
public static long timestamp()

Fetch the current timestamp in nanoseconds. This method is used to determine the start and end of an operation. The implementation of this method is generated automatically if jfr is enabled.

Returns:long

the current timestamp value