Categories:
Audio (13)
Biotech (29)
Bytecode (36)
Database (77)
Framework (7)
Game (7)
General (507)
Graphics (53)
I/O (35)
IDE (2)
JAR Tools (101)
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 (309)
Collections:
Other Resources:
JDK 11 jdk.jshell.jmod - JShell Tool
JDK 11 jdk.jshell.jmod is the JMOD file for JDK 11 JShell tool, which can be invoked by the "jshell" command.
JDK 11 JShell tool compiled class files are stored in \fyicenter\jdk-11.0.1\jmods\jdk.jshell.jmod.
JDK 11 JShell tool compiled class files are also linked and stored in the \fyicenter\jdk-11.0.1\lib\modules JImage file.
JDK 11 JShell tool source code files are stored in \fyicenter\jdk-11.0.1\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/StreamingExecutionControl.java
/* * Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. * ORACLE PROPRIETARY/CONFIDENTIAL. Use is subject to license terms. * * * * * * * * * * * * * * * * * * * * */ package jdk.jshell.execution; import java.io.IOException; import java.io.ObjectInput; import java.io.ObjectOutput; import jdk.jshell.JShellException; import jdk.jshell.spi.ExecutionControl; import static jdk.jshell.execution.ExecutionControlForwarder.NULL_MARKER; import static jdk.jshell.execution.RemoteCodes.*; /** * An implementation of the {@link jdk.jshell.spi.ExecutionControl} * execution engine SPI which streams requests to a remote agent where * execution takes place. * * @author Robert Field * @since 9 */ public class StreamingExecutionControl implements ExecutionControl { private final ObjectOutput out; private final ObjectInput in; /** * Creates an instance. * * @param out the output for commands * @param in the input for command responses */ public StreamingExecutionControl(ObjectOutput out, ObjectInput in) { this.out = out; this.in = in; } @Override public void load(ClassBytecodes[] cbcs) throws ClassInstallException, NotImplementedException, EngineTerminationException { try { // Send a load command to the remote agent. writeCommand(CMD_LOAD); out.writeObject(cbcs); out.flush(); // Retrieve and report results from the remote agent. readAndReportClassInstallResult(); } catch (IOException ex) { throw new EngineTerminationException("Exception writing remote load: " + ex); } } @Override public void redefine(ClassBytecodes[] cbcs) throws ClassInstallException, NotImplementedException, EngineTerminationException { try { // Send a load command to the remote agent. writeCommand(CMD_REDEFINE); out.writeObject(cbcs); out.flush(); // Retrieve and report results from the remote agent. readAndReportClassInstallResult(); } catch (IOException ex) { throw new EngineTerminationException("Exception writing remote redefine: " + ex); } } @Override public String invoke(String classname, String methodname) throws RunException, EngineTerminationException, InternalException { try { // Send the invoke command to the remote agent. writeCommand(CMD_INVOKE); out.writeUTF(classname); out.writeUTF(methodname); out.flush(); // Retrieve and report results from the remote agent. readAndReportExecutionResult(); String result = in.readUTF(); return result; } catch (IOException ex) { throw new EngineTerminationException("Exception writing remote invoke: " + ex); } } @Override public String varValue(String classname, String varname) throws RunException, EngineTerminationException, InternalException { try { // Send the variable-value command to the remote agent. writeCommand(CMD_VAR_VALUE); out.writeUTF(classname); out.writeUTF(varname); out.flush(); // Retrieve and report results from the remote agent. readAndReportExecutionResult(); String result = in.readUTF(); return result; } catch (IOException ex) { throw new EngineTerminationException("Exception writing remote varValue: " + ex); } } @Override public void addToClasspath(String path) throws EngineTerminationException, InternalException { try { // Send the classpath addition command to the remote agent. writeCommand(CMD_ADD_CLASSPATH); out.writeUTF(path); out.flush(); // Retrieve and report results from the remote agent. readAndReportClassSimpleResult(); } catch (IOException ex) { throw new EngineTerminationException("Exception writing remote add to classpath: " + ex); } } @Override public void stop() throws EngineTerminationException, InternalException { try { // Send the variable-value command to the remote agent. writeCommand(CMD_STOP); out.flush(); } catch (IOException ex) { throw new EngineTerminationException("Exception writing remote stop: " + ex); } } @Override public Object extensionCommand(String command, Object arg) throws RunException, EngineTerminationException, InternalException { try { writeCommand(command); out.writeObject(arg); out.flush(); // Retrieve and report results from the remote agent. readAndReportExecutionResult(); Object result = in.readObject(); return result; } catch (IOException | ClassNotFoundException ex) { throw new EngineTerminationException("Exception transmitting remote extensionCommand: " + command + " -- " + ex); } } /** * Closes the execution engine. Send an exit command to the remote agent. */ @Override public void close() { try { writeCommand(CMD_CLOSE); out.flush(); } catch (IOException ex) { // ignore; } } private void writeCommand(String cmd) throws IOException { out.writeInt(COMMAND_PREFIX); out.writeUTF(cmd); } /** * Read a UTF or a null encoded as a null marker. * @return a string or null * @throws IOException passed through from readUTF() */ private String readNullOrUTF() throws IOException { String s = in.readUTF(); return s.equals(NULL_MARKER) ? null : s; } /** * Reports results from a remote agent command that does not expect * exceptions. */ private void readAndReportClassSimpleResult() throws EngineTerminationException, InternalException { try { int status = in.readInt(); switch (status) { case RESULT_SUCCESS: return; case RESULT_NOT_IMPLEMENTED: { String message = in.readUTF(); throw new NotImplementedException(message); } case RESULT_INTERNAL_PROBLEM: { String message = in.readUTF(); throw new InternalException(message); } case RESULT_TERMINATED: { String message = in.readUTF(); throw new EngineTerminationException(message); } default: { throw new EngineTerminationException("Bad remote result code: " + status); } } } catch (IOException ex) { throw new EngineTerminationException(ex.toString()); } } /** * Reports results from a remote agent command that does not expect * exceptions. */ private void readAndReportClassInstallResult() throws ClassInstallException, NotImplementedException, EngineTerminationException { try { int status = in.readInt(); switch (status) { case RESULT_SUCCESS: return; case RESULT_NOT_IMPLEMENTED: { String message = in.readUTF(); throw new NotImplementedException(message); } case RESULT_CLASS_INSTALL_EXCEPTION: { String message = in.readUTF(); boolean[] loaded = (boolean[]) in.readObject(); throw new ClassInstallException(message, loaded); } case RESULT_TERMINATED: { String message = in.readUTF(); throw new EngineTerminationException(message); } default: { throw new EngineTerminationException("Bad remote result code: " + status); } } } catch (IOException | ClassNotFoundException ex) { throw new EngineTerminationException(ex.toString()); } } /** * Reports results from a remote agent command that expects runtime * exceptions. * * @return true if successful * @throws IOException if the connection has dropped * @throws JShellException {@link jdk.jshell.EvalException}, if a user * exception was encountered on invoke; * {@link jdk.jshell.UnresolvedReferenceException}, if an unresolved * reference was encountered * @throws java.lang.ClassNotFoundException */ private void readAndReportExecutionResult() throws RunException, EngineTerminationException, InternalException { try { int status = in.readInt(); switch (status) { case RESULT_SUCCESS: return; case RESULT_NOT_IMPLEMENTED: { String message = in.readUTF(); throw new NotImplementedException(message); } case RESULT_USER_EXCEPTION: { // A user exception was encountered. Handle pre JDK 11 back-ends throw readUserException(); } case RESULT_CORRALLED: { // An unresolved reference was encountered. throw readResolutionException(); } case RESULT_USER_EXCEPTION_CHAINED: { // A user exception was encountered -- transmit chained. in.readInt(); // always RESULT_USER_EXCEPTION UserException result = readUserException(); RunException caused = result; // Loop through the chained causes (if any) building a chained exception loop: while (true) { RunException ex; int cstatus = in.readInt(); switch (cstatus) { case RESULT_USER_EXCEPTION: { // A user exception was the proximal cause. ex = readUserException(); break; } case RESULT_CORRALLED: { // An unresolved reference was the underlying cause. ex = readResolutionException(); break; } case RESULT_SUCCESS: { // End of chained exceptions break loop; } default: { throw new EngineTerminationException("Bad chained remote result code: " + cstatus); } } caused.initCause(ex); caused = ex; } caused.initCause(null); // root cause has no cause throw result; } case RESULT_STOPPED: { // Execution was aborted by the stop() throw new StoppedException(); } case RESULT_INTERNAL_PROBLEM: { // An internal error has occurred. String message = in.readUTF(); throw new InternalException(message); } case RESULT_TERMINATED: { String message = in.readUTF(); throw new EngineTerminationException(message); } default: { throw new EngineTerminationException("Bad remote result code: " + status); } } } catch (IOException | ClassNotFoundException ex) { ex.printStackTrace(); throw new EngineTerminationException(ex.toString()); } } private UserException readUserException() throws IOException, ClassNotFoundException { String message = readNullOrUTF(); String exceptionClassName = in.readUTF(); StackTraceElement[] elems = (StackTraceElement[]) in.readObject(); return new UserException(message, exceptionClassName, elems); } private ResolutionException readResolutionException() throws IOException, ClassNotFoundException { int id = in.readInt(); StackTraceElement[] elems = (StackTraceElement[]) in.readObject(); return new ResolutionException(id, elems); } }
⏎ jdk/jshell/execution/StreamingExecutionControl.java
Or download all of them as a single archive file:
File name: jdk.jshell-11.0.1-src.zip File size: 283093 bytes Release date: 2018-11-04 Download
⇒ JDK 11 jdk.jsobject.jmod - JS Object Module
2020-06-30, 29364👍, 0💬
Popular Posts:
JDK 11 jdk.scripting.nashorn.jm odis the JMOD file for JDK 11 Scripting Nashorn module. JDK 11 Scrip...
What JAR files are required to run dom\Counter.java provided in the Apache Xerces package? You can f...
How to download and install JDK (Java Development Kit) 1.4? If you want to write Java applications, ...
JDK 11 jdk.localedata.jmod is the JMOD file for JDK 11 Localedata module. JDK 11 Locale Data module ...
This package is the backport of java.util.concurrent API, introduced in Java 5.0 and further refined...