APIdia Launch Partner
Top Description Fields Constructors Methods
jdk.jfr.internal.settings

public abstract Class FilterSetting

extends SettingControl
Class Inheritance
Known Direct Subclasses
jdk.jfr.internal.settings.MethodSetting
Imports
java.util.ArrayList, .List, .Objects, .Set, .StringJoiner, .TreeSet, jdk.jfr.SettingControl, jdk.jfr.internal.PlatformEventType

Base class for settings that consists of semicolon-separated filters.

Field Summary

Modifier and TypeField and Description
private final List<String>
private final String
private final PlatformEventType
private String

Constructor Summary

AccessConstructor and Description
public
FilterSetting(PlatformEventType eventType, String defaultValue)

Method Summary

Modifier and TypeMethod and Description
protected abstract void
apply(PlatformEventType eventType, List<String> text)

public final String
combine(Set<String> settingValues)

Implements abstract jdk.jfr.SettingControl.combine.

Combines the setting values for all running recordings into one value when multiple recordings are running at the same time,

The semantics of how setting values are combined depends on the setting control that is implemented, but all recordings should get at least all the events they request.

private static String
format(List<String> filters)

public final String
getValue()

Implements abstract jdk.jfr.SettingControl.getValue.

Returns the currently used value for this setting, not null.

protected abstract boolean
private List<String>
normalize(Set<String> settingValues)

public final void
setValue(String settingValue)

Implements abstract jdk.jfr.SettingControl.setValue.

Sets the value for this setting.

Field Detail

activeFiltersback to summary
private final List<String> activeFilters
defaultValueback to summary
private final String defaultValue
eventTypeback to summary
private final PlatformEventType eventType
valueback to summary
private String value

Constructor Detail

FilterSettingback to summary
public FilterSetting(PlatformEventType eventType, String defaultValue)

Method Detail

applyback to summary
protected abstract void apply(PlatformEventType eventType, List<String> text)
combineback to summary
public final String combine(Set<String> settingValues)

Implements abstract jdk.jfr.SettingControl.combine.

Doc from jdk.jfr.SettingControl.combine.

Combines the setting values for all running recordings into one value when multiple recordings are running at the same time,

The semantics of how setting values are combined depends on the setting control that is implemented, but all recordings should get at least all the events they request.

This method should have no side effects, because the caller might cache values. This method should never return null or throw an exception. If a value is not valid for this setting control, the value should be ignored.

Examples:

if the setting control represents a threshold and three recordings are running at the same time with the setting values "10 ms", "8 s", and "1 ms", this method returns "1 ms" because it means that all recordings get at least all the requested data.

If the setting control represents a set of names and two recordings are running at the same time with the setting values "Smith, Jones" and "Jones, Williams" the returned value is "Smith, Jones, Williams" because all names would be accepted.

If the setting control represents a boolean condition and four recordings are running at the same time with the following values "true", "false", "false", and "incorrect", this method returns "true", because all recordings get at least all the requested data.

Annotations
@Override
formatback to summary
private static String format(List<String> filters)
getValueback to summary
public final String getValue()

Implements abstract jdk.jfr.SettingControl.getValue.

Doc from jdk.jfr.SettingControl.getValue.

Returns the currently used value for this setting, not null.

The value returned by this method is valid as an argument to both the setValue(String) method and combine(Set) method.

This method is invoked when an event is registered to obtain the default value. It is therefore important that a valid value can be returned immediately after an instance of this class is created. It is not valid to return null.

Annotations
@Override
isValidback to summary
protected abstract boolean isValid(String text)
normalizeback to summary
private List<String> normalize(Set<String> settingValues)
setValueback to summary
public final void setValue(String settingValue)

Implements abstract jdk.jfr.SettingControl.setValue.

Doc from jdk.jfr.SettingControl.setValue.

Sets the value for this setting.

If the setting value is not valid for this setting, this method does not throw an exception. Instead, the value is ignored.

Annotations
@Override