< prev index next >

src/jdk.jfr/share/classes/jdk/jfr/internal/MirrorEvents.java

Print this page

24  */
25 package jdk.jfr.internal;
26 
27 import java.util.HashMap;
28 import java.util.Map;
29 
30 import jdk.jfr.Event;
31 import jdk.jfr.events.DeserializationEvent;
32 import jdk.jfr.events.ErrorThrownEvent;
33 import jdk.jfr.events.ExceptionStatisticsEvent;
34 import jdk.jfr.events.ExceptionThrownEvent;
35 import jdk.jfr.events.ProcessStartEvent;
36 import jdk.jfr.events.SecurityPropertyModificationEvent;
37 import jdk.jfr.events.SecurityProviderServiceEvent;
38 import jdk.jfr.events.SerializationMisdeclarationEvent;
39 import jdk.jfr.events.SocketReadEvent;
40 import jdk.jfr.events.SocketWriteEvent;
41 import jdk.jfr.events.TLSHandshakeEvent;
42 import jdk.jfr.events.ThreadSleepEvent;
43 import jdk.jfr.events.VirtualThreadEndEvent;
44 import jdk.jfr.events.VirtualThreadPinnedEvent;
45 import jdk.jfr.events.VirtualThreadStartEvent;
46 import jdk.jfr.events.VirtualThreadSubmitFailedEvent;
47 import jdk.jfr.events.X509CertificateEvent;
48 import jdk.jfr.events.X509ValidationEvent;
49 
50 public final class MirrorEvents {
51     private static final Class<?>[] mirrorEventClasses = {
52         DeserializationEvent.class,
53         ProcessStartEvent.class,
54         SecurityPropertyModificationEvent.class,
55         SecurityProviderServiceEvent.class,
56         SerializationMisdeclarationEvent.class,
57         SocketReadEvent.class,
58         SocketWriteEvent.class,
59         ThreadSleepEvent.class,
60         TLSHandshakeEvent.class,
61         VirtualThreadStartEvent.class,
62         VirtualThreadEndEvent.class,
63         VirtualThreadPinnedEvent.class,
64         VirtualThreadSubmitFailedEvent.class,
65         X509CertificateEvent.class,
66         X509ValidationEvent.class,
67         ErrorThrownEvent.class,
68         ExceptionStatisticsEvent.class,
69         ExceptionThrownEvent.class,
70     };
71 
72     private static final Map<String, Class<? extends Event>> mirrorLookup = createLookup();
73 
74     public static Class<? extends Event> find(String name) {
75         // When <clinit> of this class is executed it may lead
76         // to a JVM up call and invocation of this method before
77         // the mirrorLookup field has been set. This is fine,
78         // mirrors should not be instrumented.
79         if (mirrorLookup != null) {
80             return mirrorLookup.get(name);
81         }
82         return null;
83     }

24  */
25 package jdk.jfr.internal;
26 
27 import java.util.HashMap;
28 import java.util.Map;
29 
30 import jdk.jfr.Event;
31 import jdk.jfr.events.DeserializationEvent;
32 import jdk.jfr.events.ErrorThrownEvent;
33 import jdk.jfr.events.ExceptionStatisticsEvent;
34 import jdk.jfr.events.ExceptionThrownEvent;
35 import jdk.jfr.events.ProcessStartEvent;
36 import jdk.jfr.events.SecurityPropertyModificationEvent;
37 import jdk.jfr.events.SecurityProviderServiceEvent;
38 import jdk.jfr.events.SerializationMisdeclarationEvent;
39 import jdk.jfr.events.SocketReadEvent;
40 import jdk.jfr.events.SocketWriteEvent;
41 import jdk.jfr.events.TLSHandshakeEvent;
42 import jdk.jfr.events.ThreadSleepEvent;
43 import jdk.jfr.events.VirtualThreadEndEvent;

44 import jdk.jfr.events.VirtualThreadStartEvent;
45 import jdk.jfr.events.VirtualThreadSubmitFailedEvent;
46 import jdk.jfr.events.X509CertificateEvent;
47 import jdk.jfr.events.X509ValidationEvent;
48 
49 public final class MirrorEvents {
50     private static final Class<?>[] mirrorEventClasses = {
51         DeserializationEvent.class,
52         ProcessStartEvent.class,
53         SecurityPropertyModificationEvent.class,
54         SecurityProviderServiceEvent.class,
55         SerializationMisdeclarationEvent.class,
56         SocketReadEvent.class,
57         SocketWriteEvent.class,
58         ThreadSleepEvent.class,
59         TLSHandshakeEvent.class,
60         VirtualThreadStartEvent.class,
61         VirtualThreadEndEvent.class,

62         VirtualThreadSubmitFailedEvent.class,
63         X509CertificateEvent.class,
64         X509ValidationEvent.class,
65         ErrorThrownEvent.class,
66         ExceptionStatisticsEvent.class,
67         ExceptionThrownEvent.class,
68     };
69 
70     private static final Map<String, Class<? extends Event>> mirrorLookup = createLookup();
71 
72     public static Class<? extends Event> find(String name) {
73         // When <clinit> of this class is executed it may lead
74         // to a JVM up call and invocation of this method before
75         // the mirrorLookup field has been set. This is fine,
76         // mirrors should not be instrumented.
77         if (mirrorLookup != null) {
78             return mirrorLookup.get(name);
79         }
80         return null;
81     }
< prev index next >