jdk.jfr.SettingDefinition Java Examples

The following examples show how to use jdk.jfr.SettingDefinition. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: BaseEvent.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
@SettingDefinition
@Name("protectedBase")
@Label("Protected Base")
@Description("Description of protected base")
@Frequency
protected boolean something(PlainSetting control) {
    return true;
}
 
Example #2
Source File: CustomEvent.java    From dragonwell8_jdk with GNU General Public License v2.0 5 votes vote down vote up
@SettingDefinition
@Name("newName")
@Label(ANNOTATED_METHOD)
@Description(DESCRIPTION_OF_AN_ANNOTATED_METHOD)
@Timespan(Timespan.NANOSECONDS)
public boolean whatever(AnnotatedSetting s) {
    return true;
}
 
Example #3
Source File: EventControl.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
@SuppressWarnings("unchecked")
private void defineSettings(Class<?> eventClass) {
    // Iterate up the class hierarchy and let
    // subclasses shadow base classes.
    boolean allowPrivateMethod = true;
    while (eventClass != null) {
        for (Method m : eventClass.getDeclaredMethods()) {
            boolean isPrivate = Modifier.isPrivate(m.getModifiers());
            if (m.getReturnType() == Boolean.TYPE && m.getParameterCount() == 1 && (!isPrivate || allowPrivateMethod)) {
                SettingDefinition se = m.getDeclaredAnnotation(SettingDefinition.class);
                if (se != null) {
                    Class<?> settingClass = m.getParameters()[0].getType();
                    if (!Modifier.isAbstract(settingClass.getModifiers()) && SettingControl.class.isAssignableFrom(settingClass)) {
                        String name = m.getName();
                        Name n = m.getAnnotation(Name.class);
                        if (n != null) {
                            name = n.value();
                        }
                        if (!eventControls.containsKey(name)) {
                            defineSetting((Class<? extends SettingControl>) settingClass, m, type, name);
                        }
                    }
                }
            }
        }
        eventClass = eventClass.getSuperclass();
        allowPrivateMethod = false;
    }
}
 
Example #4
Source File: CustomEvent.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
@SettingDefinition
@Name("newName")
@Label(ANNOTATED_METHOD)
@Description(DESCRIPTION_OF_AN_ANNOTATED_METHOD)
@Timespan(Timespan.NANOSECONDS)
public boolean whatever(AnnotatedSetting s) {
    return true;
}
 
Example #5
Source File: BaseEvent.java    From dragonwell8_jdk with GNU General Public License v2.0 5 votes vote down vote up
@SettingDefinition
@Name("protectedBase")
@Label("Protected Base")
@Description("Description of protected base")
@Frequency
protected boolean something(PlainSetting control) {
    return true;
}
 
Example #6
Source File: BaseEvent.java    From dragonwell8_jdk with GNU General Public License v2.0 5 votes vote down vote up
@Name("baseName")
@Label("Base Label")
@Description("Base description")
@SettingDefinition
public boolean overridden(AnnotatedSetting control) {
    return true;
}
 
Example #7
Source File: EventControl.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
@SuppressWarnings("unchecked")
private void defineSettings(Class<?> eventClass) {
    // Iterate up the class hierarchy and let
    // subclasses shadow base classes.
    boolean allowPrivateMethod = true;
    while (eventClass != null) {
        for (Method m : eventClass.getDeclaredMethods()) {
            boolean isPrivate = Modifier.isPrivate(m.getModifiers());
            if (m.getReturnType() == Boolean.TYPE && m.getParameterCount() == 1 && (!isPrivate || allowPrivateMethod)) {
                SettingDefinition se = m.getDeclaredAnnotation(SettingDefinition.class);
                if (se != null) {
                    Class<?> settingClass = m.getParameters()[0].getType();
                    if (!Modifier.isAbstract(settingClass.getModifiers()) && SettingControl.class.isAssignableFrom(settingClass)) {
                        String name = m.getName();
                        Name n = m.getAnnotation(Name.class);
                        if (n != null) {
                            name = n.value();
                        }
                        if (!eventControls.containsKey(name)) {
                            defineSetting((Class<? extends SettingControl>) settingClass, m, type, name);
                        }
                    }
                }
            }
        }
        eventClass = eventClass.getSuperclass();
        allowPrivateMethod = false;
    }
}
 
Example #8
Source File: BaseEvent.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
@SettingDefinition
@Name("protectedBase")
@Label("Protected Base")
@Description("Description of protected base")
@Frequency
protected boolean something(PlainSetting control) {
    return true;
}
 
Example #9
Source File: BaseEvent.java    From dragonwell8_jdk with GNU General Public License v2.0 5 votes vote down vote up
@Name("baseName")
@Label("Base Label")
@Description("Base description")
@SettingDefinition
public boolean overridden(AnnotatedSetting control) {
    return true;
}
 
Example #10
Source File: BaseEvent.java    From dragonwell8_jdk with GNU General Public License v2.0 5 votes vote down vote up
@SettingDefinition
@Name("protectedBase")
@Label("Protected Base")
@Description("Description of protected base")
@Frequency
protected boolean something(PlainSetting control) {
    return true;
}
 
Example #11
Source File: CustomEvent.java    From dragonwell8_jdk with GNU General Public License v2.0 5 votes vote down vote up
@SettingDefinition
@Name("newName")
@Label(ANNOTATED_METHOD)
@Description(DESCRIPTION_OF_AN_ANNOTATED_METHOD)
@Timespan(Timespan.NANOSECONDS)
public boolean whatever(AnnotatedSetting s) {
    return true;
}
 
