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.internal.le.jmod - Internal Line Editing Module
JDK 17 jdk.internal.le.jmod is the JMOD file for JDK 17 Internal Line Editing module.
JDK 17 Internal Line Editing module compiled class files are stored in \fyicenter\jdk-17.0.5\jmods\jdk.internal.le.jmod.
JDK 17 Internal Line Editing module compiled class files are also linked and stored in the \fyicenter\jdk-17.0.5\lib\modules JImage file.
JDK 17 Internal Line Editing module source code files are stored in \fyicenter\jdk-17.0.5\lib\src.zip\jdk.internal.le.
You can click and view the content of each source code file in the list below.
✍: FYIcenter
⏎ jdk/internal/org/jline/terminal/impl/ExternalTerminal.java
/*
* Copyright (c) 2002-2018, the original author or authors.
*
* This software is distributable under the BSD license. See the terms of the
* BSD license in the documentation provided with this software.
*
* https://opensource.org/licenses/BSD-3-Clause
*/
package jdk.internal.org.jline.terminal.impl;
import jdk.internal.org.jline.terminal.Attributes;
import jdk.internal.org.jline.terminal.Cursor;
import jdk.internal.org.jline.terminal.Size;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.nio.charset.Charset;
import java.util.concurrent.atomic.AtomicBoolean;
import java.util.function.IntConsumer;
/**
* Console implementation with embedded line disciplined.
*
* This terminal is well-suited for supporting incoming external
* connections, such as from the network (through telnet, ssh,
* or any kind of protocol).
* The terminal will start consuming the input in a separate thread
* to generate interruption events.
*
* @see LineDisciplineTerminal
*/
public class ExternalTerminal extends LineDisciplineTerminal {
protected final AtomicBoolean closed = new AtomicBoolean();
protected final InputStream masterInput;
protected final Object lock = new Object();
protected boolean paused = true;
protected Thread pumpThread;
public ExternalTerminal(String name, String type,
InputStream masterInput,
OutputStream masterOutput,
Charset encoding) throws IOException {
this(name, type, masterInput, masterOutput, encoding, SignalHandler.SIG_DFL);
}
public ExternalTerminal(String name, String type,
InputStream masterInput,
OutputStream masterOutput,
Charset encoding,
SignalHandler signalHandler) throws IOException {
this(name, type, masterInput, masterOutput, encoding, signalHandler, false);
}
public ExternalTerminal(String name, String type,
InputStream masterInput,
OutputStream masterOutput,
Charset encoding,
SignalHandler signalHandler,
boolean paused) throws IOException {
this(name, type, masterInput, masterOutput, encoding, signalHandler, paused, null, null);
}
public ExternalTerminal(String name, String type,
InputStream masterInput,
OutputStream masterOutput,
Charset encoding,
SignalHandler signalHandler,
boolean paused,
Attributes attributes,
Size size) throws IOException {
super(name, type, masterOutput, encoding, signalHandler);
this.masterInput = masterInput;
if (attributes != null) {
setAttributes(attributes);
}
if (size != null) {
setSize(size);
}
if (!paused) {
resume();
}
}
protected void doClose() throws IOException {
if (closed.compareAndSet(false, true)) {
pause();
super.doClose();
}
}
@Override
public boolean canPauseResume() {
return true;
}
@Override
public void pause() {
synchronized (lock) {
paused = true;
}
}
@Override
public void pause(boolean wait) throws InterruptedException {
Thread p;
synchronized (lock) {
paused = true;
p = pumpThread;
}
if (p != null) {
p.interrupt();
p.join();
}
}
@Override
public void resume() {
synchronized (lock) {
paused = false;
if (pumpThread == null) {
pumpThread = new Thread(this::pump, toString() + " input pump thread");
pumpThread.setDaemon(true);
pumpThread.start();
}
}
}
@Override
public boolean paused() {
synchronized (lock) {
return paused;
}
}
public void pump() {
try {
byte[] buf = new byte[1024];
while (true) {
int c = masterInput.read(buf);
if (c >= 0) {
processInputBytes(buf, 0, c);
}
if (c < 0 || closed.get()) {
break;
}
synchronized (lock) {
if (paused) {
pumpThread = null;
return;
}
}
}
} catch (IOException e) {
processIOException(e);
} finally {
synchronized (lock) {
pumpThread = null;
}
}
try {
slaveInput.close();
} catch (IOException e) {
// ignore
}
}
@Override
public Cursor getCursorPosition(IntConsumer discarded) {
return CursorSupport.getCursorPosition(this, discarded);
}
}
⏎ jdk/internal/org/jline/terminal/impl/ExternalTerminal.java
Or download all of them as a single archive file:
File name: jdk.internal.le-17.0.5-src.zip File size: 231458 bytes Release date: 2022-09-13 Download
⇒ JDK 17 jdk.internal.opt.jmod - Internal Opt Module
⇐ JDK 17 jdk.internal.jvmstat.jmod - Internal JVM Stat Module
2023-08-25, ≈39🔥, 0💬
Popular Posts:
Java Servlet API 3.0.1 Source Code Files are important if you want to compile them with different JD...
commons-io-2.6-sources.j aris the source JAR file for Apache Commons IO 2.6, which is a library of u...
The Java Naming and Directory Interface (JNDI) is part of the Java platform, providing applications ...
SLF4J API is a simple API that allows to plug in any desired logging library at deployment time. Her...
Where Can I get source code files of jsse.jar? You can get source code files of jsse.jar (JSSE) from...