Interface FlightRecorderListener
public interface FlightRecorderListener
Callback interface to monitor Flight Recorder's life cycle.
- Since:
- 9
Methods
Modifier and Type | Method | Description |
---|---|---|
default void | recorderInitialized(FlightRecorder recorder) | Receives notification when Flight Recorder is initialized. |
default void | recordingStateChanged(Recording recording) | Receives notification when the state of a recording changes. |
Methods
recorderInitialized
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 Requirements:
- The default implementation of this method is empty.
- 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. - Parameters:
-
recorder
- Flight Recorder instance, notnull
- See Also:
FlightRecorder.addListener(FlightRecorderListener)
recordingStateChanged
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 Requirements:
- The default implementation of this method is empty.
- Implementation Note:
- The implementation of this method should return as soon as possible to avoid blocking normal operation of Flight Recorder.
- Parameters:
-
recording
- the recording where the state change occurred, notnull
- See Also:
-
FlightRecorder.addListener(FlightRecorderListener)
,RecordingState
© 1993, 2020, Oracle and/or its affiliates. All rights reserved.
Documentation extracted from Debian's OpenJDK Development Kit package.
Licensed under the GNU General Public License, version 2, with the Classpath Exception.
Various third party code in OpenJDK is licensed under different licenses (see Debian package).
Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
https://docs.oracle.com/en/java/javase/11/docs/api/jdk.jfr/jdk/jfr/FlightRecorderListener.html