Top Description Methods
jdk.jfr

public Interface FlightRecorderListener

Known Direct Implementers
jdk.jfr.internal.SecuritySupport.SecureRecorderListener

Callback interface to monitor Flight Recorder's life cycle.
Since
9

Method Summary

Modifier and TypeMethod and Description
public default void
recorderInitialized(FlightRecorder
Flight Recorder instance, not null
recorder
)

Receives notification when Flight Recorder is initialized.

public default void
recordingStateChanged(Recording
the recording where the state change occurred, not null
recording
)

Receives notification when the state of a recording changes.

Method Detail

recorderInitializedback to summary
public default void recorderInitialized(FlightRecorder recorder)

Receives notification when Flight Recorder is initialized.

This method is also be invoked when a listener is added to an already initialized Flight Recorder.

This method allows clients to implement their own initialization mechanism that is executed before a FlightRecorder instance is returned by FlightRecorder#getFlightRecorder().

Implementation Note

This method should return as soon as possible, to avoid blocking initialization of Flight Recorder. To avoid deadlocks or unexpected behavior, this method should not call FlightRecorder.getFlightRecorder() or start new recordings.

Implementation Specification

The default implementation of this method is empty.

Parameters
recorder:FlightRecorder

Flight Recorder instance, not null

See Also
FlightRecorder#addListener(FlightRecorderListener)
recordingStateChangedback to summary
public default void recordingStateChanged(Recording recording)

Receives notification when the state of a recording changes.

Callback is invoked when a recording reaches the RUNNING, STOPPED and CLOSED state.

Implementation Note

The implementation of this method should return as soon as possible to avoid blocking normal operation of Flight Recorder.

Implementation Specification

The default implementation of this method is empty.

Parameters
recording:Recording

the recording where the state change occurred, not null

See Also
FlightRecorder#addListener(FlightRecorderListener), RecordingState