Categories:
Audio (13)
Biotech (29)
Bytecode (36)
Database (77)
Framework (7)
Game (7)
General (507)
Graphics (53)
I/O (35)
IDE (2)
JAR Tools (102)
JavaBeans (21)
JDBC (121)
JDK (426)
JSP (20)
Logging (108)
Mail (58)
Messaging (8)
Network (84)
PDF (97)
Report (7)
Scripting (84)
Security (32)
Server (121)
Servlet (26)
SOAP (24)
Testing (54)
Web (15)
XML (322)
Collections:
Other Resources:
JDK 17 jdk.jshell.jmod - JShell Tool
JDK 17 jdk.jshell.jmod is the JMOD file for JDK 17 JShell tool,
which can be invoked by the "jshell" command.
JDK 17 JShell tool compiled class files are stored in \fyicenter\jdk-17.0.5\jmods\jdk.jshell.jmod.
JDK 17 JShell tool compiled class files are also linked and stored in the \fyicenter\jdk-17.0.5\lib\modules JImage file.
JDK 17 JShell tool source code files are stored in \fyicenter\jdk-17.0.5\lib\src.zip\jdk.jshell.
You can click and view the content of each source code file in the list below.
✍: FYIcenter
⏎ jdk/jshell/execution/JdiEventHandler.java
/*
* Copyright (c) 1998, 2014, Oracle and/or its affiliates. All rights reserved.
* ORACLE PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*/
package jdk.jshell.execution;
import java.util.function.Consumer;
import com.sun.jdi.*;
import com.sun.jdi.event.*;
/**
* Handler of Java Debug Interface events.
* Adapted from jdb EventHandler.
* Only exit and disconnect events processed.
*/
class JdiEventHandler implements Runnable {
private final Thread thread;
private volatile boolean connected = true;
private boolean completed = false;
private final VirtualMachine vm;
private final Consumer<String> reportVMExit;
/**
* Creates an event handler. Start with {@code start()}.
*
* @param vm the virtual machine for which to handle events
* @param reportVMExit callback to report exit/disconnect
* (passed true if the VM has died)
*/
JdiEventHandler(VirtualMachine vm, Consumer<String> reportVMExit) {
this.vm = vm;
this.reportVMExit = reportVMExit;
this.thread = new Thread(this, "event-handler");
this.thread.setDaemon(true);
}
/**
* Starts the event handler.
*/
void start() {
thread.start();
}
synchronized void shutdown() {
connected = false; // force run() loop termination
thread.interrupt();
while (!completed) {
try {wait();} catch (InterruptedException exc) {}
}
}
@Override
public void run() {
EventQueue queue = vm.eventQueue();
while (connected) {
try {
EventSet eventSet = queue.remove();
boolean resumeStoppedApp = false;
EventIterator it = eventSet.eventIterator();
while (it.hasNext()) {
resumeStoppedApp |= handleEvent(it.nextEvent());
}
if (resumeStoppedApp) {
eventSet.resume();
}
} catch (InterruptedException exc) {
// Do nothing. Any changes will be seen at top of loop.
} catch (VMDisconnectedException discExc) {
handleDisconnectedException();
break;
}
}
synchronized (this) {
completed = true;
notifyAll();
}
}
private boolean handleEvent(Event event) {
handleExitEvent(event);
return true;
}
private void handleExitEvent(Event event) {
if (event instanceof VMDeathEvent) {
reportVMExit.accept("VM Died");
} else if (event instanceof VMDisconnectEvent) {
connected = false;
reportVMExit.accept("VM Disconnected");
} else {
// ignore everything else
}
}
private synchronized void handleDisconnectedException() {
/*
* A VMDisconnectedException has happened while dealing with
* another event. We need to flush the event queue, dealing only
* with exit events (VMDeath, VMDisconnect) so that we terminate
* correctly.
*/
EventQueue queue = vm.eventQueue();
while (connected) {
try {
EventSet eventSet = queue.remove();
EventIterator iter = eventSet.eventIterator();
while (iter.hasNext()) {
handleExitEvent(iter.next());
}
} catch (InterruptedException exc) {
// ignore
} catch (InternalError exc) {
// ignore
}
}
}
}
⏎ jdk/jshell/execution/JdiEventHandler.java
Or download all of them as a single archive file:
File name: jdk.jshell-17.0.5-src.zip File size: 302589 bytes Release date: 2022-09-13 Download
⇒ JDK 17 jdk.jsobject.jmod - JS Object Module
2023-08-03, ≈39🔥, 0💬
Popular Posts:
What is the sax\Counter.java provided in the Apache Xerces package? I have Apache Xerces 2.11.0 inst...
Java Architecture for XML Binding (JAXB) is a Java API that allows Java developers to map Java class...
What Is log4j-1.2.15.jar? I got the JAR file from apache-log4j-1.2.15.zip. log4j-1.2.15.jar is the v...
JRE 8 plugin.jar is the JAR file for JRE 8 Java Control Panel Plugin interface and tools. JRE (Java ...
maven-core-3.8.6.jar is the JAR file for Apache Maven 3.8.6 Core module. Apache Maven is a software ...