< prev index next >
test/compiler/jvmci/events/JvmciShutdownEventListener.java
Print this page
rev 12121 : 8167180: [JVMCI] Exported elements referring to inaccessible types in jdk.vm.ci
*** 21,34 ****
* questions.
*/
package compiler.jvmci.events;
import jdk.vm.ci.hotspot.HotSpotJVMCIRuntime;
! import jdk.vm.ci.hotspot.services.HotSpotVMEventListener;
! public class JvmciShutdownEventListener extends HotSpotVMEventListener {
public static final String MESSAGE = "Shutdown notified";
public static final String GOT_INTERNAL_ERROR = "Got internal error";
public static void main(String args[]) {
try {
--- 21,35 ----
* questions.
*/
package compiler.jvmci.events;
+ import jdk.vm.ci.services.JVMCIServiceLocator;
import jdk.vm.ci.hotspot.HotSpotJVMCIRuntime;
! import jdk.vm.ci.hotspot.HotSpotVMEventListener;
! public class JvmciShutdownEventListener extends JVMCIServiceLocator implements HotSpotVMEventListener {
public static final String MESSAGE = "Shutdown notified";
public static final String GOT_INTERNAL_ERROR = "Got internal error";
public static void main(String args[]) {
try {
*** 37,45 ****
--- 38,54 ----
System.out.println(GOT_INTERNAL_ERROR);
}
}
@Override
+ public <S> S getProvider(Class<S> service) {
+ if (service == HotSpotVMEventListener.class) {
+ return service.cast(this);
+ }
+ return null;
+ }
+
+ @Override
public void notifyShutdown() {
System.out.println(MESSAGE);
}
}
< prev index next >