jdk.jfr.Relational Java Examples

The following examples show how to use jdk.jfr.Relational. 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: TestRelational.java    From dragonwell8_jdk with GNU General Public License v2.0 5 votes vote down vote up
public static void main(String[] args) throws Exception {
    EventType t = EventType.getEventType(UserEvent.class);
    ValueDescriptor field = t.getField("id");
    AnnotationElement userId = Events.getAnnotation(field, UserId.class);
    Relational r = userId.getAnnotation(Relational.class);
    Asserts.assertTrue(r != null, "Expected relational annotation to have annotation @Relational");
}
 
Example #2
Source File: MetadataHandler.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
private Map<String, AnnotationElement> buildRelationMap(Map<String, Type> typeMap) {
    Map<String, AnnotationElement> relationMap = new HashMap<>();
    for (String relation : relations) {
        Type relationType = new Type(Type.TYPES_PREFIX + relation, Type.SUPER_TYPE_ANNOTATION, eventTypeId++);
        relationType.setAnnotations(Collections.singletonList(new AnnotationElement(Relational.class)));
        AnnotationElement ae = PrivateAccess.getInstance().newAnnotation(relationType, Collections.emptyList(), true);
        relationMap.put(relation, ae);
        typeMap.put(relationType.getName(), relationType);
    }
    return relationMap;
}
 
Example #3
Source File: TestRelational.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
public static void main(String[] args) throws Exception {
    EventType t = EventType.getEventType(UserEvent.class);
    ValueDescriptor field = t.getField("id");
    AnnotationElement userId = Events.getAnnotation(field, UserId.class);
    Relational r = userId.getAnnotation(Relational.class);
    Asserts.assertTrue(r != null, "Expected relational annotation to have annotation @Relational");
}
 
Example #4
Source File: MetadataHandler.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
private Map<String, AnnotationElement> buildRelationMap(Map<String, Type> typeMap) {
    Map<String, AnnotationElement> relationMap = new HashMap<>();
    for (String relation : relations) {
        Type relationType = new Type(Type.TYPES_PREFIX + relation, Type.SUPER_TYPE_ANNOTATION, eventTypeId++);
        relationType.setAnnotations(Collections.singletonList(new AnnotationElement(Relational.class)));
        AnnotationElement ae = PrivateAccess.getInstance().newAnnotation(relationType, Collections.emptyList(), true);
        relationMap.put(relation, ae);
        typeMap.put(relationType.getName(), relationType);
    }
    return relationMap;
}
 
Example #5
Source File: TestRelational.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
public static void main(String[] args) throws Exception {
    EventType t = EventType.getEventType(UserEvent.class);
    ValueDescriptor field = t.getField("id");
    AnnotationElement userId = Events.getAnnotation(field, UserId.class);
    Relational r = userId.getAnnotation(Relational.class);
    Asserts.assertTrue(r != null, "Expected relational annotation to have annotation @Relational");
}