jdk.jfr.internal.RequestEngine.RequestHook Java Examples
The following examples show how to use
jdk.jfr.internal.RequestEngine.RequestHook.
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 |
private void initializeJVMEventTypes() { List<RequestHook> requestHooks = new ArrayList<>(); for (Type type : typeLibrary.getTypes()) { if (type instanceof PlatformEventType) { PlatformEventType pEventType = (PlatformEventType) type; EventType eventType = PrivateAccess.getInstance().newEventType(pEventType); pEventType.setHasDuration(eventType.getAnnotation(Threshold.class) != null); pEventType.setHasStackTrace(eventType.getAnnotation(StackTrace.class) != null); pEventType.setHasCutoff(eventType.getAnnotation(Cutoff.class) != null); pEventType.setHasPeriod(eventType.getAnnotation(Period.class) != null); // Must add hook before EventControl is created as it removes // annotations, such as Period and Threshold. if (pEventType.hasPeriod()) { pEventType.setEventHook(true); if (!"com.oracle.jdk.ExecutionSample".equals(type.getName())) { requestHooks.add(new RequestHook(pEventType)); } } nativeControls.add(new EventControl(pEventType)); nativeEventTypes.add(eventType); } } RequestEngine.addHooks(requestHooks); }
Example #2
Source File: MetadataRepository.java From TencentKona-8 with GNU General Public License v2.0 | 6 votes |
private void initializeJVMEventTypes() { List<RequestHook> requestHooks = new ArrayList<>(); for (Type type : typeLibrary.getTypes()) { if (type instanceof PlatformEventType) { PlatformEventType pEventType = (PlatformEventType) type; EventType eventType = PrivateAccess.getInstance().newEventType(pEventType); pEventType.setHasDuration(eventType.getAnnotation(Threshold.class) != null); pEventType.setHasStackTrace(eventType.getAnnotation(StackTrace.class) != null); pEventType.setHasCutoff(eventType.getAnnotation(Cutoff.class) != null); pEventType.setHasPeriod(eventType.getAnnotation(Period.class) != null); // Must add hook before EventControl is created as it removes // annotations, such as Period and Threshold. if (pEventType.hasPeriod()) { pEventType.setEventHook(true); if (!(Type.EVENT_NAME_PREFIX + "ExecutionSample").equals(type.getName())) { requestHooks.add(new RequestHook(pEventType)); } } nativeControls.add(new EventControl(pEventType)); nativeEventTypes.add(eventType); } } RequestEngine.addHooks(requestHooks); }
Example #3
Source File: MetadataRepository.java From openjdk-jdk8u with GNU General Public License v2.0 | 6 votes |
private void initializeJVMEventTypes() { List<RequestHook> requestHooks = new ArrayList<>(); for (Type type : typeLibrary.getTypes()) { if (type instanceof PlatformEventType) { PlatformEventType pEventType = (PlatformEventType) type; EventType eventType = PrivateAccess.getInstance().newEventType(pEventType); pEventType.setHasDuration(eventType.getAnnotation(Threshold.class) != null); pEventType.setHasStackTrace(eventType.getAnnotation(StackTrace.class) != null); pEventType.setHasCutoff(eventType.getAnnotation(Cutoff.class) != null); pEventType.setHasPeriod(eventType.getAnnotation(Period.class) != null); // Must add hook before EventControl is created as it removes // annotations, such as Period and Threshold. if (pEventType.hasPeriod()) { pEventType.setEventHook(true); if (!(Type.EVENT_NAME_PREFIX + "ExecutionSample").equals(type.getName())) { requestHooks.add(new RequestHook(pEventType)); } } nativeControls.add(new EventControl(pEventType)); nativeEventTypes.add(eventType); } } RequestEngine.addHooks(requestHooks); }