Java Code Examples for jdk.jfr.internal.handlers.EventHandler#setRegistered()

The following examples show how to use jdk.jfr.internal.handlers.EventHandler#setRegistered() . 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: MetadataRepository.java    From dragonwell8_jdk with GNU General Public License v2.0 6 votes vote down vote up
public synchronized EventType register(Class<? extends Event> eventClass, List<AnnotationElement> dynamicAnnotations, List<ValueDescriptor> dynamicFields) {
    Utils.checkRegisterPermission();
    EventHandler handler = getHandler(eventClass);
    if (handler == null) {
        handler = makeHandler(eventClass, dynamicAnnotations, dynamicFields);
    }
    handler.setRegistered(true);
    typeLibrary.addType(handler.getPlatformEventType());
    if (jvm.isRecording()) {
        storeDescriptorInJVM(); // needed for emergency dump
        settingsManager.setEventControl(handler.getEventControl());
        settingsManager.updateRetransform(Collections.singletonList((eventClass)));
    } else {
        setStaleMetadata();
    }
    return handler.getEventType();
}
 
Example 2
Source File: MetadataRepository.java    From TencentKona-8 with GNU General Public License v2.0 6 votes vote down vote up
public synchronized EventType register(Class<? extends Event> eventClass, List<AnnotationElement> dynamicAnnotations, List<ValueDescriptor> dynamicFields) {
    Utils.checkRegisterPermission();
    EventHandler handler = getHandler(eventClass);
    if (handler == null) {
        handler = makeHandler(eventClass, dynamicAnnotations, dynamicFields);
    }
    handler.setRegistered(true);
    typeLibrary.addType(handler.getPlatformEventType());
    if (jvm.isRecording()) {
        storeDescriptorInJVM(); // needed for emergency dump
        settingsManager.setEventControl(handler.getEventControl());
        settingsManager.updateRetransform(Collections.singletonList((eventClass)));
    } else {
        setStaleMetadata();
    }
    return handler.getEventType();
}
 
Example 3
Source File: MetadataRepository.java    From openjdk-jdk8u with GNU General Public License v2.0 6 votes vote down vote up
public synchronized EventType register(Class<? extends Event> eventClass, List<AnnotationElement> dynamicAnnotations, List<ValueDescriptor> dynamicFields) {
    Utils.checkRegisterPermission();
    EventHandler handler = getHandler(eventClass);
    if (handler == null) {
        handler = makeHandler(eventClass, dynamicAnnotations, dynamicFields);
    }
    handler.setRegistered(true);
    typeLibrary.addType(handler.getPlatformEventType());
    if (jvm.isRecording()) {
        storeDescriptorInJVM(); // needed for emergency dump
        settingsManager.setEventControl(handler.getEventControl());
        settingsManager.updateRetransform(Collections.singletonList((eventClass)));
    } else {
        setStaleMetadata();
    }
    return handler.getEventType();
}
 
Example 4
Source File: MetadataRepository.java    From dragonwell8_jdk with GNU General Public License v2.0 5 votes vote down vote up
public synchronized void unregister(Class<? extends Event> eventClass) {
    Utils.checkRegisterPermission();
    EventHandler handler = getHandler(eventClass);
    if (handler != null) {
        handler.setRegistered(false);
    }
    // never registered, ignore call
}
 
Example 5
Source File: MetadataRepository.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
public synchronized void unregister(Class<? extends Event> eventClass) {
    Utils.checkRegisterPermission();
    EventHandler handler = getHandler(eventClass);
    if (handler != null) {
        handler.setRegistered(false);
    }
    // never registered, ignore call
}
 
Example 6
Source File: MetadataRepository.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
public synchronized void unregister(Class<? extends Event> eventClass) {
    Utils.checkRegisterPermission();
    EventHandler handler = getHandler(eventClass);
    if (handler != null) {
        handler.setRegistered(false);
    }
    // never registered, ignore call
}