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 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/JdiExecutionControl.java
/*
* Copyright (c) 2014, 2017, Oracle and/or its affiliates. All rights reserved.
* ORACLE PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*/
package jdk.jshell.execution;
import java.io.ObjectInput;
import java.io.ObjectOutput;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.stream.Stream;
import com.sun.jdi.ReferenceType;
import com.sun.jdi.VirtualMachine;
import jdk.jshell.spi.ExecutionControl;
import static java.util.stream.Collectors.toMap;
/**
* Abstract JDI implementation of {@link jdk.jshell.spi.ExecutionControl}.
*
* @since 9
*/
public abstract class JdiExecutionControl extends StreamingExecutionControl implements ExecutionControl {
/**
* Mapping from class names to JDI {@link ReferenceType}.
*/
private final Map<String, ReferenceType> toReferenceType = new HashMap<>();
/**
* Create an instance.
* @param out the output from the remote agent
* @param in the input to the remote agent
*/
protected JdiExecutionControl(ObjectOutput out, ObjectInput in) {
super(out, in);
}
/**
* Returns the JDI {@link VirtualMachine} instance.
*
* @return the virtual machine
* @throws EngineTerminationException if the VM is dead/disconnected
*/
protected abstract VirtualMachine vm() throws EngineTerminationException;
/**
* Redefine the specified classes. Where 'redefine' is, as in JDI and JVMTI,
* an in-place replacement of the classes (preserving class identity) --
* that is, existing references to the class do not need to be recompiled.
* This implementation uses JDI
* {@link com.sun.jdi.VirtualMachine#redefineClasses(java.util.Map) }.
* It will be unsuccessful if
* the signature of the class has changed (see the JDI spec). The
* JShell-core is designed to adapt to unsuccessful redefine.
*/
@Override
public void redefine(ClassBytecodes[] cbcs)
throws ClassInstallException, EngineTerminationException {
try {
// Convert to the JDI ReferenceType to class bytes map form needed
// by JDI.
VirtualMachine vm = vm();
Map<ReferenceType, byte[]> rmp = Stream.of(cbcs)
.collect(toMap(
cbc -> referenceType(vm, cbc.name()),
cbc -> cbc.bytecodes()));
// Attempt redefine. Throws exceptions on failure.
vm().redefineClasses(rmp);
} catch (EngineTerminationException ex) {
throw ex;
} catch (Exception ex) {
throw new ClassInstallException("redefine: " + ex.getMessage(), new boolean[cbcs.length]);
}
// forward the redefine to remote-end to register the redefined bytecode
try {
super.redefine(cbcs);
} catch (NotImplementedException ex) {
// this remote doesn't care about registering bytecode, so we don't either
}
}
/**
* Returns the JDI {@link ReferenceType} corresponding to the specified
* class name.
*
* @param vm the current JDI {@link VirtualMachine} as returned by
* {@code vm()}
* @param name the class name to look-up
* @return the corresponding {@link ReferenceType}
*/
protected ReferenceType referenceType(VirtualMachine vm, String name) {
return toReferenceType.computeIfAbsent(name, n -> nameToRef(vm, n));
}
private static ReferenceType nameToRef(VirtualMachine vm, String name) {
List<ReferenceType> rtl = vm.classesByName(name);
if (rtl.size() != 1) {
return null;
}
return rtl.get(0);
}
}
⏎ jdk/jshell/execution/JdiExecutionControl.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, ≈51🔥, 0💬
Popular Posts:
Apache Neethi provides general framework for the programmers to use WS Policy. It is compliant with ...
XOM™ is a new XML object model. It is an open source (LGPL), tree-based API for processing XML with ...
Apache ZooKeeper is an open-source server which enables highly reliable distributed coordination. Ap...
iText is an ideal library for developers looking to enhance web- and other applications with dynamic...
commons-lang-2.6.jar is the JAR file for Apache Commons Lang 2.6, which provides a host of helper ut...