Java Code Examples for jdk.jfr.consumer.RecordedObject#hasField()

The following examples show how to use jdk.jfr.consumer.RecordedObject#hasField() . 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: OldObjects.java    From dragonwell8_jdk with GNU General Public License v2.0 5 votes vote down vote up
private static Predicate<RecordedEvent> hasFieldName(String fieldName) {
    if (fieldName != null) {
        return e -> {
            RecordedObject referrer = e.getValue("object.referrer");
            return referrer != null ? referrer.hasField("field.name") && referrer.getValue("field.name").equals(fieldName) : false;
        };
    } else {
        return e -> true;
    }
}
 
Example 2
Source File: OldObjects.java    From dragonwell8_jdk with GNU General Public License v2.0 5 votes vote down vote up
private static Predicate<RecordedEvent> isReferrerType(Class<?> referrerType) {
    if (referrerType != null) {
        return e -> {
            RecordedObject referrer = e.getValue("object.referrer");
            return referrer != null ? referrer.hasField("object.type") &&
                                        ((RecordedClass) referrer.getValue("object.type")).getName().equals(referrerType.getName()) : false;
        };
    } else {
        return e -> true;
    }
}
 
Example 3
Source File: OldObjects.java    From dragonwell8_jdk with GNU General Public License v2.0 5 votes vote down vote up
public static boolean matchingReferrerClass(RecordedEvent event, String className) {
    RecordedObject referrer = event.getValue("object.referrer");
    if (referrer != null) {
        if (!referrer.hasField("object.type")) {
            return false;
        }

        String reportedClass = ((RecordedClass) referrer.getValue("object.type")).getName();
        if (reportedClass.equals(className)) {
            return true;
        }
    }
    return false;
}
 
Example 4
Source File: OldObjects.java    From dragonwell8_jdk with GNU General Public License v2.0 5 votes vote down vote up
private static Predicate<RecordedEvent> hasFieldName(String fieldName) {
    if (fieldName != null) {
        return e -> {
            RecordedObject referrer = e.getValue("object.referrer");
            return referrer != null ? referrer.hasField("field.name") && referrer.getValue("field.name").equals(fieldName) : false;
        };
    } else {
        return e -> true;
    }
}
 
Example 5
Source File: OldObjects.java    From dragonwell8_jdk with GNU General Public License v2.0 5 votes vote down vote up
private static Predicate<RecordedEvent> isReferrerType(Class<?> referrerType) {
    if (referrerType != null) {
        return e -> {
            RecordedObject referrer = e.getValue("object.referrer");
            return referrer != null ? referrer.hasField("object.type") &&
                                        ((RecordedClass) referrer.getValue("object.type")).getName().equals(referrerType.getName()) : false;
        };
    } else {
        return e -> true;
    }
}
 
Example 6
Source File: OldObjects.java    From dragonwell8_jdk with GNU General Public License v2.0 5 votes vote down vote up
public static boolean matchingReferrerClass(RecordedEvent event, String className) {
    RecordedObject referrer = event.getValue("object.referrer");
    if (referrer != null) {
        if (!referrer.hasField("object.type")) {
            return false;
        }

        String reportedClass = ((RecordedClass) referrer.getValue("object.type")).getName();
        if (reportedClass.equals(className)) {
            return true;
        }
    }
    return false;
}
 
Example 7
Source File: OldObjects.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
private static Predicate<RecordedEvent> hasFieldName(String fieldName) {
    if (fieldName != null) {
        return e -> {
            RecordedObject referrer = e.getValue("object.referrer");
            return referrer != null ? referrer.hasField("field.name") && referrer.getValue("field.name").equals(fieldName) : false;
        };
    } else {
        return e -> true;
    }
}
 
Example 8
Source File: OldObjects.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
private static Predicate<RecordedEvent> isReferrerType(Class<?> referrerType) {
    if (referrerType != null) {
        return e -> {
            RecordedObject referrer = e.getValue("object.referrer");
            return referrer != null ? referrer.hasField("object.type") &&
                                        ((RecordedClass) referrer.getValue("object.type")).getName().equals(referrerType.getName()) : false;
        };
    } else {
        return e -> true;
    }
}
 
Example 9
Source File: OldObjects.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
public static boolean matchingReferrerClass(RecordedEvent event, String className) {
    RecordedObject referrer = event.getValue("object.referrer");
    if (referrer != null) {
        if (!referrer.hasField("object.type")) {
            return false;
        }

        String reportedClass = ((RecordedClass) referrer.getValue("object.type")).getName();
        if (reportedClass.equals(className)) {
            return true;
        }
    }
    return false;
}
 
Example 10
Source File: OldObjects.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
private static Predicate<RecordedEvent> hasFieldName(String fieldName) {
    if (fieldName != null) {
        return e -> {
            RecordedObject referrer = e.getValue("object.referrer");
            return referrer != null ? referrer.hasField("field.name") && referrer.getValue("field.name").equals(fieldName) : false;
        };
    } else {
        return e -> true;
    }
}
 
Example 11
Source File: OldObjects.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
private static Predicate<RecordedEvent> isReferrerType(Class<?> referrerType) {
    if (referrerType != null) {
        return e -> {
            RecordedObject referrer = e.getValue("object.referrer");
            return referrer != null ? referrer.hasField("object.type") &&
                                        ((RecordedClass) referrer.getValue("object.type")).getName().equals(referrerType.getName()) : false;
        };
    } else {
        return e -> true;
    }
}
 
Example 12
Source File: OldObjects.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
public static boolean matchingReferrerClass(RecordedEvent event, String className) {
    RecordedObject referrer = event.getValue("object.referrer");
    if (referrer != null) {
        if (!referrer.hasField("object.type")) {
            return false;
        }

        String reportedClass = ((RecordedClass) referrer.getValue("object.type")).getName();
        if (reportedClass.equals(className)) {
            return true;
        }
    }
    return false;
}
 
Example 13
Source File: OldObjects.java    From dragonwell8_jdk with GNU General Public License v2.0 4 votes vote down vote up
public static String getReferrerFieldName(RecordedEvent event) {
    RecordedObject referrer = event.getValue("object.referrer");
    return referrer != null && referrer.hasField("field.name") ? referrer.getValue("field.name") : null;
}
 
Example 14
Source File: OldObjects.java    From dragonwell8_jdk with GNU General Public License v2.0 4 votes vote down vote up
public static String getReferrerFieldName(RecordedEvent event) {
    RecordedObject referrer = event.getValue("object.referrer");
    return referrer != null && referrer.hasField("field.name") ? referrer.getValue("field.name") : null;
}
 
Example 15
Source File: OldObjects.java    From TencentKona-8 with GNU General Public License v2.0 4 votes vote down vote up
public static String getReferrerFieldName(RecordedEvent event) {
    RecordedObject referrer = event.getValue("object.referrer");
    return referrer != null && referrer.hasField("field.name") ? referrer.getValue("field.name") : null;
}
 
Example 16
Source File: OldObjects.java    From openjdk-jdk8u with GNU General Public License v2.0 4 votes vote down vote up
public static String getReferrerFieldName(RecordedEvent event) {
    RecordedObject referrer = event.getValue("object.referrer");
    return referrer != null && referrer.hasField("field.name") ? referrer.getValue("field.name") : null;
}