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

public abstract Class Event

extends Object
Class Inheritance
Known Direct Subclasses
jdk.internal.event.ExceptionStatisticsEvent, jdk.internal.event.ExceptionThrownEvent, jdk.internal.event.FileForceEvent, jdk.internal.event.FileReadEvent, jdk.internal.event.FileWriteEvent, jdk.internal.event.FinalFieldMutationEvent, jdk.internal.event.ProcessStartEvent, jdk.internal.event.SecurityPropertyModificationEvent, jdk.internal.event.SecurityProviderServiceEvent, jdk.internal.event.SerializationMisdeclarationEvent, jdk.internal.event.SocketReadEvent, jdk.internal.event.SocketWriteEvent, jdk.internal.event.ThreadSleepEvent, jdk.internal.event.TLSHandshakeEvent, jdk.internal.event.VirtualThreadEndEvent, jdk.internal.event.VirtualThreadStartEvent, jdk.internal.event.VirtualThreadSubmitFailedEvent, jdk.internal.event.X509CertificateEvent, jdk.internal.event.X509ValidationEvent, jdk.internal.event.DeserializationEvent, jdk.internal.event.ErrorThrownEvent

Base class for events, to be subclassed in order to define events and their fields.

Constructor Summary

AccessConstructor and Description
protected
Event()

Sole constructor, for invocation by subclass constructors, typically implicit.

Method Summary

Modifier and TypeMethod and Description
public void
begin()

Starts the timing of this event.

public void
commit()

Writes the field values, time stamp, and event duration.

public void
end()

Ends the timing of this event.

public boolean

Returns:

true if event is enabled, false otherwise
isEnabled
()

Returns true if the event is enabled, false otherwise

public void
set(int
the index of the field to set
index
,
Object
value to set, can be null
value
)

Sets a field value.

public boolean

Returns:

true if the event can be written, false otherwise
shouldCommit
()

Returns true if the event is enabled and if the duration is within the threshold for the event, false otherwise.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

Eventback to summary
protected Event()

Sole constructor, for invocation by subclass constructors, typically implicit.

Method Detail

beginback to summary
public void begin()

Starts the timing of this event.

commitback to summary
public void commit()

Writes the field values, time stamp, and event duration.

If the event starts with an invocation of the begin method, but does not end with an explicit invocation of the end method, then the event ends when the commit method is invoked.

endback to summary
public void end()

Ends the timing of this event. The end method must be invoked after the begin method.

isEnabledback to summary
public boolean isEnabled()

Returns true if the event is enabled, false otherwise

Returns:boolean

true if event is enabled, false otherwise

setback to summary
public void set(int index, Object value)

Sets a field value.

Parameters
index:int

the index of the field to set

value:Object

value to set, can be null

Exceptions
UnsupportedOperationException:
if functionality is not supported
IndexOutOfBoundsException:
if index is less than 0 or greater than or equal to the number of fields specified for the event
shouldCommitback to summary
public boolean shouldCommit()

Returns true if the event is enabled and if the duration is within the threshold for the event, false otherwise.

Returns:boolean

true if the event can be written, false otherwise