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.scripting.nashorn.shell.jmod - Scripting Nashorn Shell Module
JDK 11 jdk.scripting.nashorn.shell.jmod is the JMOD file for JDK 11 Scripting Nashorn Shell module.
JDK 11 Scripting Nashorn Shell module compiled class files are stored in \fyicenter\jdk-11.0.1\jmods\jdk.scripting.nashorn.shell.jmod.
JDK 11 Scripting Nashorn Shell module compiled class files are also linked and stored in the \fyicenter\jdk-11.0.1\lib\modules JImage file.
JDK 11 Scripting Nashorn Shell module source code files are stored in \fyicenter\jdk-11.0.1\lib\src.zip\jdk.scripting.nashorn.shell.
You can click and view the content of each source code file in the list below.
✍: FYIcenter
⏎ jdk/nashorn/tools/jjs/ExternalEditor.java
/* * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. * ORACLE PROPRIETARY/CONFIDENTIAL. Use is subject to license terms. * * * * * * * * * * * * * * * * * * * * */ package jdk.nashorn.tools.jjs; import java.io.IOException; import java.nio.charset.Charset; import java.nio.file.ClosedWatchServiceException; import java.nio.file.FileSystems; import java.nio.file.Files; import java.nio.file.Path; import java.nio.file.WatchKey; import java.nio.file.WatchService; import java.util.List; import java.util.function.Consumer; import static java.nio.file.StandardWatchEventKinds.ENTRY_CREATE; import static java.nio.file.StandardWatchEventKinds.ENTRY_DELETE; import static java.nio.file.StandardWatchEventKinds.ENTRY_MODIFY; final class ExternalEditor { private final Consumer<String> errorHandler; private final Consumer<String> saveHandler; private final Console input; private WatchService watcher; private Thread watchedThread; private Path dir; private Path tmpfile; ExternalEditor(final Consumer<String> errorHandler, final Consumer<String> saveHandler, final Console input) { this.errorHandler = errorHandler; this.saveHandler = saveHandler; this.input = input; } private void edit(final String cmd, final String initialText) { try { setupWatch(initialText); launch(cmd); } catch (IOException ex) { errorHandler.accept(ex.getMessage()); } } /** * Creates a WatchService and registers the given directory */ private void setupWatch(final String initialText) throws IOException { this.watcher = FileSystems.getDefault().newWatchService(); this.dir = Files.createTempDirectory("REPL"); this.tmpfile = Files.createTempFile(dir, null, ".js"); Files.write(tmpfile, initialText.getBytes(Charset.forName("UTF-8"))); dir.register(watcher, ENTRY_CREATE, ENTRY_DELETE, ENTRY_MODIFY); watchedThread = new Thread(() -> { for (;;) { WatchKey key; try { key = watcher.take(); } catch (final ClosedWatchServiceException ex) { break; } catch (final InterruptedException ex) { continue; // tolerate an intrupt } if (!key.pollEvents().isEmpty()) { if (!input.terminalEditorRunning()) { saveFile(); } } boolean valid = key.reset(); if (!valid) { errorHandler.accept("Invalid key"); break; } } }); watchedThread.start(); } private void launch(final String cmd) throws IOException { ProcessBuilder pb = new ProcessBuilder(cmd, tmpfile.toString()); pb = pb.inheritIO(); try { input.suspend(); Process process = pb.start(); process.waitFor(); } catch (final IOException ex) { errorHandler.accept("process IO failure: " + ex.getMessage()); } catch (final InterruptedException ex) { errorHandler.accept("process interrupt: " + ex.getMessage()); } finally { try { watcher.close(); watchedThread.join(); //so that saveFile() is finished. saveFile(); } catch (InterruptedException ex) { errorHandler.accept("process interrupt: " + ex.getMessage()); } finally { input.resume(); } } } private void saveFile() { List<String> lines; try { lines = Files.readAllLines(tmpfile); } catch (final IOException ex) { errorHandler.accept("Failure read edit file: " + ex.getMessage()); return ; } StringBuilder sb = new StringBuilder(); for (String ln : lines) { sb.append(ln); sb.append('\n'); } saveHandler.accept(sb.toString()); } static void edit(final String cmd, final Consumer<String> errorHandler, final String initialText, final Consumer<String> saveHandler, final Console input) { ExternalEditor ed = new ExternalEditor(errorHandler, saveHandler, input); ed.edit(cmd, initialText); } }
⏎ jdk/nashorn/tools/jjs/ExternalEditor.java
Or download all of them as a single archive file:
File name: jdk.scripting.nashorn.shell-11.0.1-src.zip File size: 22002 bytes Release date: 2018-11-04 Download
⇒ JDK 11 jdk.sctp.jmod - SCTP Module
⇐ JDK 11 jdk.scripting.nashorn.jmod - Scripting Nashorn Module
2019-12-02, ∼6737🔥, 0💬
Popular Posts:
JDK 11 java.management.jmod is the JMOD file for JDK 11 Management module. JDK 11 Management module ...
maven-embedder-3.8.6.jar is the JAR file for Apache Maven 3.8.6 Embedder module. Apache Maven is a s...
How to display XML element type information with the jaxp\TypeInfoWriter.java provided in the Apache...
Java Cryptography Extension 1.2.2 JAR File Size and Download Location: File name: jce.jar, jce-1.2.2...
JDK 11 jdk.compiler.jmod is the JMOD file for JDK 11 Compiler tool, which can be invoked by the "jav...