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 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/LocalExecutionControl.java
/* * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved. * ORACLE PROPRIETARY/CONFIDENTIAL. Use is subject to license terms. * * * * * * * * * * * * * * * * * * * * */ package jdk.jshell.execution; import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Method; import java.util.concurrent.atomic.AtomicReference; /** * An implementation of {@link jdk.jshell.spi.ExecutionControl} which executes * in the same JVM as the JShell-core. * * @author Grigory Ptashko * @since 9 */ public class LocalExecutionControl extends DirectExecutionControl { private final Object STOP_LOCK = new Object(); private boolean userCodeRunning = false; private ThreadGroup execThreadGroup; /** * Creates an instance, delegating loader operations to the specified * delegate. * * @param loaderDelegate the delegate to handle loading classes */ public LocalExecutionControl(LoaderDelegate loaderDelegate) { super(loaderDelegate); } /** * Create an instance using the default class loading. */ public LocalExecutionControl() { } @Override protected String invoke(Method doitMethod) throws Exception { execThreadGroup = new ThreadGroup("JShell process local execution"); AtomicReference<InvocationTargetException> iteEx = new AtomicReference<>(); AtomicReference<IllegalAccessException> iaeEx = new AtomicReference<>(); AtomicReference<NoSuchMethodException> nmeEx = new AtomicReference<>(); AtomicReference<Boolean> stopped = new AtomicReference<>(false); Thread.setDefaultUncaughtExceptionHandler((t, e) -> { if (e instanceof InvocationTargetException) { if (e.getCause() instanceof ThreadDeath) { stopped.set(true); } else { iteEx.set((InvocationTargetException) e); } } else if (e instanceof IllegalAccessException) { iaeEx.set((IllegalAccessException) e); } else if (e instanceof NoSuchMethodException) { nmeEx.set((NoSuchMethodException) e); } else if (e instanceof ThreadDeath) { stopped.set(true); } }); final Object[] res = new Object[1]; Thread snippetThread = new Thread(execThreadGroup, () -> { try { res[0] = doitMethod.invoke(null, new Object[0]); } catch (InvocationTargetException e) { if (e.getCause() instanceof ThreadDeath) { stopped.set(true); } else { iteEx.set(e); } } catch (IllegalAccessException e) { iaeEx.set(e); } catch (ThreadDeath e) { stopped.set(true); } }); snippetThread.start(); Thread[] threadList = new Thread[execThreadGroup.activeCount()]; execThreadGroup.enumerate(threadList); for (Thread thread : threadList) { if (thread != null) { thread.join(); } } if (stopped.get()) { throw new StoppedException(); } if (iteEx.get() != null) { throw iteEx.get(); } else if (nmeEx.get() != null) { throw nmeEx.get(); } else if (iaeEx.get() != null) { throw iaeEx.get(); } return valueString(res[0]); } @Override @SuppressWarnings({"deprecation", "removal"}) public void stop() throws EngineTerminationException, InternalException { synchronized (STOP_LOCK) { if (!userCodeRunning) { return; } if (execThreadGroup == null) { throw new InternalException("Process-local code snippets thread group is null. Aborting stop."); } execThreadGroup.stop(); } } @Override protected void clientCodeEnter() { synchronized (STOP_LOCK) { userCodeRunning = true; } } @Override protected void clientCodeLeave() { synchronized (STOP_LOCK) { userCodeRunning = false; } } }
⏎ jdk/jshell/execution/LocalExecutionControl.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, 5879👍, 0💬
Popular Posts:
How to download and install JDK (Java Development Kit) 6? If you want to write Java applications, yo...
commons-net.jar is the bytecode of Apache Commons Net library, which implements the client side of m...
JAX-WS is an API for building web services and clients. It is the next generation Web Services API r...
JDK 8 tools.jar is the JAR file for JDK 8 tools. It contains Java classes to support different JDK t...
What JAR files are required to run sax\Writer.java provided in the Apache Xerces package? 1 JAR file...