comparison jvmci/jdk.vm.ci.hotspot.jfr/src/jdk/vm/ci/hotspot/jfr/events/JFREventProvider.java @ 23363:56479400913e

jdk.vm.ci needs to securely export services (JDK-8155023)
author Doug Simon <doug.simon@oracle.com>
date Thu, 28 Apr 2016 15:16:47 +0200
parents 1c4b6a7f1917
children 1d4ce2d19e52
comparison
equal deleted inserted replaced
23362:ed9eec30efc1 23363:56479400913e
24 24
25 import static jdk.vm.ci.hotspot.HotSpotVMConfig.config; 25 import static jdk.vm.ci.hotspot.HotSpotVMConfig.config;
26 26
27 import java.net.URISyntaxException; 27 import java.net.URISyntaxException;
28 28
29 import jdk.vm.ci.hotspot.events.EmptyEventProvider.EmptyCompilationEvent; 29 import jdk.vm.ci.hotspot.services.EventProvider;
30 import jdk.vm.ci.hotspot.events.EmptyEventProvider.EmptyCompilerFailureEvent;
31 import jdk.vm.ci.hotspot.events.EventProvider;
32 30
33 /** 31 /**
34 * A JFR implementation for {@link EventProvider}. This implementation is used when Flight Recorder 32 * A JFR implementation for {@link EventProvider}. This implementation is used when Flight Recorder
35 * is turned on. 33 * is turned on.
36 * 34 *
37 * Note: The use of fully qualified names for deprecated types is a workaround for 35 * Note: The use of fully qualified names for deprecated types is a workaround for
38 * <a href="https://bugs.openjdk.java.net/browse/JDK-8032211">JDK-8032211</a>. 36 * <a href="https://bugs.openjdk.java.net/browse/JDK-8032211">JDK-8032211</a>.
39 */ 37 */
40 @SuppressWarnings("deprecation") 38 @SuppressWarnings("deprecation")
41 public final class JFREventProvider implements EventProvider { 39 public final class JFREventProvider extends EventProvider {
42 40
43 private final boolean enabled; 41 private final boolean enabled;
44 42
45 /** 43 /**
46 * Need to store the producer in a field so that it doesn't disappear. 44 * Need to store the producer in a field so that it doesn't disappear.
87 } catch (com.oracle.jrockit.jfr.InvalidEventDefinitionException | com.oracle.jrockit.jfr.InvalidValueException e) { 85 } catch (com.oracle.jrockit.jfr.InvalidEventDefinitionException | com.oracle.jrockit.jfr.InvalidValueException e) {
88 throw new InternalError(e); 86 throw new InternalError(e);
89 } 87 }
90 } 88 }
91 89
90 @Override
92 public CompilationEvent newCompilationEvent() { 91 public CompilationEvent newCompilationEvent() {
93 if (enabled) { 92 if (enabled) {
94 return new JFRCompilationEvent(); 93 return new JFRCompilationEvent();
95 } 94 }
96 return new EmptyCompilationEvent(); 95 return EventProvider.createEmptyCompilationEvent();
97 } 96 }
98 97
99 /** 98 /**
100 * A JFR compilation event. 99 * A JFR compilation event.
101 * 100 *
143 public void setInlinedBytes(int inlinedBytes) { 142 public void setInlinedBytes(int inlinedBytes) {
144 this.inlinedBytes = inlinedBytes; 143 this.inlinedBytes = inlinedBytes;
145 } 144 }
146 } 145 }
147 146
147 @Override
148 public CompilerFailureEvent newCompilerFailureEvent() { 148 public CompilerFailureEvent newCompilerFailureEvent() {
149 if (enabled) { 149 if (enabled) {
150 return new JFRCompilerFailureEvent(); 150 return new JFRCompilerFailureEvent();
151 } 151 }
152 return new EmptyCompilerFailureEvent(); 152 return EventProvider.createEmptyCompilerFailureEvent();
153 } 153 }
154 154
155 /** 155 /**
156 * A JFR compiler failure event. 156 * A JFR compiler failure event.
157 * 157 *