Example #12
Source File: EventControl.java    From dragonwell8_jdk with GNU General Public License v2.0 5 votes vote down vote up
@SuppressWarnings("unchecked")
private void defineSettings(Class<?> eventClass) {
    // Iterate up the class hierarchy and let
    // subclasses shadow base classes.
    boolean allowPrivateMethod = true;
    while (eventClass != null) {
        for (Method m : eventClass.getDeclaredMethods()) {
            boolean isPrivate = Modifier.isPrivate(m.getModifiers());
            if (m.getReturnType() == Boolean.TYPE && m.getParameterCount() == 1 && (!isPrivate || allowPrivateMethod)) {
                SettingDefinition se = m.getDeclaredAnnotation(SettingDefinition.class);
                if (se != null) {
                    Class<?> settingClass = m.getParameters()[0].getType();
                    if (!Modifier.isAbstract(settingClass.getModifiers()) && SettingControl.class.isAssignableFrom(settingClass)) {
                        String name = m.getName();
                        Name n = m.getAnnotation(Name.class);
                        if (n != null) {
                            name = n.value();
                        }
                        if (!eventControls.containsKey(name)) {
                            defineSetting((Class<? extends SettingControl>) settingClass, m, type, name);
                        }
                    }
                }
            }
        }
        eventClass = eventClass.getSuperclass();
        allowPrivateMethod = false;
    }
}
 
Example #13
Source File: CustomEvent.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
@SettingDefinition
@Name("newName")
@Label(ANNOTATED_METHOD)
@Description(DESCRIPTION_OF_AN_ANNOTATED_METHOD)
@Timespan(Timespan.NANOSECONDS)
public boolean whatever(AnnotatedSetting s) {
    return true;
}
 
Example #14
Source File: BaseEvent.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
@Name("baseName")
@Label("Base Label")
@Description("Base description")
@SettingDefinition
public boolean overridden(AnnotatedSetting control) {
    return true;
}
 
Example #15
Source File: BaseEvent.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
@Name("baseName")
@Label("Base Label")
@Description("Base description")
@SettingDefinition
public boolean overridden(AnnotatedSetting control) {
    return true;
}
 
Example #16
Source File: TestFilterEvents.java    From TencentKona-8 with GNU General Public License v2.0 4 votes vote down vote up
@Label("URI Filter")
@SettingDefinition
protected boolean uriFilter(RegExpControl control) {
    return control.matches(uri);
}
 
Example #17
Source File: EventWithCustomSettings.java    From openjdk-jdk8u with GNU General Public License v2.0 4 votes vote down vote up
@SettingDefinition
@Name("setting1")
boolean methodNameNotUsed(SimpleSetting cs) {
    return true;
}
 
Example #18
Source File: TestDescription.java    From openjdk-jdk8u with GNU General Public License v2.0 4 votes vote down vote up
@SettingDefinition
@Description("Setting description")
boolean dummy(SimpleSetting ds) {
    return true;
}
 
Example #19
Source File: TestLabel.java    From openjdk-jdk8u with GNU General Public License v2.0 4 votes vote down vote up
@SettingDefinition
@Label("Setting Label")
boolean dummy(SimpleSetting ds) {
    return true;
}
 
Example #20
Source File: TestName.java    From openjdk-jdk8u with GNU General Public License v2.0 4 votes vote down vote up
@SettingDefinition
@Name("name")
boolean dummy(SimpleSetting ds) {
    return true;
}
 
Example #21
Source File: EventWithCustomSettings.java    From openjdk-jdk8u with GNU General Public License v2.0 4 votes vote down vote up
@SettingDefinition
boolean setting2(SimpleSetting cs) {
    return true;
}
 
Example #22
Source File: CustomEvent.java    From openjdk-jdk8u with GNU General Public License v2.0 4 votes vote down vote up
@SettingDefinition
private boolean plain(PlainSetting s) {
    return true;
}
 
Example #23
Source File: BaseEvent.java    From TencentKona-8 with GNU General Public License v2.0 4 votes vote down vote up
@SettingDefinition
boolean packageProtectedBase(PlainSetting control) {
    return true;
}
 
Example #24
Source File: TestSettingsControl.java    From TencentKona-8 with GNU General Public License v2.0 4 votes vote down vote up
@SettingDefinition
boolean mySetting(MySettingsControl msc) {
    return true;
}
 
Example #25
Source File: TestFilterEvents.java    From TencentKona-8 with GNU General Public License v2.0 4 votes vote down vote up
@Label("Thread Names")
@Description("List of thread names to accept, such as \"main\" or \"workerThread1\", \"taskThread\"")
@SettingDefinition
private boolean threadNames(StringListSetting setting) {
    return setting.accept(Thread.currentThread().getName());
}
 
Example #26
Source File: TestDescription.java    From TencentKona-8 with GNU General Public License v2.0 4 votes vote down vote up
@SettingDefinition
@Description("Setting description")
boolean dummy(SimpleSetting ds) {
    return true;
}
 
Example #27
Source File: EventWithCustomSettings.java    From TencentKona-8 with GNU General Public License v2.0 4 votes vote down vote up
@SettingDefinition
@Name("setting1")
boolean methodNameNotUsed(SimpleSetting cs) {
    return true;
}
 
Example #28
Source File: EventWithCustomSettings.java    From TencentKona-8 with GNU General Public License v2.0 4 votes vote down vote up
@SettingDefinition
boolean setting2(SimpleSetting cs) {
    return true;
}
 
Example #29
Source File: TestName.java    From TencentKona-8 with GNU General Public License v2.0 4 votes vote down vote up
@SettingDefinition
@Name("name")
boolean dummy(SimpleSetting ds) {
    return true;
}
 
Example #30
Source File: TestLabel.java    From TencentKona-8 with GNU General Public License v2.0 4 votes vote down vote up
@SettingDefinition
@Label("Setting Label")
boolean dummy(SimpleSetting ds) {
    return true;
}