Package: com.multiversesocial.hyperview
Class: com.multiversesocial.hyperview.HyperProcess
Source: src/com/multiversesocial/hyperview/HyperProcess.java

HyperProcess

HyperView V3.2 — class
version V3.2 class

Summary

A basic Process wrapper. By Tony Swain Converted for JDK 26 - replaced deprecated Runtime.exec() with ProcessBuilder Replace deprecated Runtime.exec() with ProcessBuilder

Source file: HyperProcess.java

Hierarchy

Extends: Process

Implements: ProcessListener

Referenced HyperView classes

Media files used

Declaration & members

public class HyperProcess extends Process implements ProcessListener

Declared in src/com/multiversesocial/hyperview/HyperProcess.java, lines 9–426. 16 field(s), 3 constructor(s), 16 method(s), plus 3 nested type(s). Every member has an anchor you can link to (e.g. HyperProcess.html#<id>).

Fields (16)

DeclarationValue / initializerDescriptionSource
volatile HyperProcess.IOStreamExitHandler exitHandlerNo comment in source; assigned in HyperProcess(); used in destroy().line 20
static char fileSeparator= System.getProperty("file.separator").charAt(0)No comment in source; used in ps(); name appears in 8 other source file(s): Directory, Enfora2218WhackButton, Externalizer, HyperFileList ….line 27
int idNo comment in source; assigned in HyperProcess(); used in onStart(), onStop().line 23
public static volatile HyperLinkedList listenerList= new HyperLinkedList()No comment in source; used in onStart(), onStop(); name appears in 3 other source file(s): InterProcessMemory, ObjectRegistry, PortInfo.line 16
volatile Process parentProcessNo comment in source; assigned in HyperProcess(); used in destroy(), exitValue(), waitFor(), info().line 21
volatile Component parentViewNo comment in source; name appears in 7 other source file(s): HyperChannel, HyperConnectionHandler, HyperExternalConnectionHandler, HyperNBInputHandler ….line 11
public static volatile HyperLinkedList processList= new HyperLinkedList()No comment in source; used in HyperProcess(), destroy().line 15
static volatile String[] processString= new String[stringSpace]No comment in source; assigned in setStringSpace(); used in ps().line 26
volatile InputStream stderrNo comment in source; assigned in HyperProcess(); used in getErrorStream().line 14
volatile HyperProcess.IOStreamHandler stderrHandlerNo comment in source; assigned in HyperProcess(); used in destroy().line 18
volatile InputStream stdinNo comment in source; assigned in HyperProcess(); used in getInputStream().line 12
volatile HyperProcess.IOStreamHandler stdinHandlerNo comment in source; assigned in HyperProcess(); used in destroy().line 19
volatile OutputStream stdoutNo comment in source; assigned in HyperProcess(); used in getOutputStream().line 13
static volatile int stringSpace= 80No comment in source; assigned in setStringSpace().line 24
static volatile int totalProcesses= 0No comment in source; name appears in 1 other source file(s): InterProcessMemory.line 25

Constructors (3)

SignatureDescriptionSource
HyperProcess()5 statement(s); calls super().line 29
HyperProcess(String tExecString)1 statement(s); calls this().line 37
HyperProcess(Component tComponent, String tExecString)20 statement(s); calls super(), tExecString.split(), pb.directory(), System.getProperty(), pb.redirectErrorStream() …; creates ProcessBuilder, File, ProcessLink.line 42

Methods (16)

SignatureDescriptionSource
static { … }Implicit default constructor generated by the compiler (not written in the source).implicit
public void destroy()8 statement(s); calls toString(), stdinHandler.destroy(), stderrHandler.destroy(), exitHandler.stop(), processList.dlDelete() ….
Overrides Process.destroy()
line 150
public static HyperProcess exec(String tExecString)Returns new HyperProcess((Component)null, tExecString).line 88
public int exitValue()2 statement(s); calls parentProcess.exitValue().
Overrides Process.exitValue()
line 172
public InputStream getErrorStream()Returns stderr.
Overrides Process.getErrorStream()
line 181
public InputStream getInputStream()Returns stdin.
Overrides Process.getInputStream()
line 186
public OutputStream getOutputStream()Returns stdout.
Overrides Process.getOutputStream()
line 191
public ProcessHandle.Info info()2 statement(s); calls parentProcess.info().
Overrides Process.info()
line 219
public static void main(String[] args)6 statement(s); calls HyperProcess.ps().line 408
public void onStart()Cont channel runtime_run / BridgeRun start hook.line 228
public void onStop()Cont ContHalt / CloseNetXecChannel halt-join order.line 238
public static String[] ps()6 statement(s); calls pb.redirectErrorStream(), pb.start(), System.getenv(), System.exit(), p.getInputStream() …; creates ProcessBuilder, BufferedReader, InputStreamReader.line 99
public void setStringSpace(int tInt)2 statement(s).line 93
public void signal(int tSignal)1 statement(s).
Implements ProcessListener.signal()
line 248
public int waitFor() throws InterruptedException3 statement(s); calls parentProcess.waitFor(), wait(), notifyAll().
Overrides Process.waitFor()
line 196
public boolean waitFor(long timeout, TimeUnit unit) throws InterruptedException2 statement(s); calls parentProcess.waitFor().
Overrides Process.waitFor()
line 210

Nested & additional classes

class ProcessLink extends Linkable

Fields (1)

DeclarationValue / initializerDescriptionSource

Constructors (1)

SignatureDescriptionSource

Methods (0)

None declared.

IOStreamHandler (nested type, lines 264–357)

class IOStreamHandler implements Runnable

Fields (4)

DeclarationValue / initializerDescriptionSource
volatile InputStream ios_stdinNo comment in source; assigned in IOStreamHandler(); used in run(), destroy().line 267
volatile OutputStream ios_stdoutNo comment in source; assigned in IOStreamHandler(); used in destroy().line 268
volatile Thread ioStreamTaskNo comment in source; assigned in IOStreamHandler(), start(), stop(), destroy(); used in run().line 266
volatile boolean running= trueNo comment in source; assigned in start(), stop(), destroy(); used in run().line 269

Constructors (1)

SignatureDescriptionSource
IOStreamHandler(InputStream tIn, OutputStream tOut)4 statement(s); calls super(); creates Thread.line 271

Methods (4)

SignatureDescriptionSource
void destroy()5 statement(s); calls tThread.interrupt(), ios_stdin.close(), ios_stdout.close(), e.printStackTrace().line 338
public void run()6 statement(s); calls Thread.currentThread(), bufferedReader.ready(), bufferedReader.readLine(), Thread.sleep(), Thread.currentThread().interrupt() …; creates InputStreamReader, BufferedReader.
Implements Runnable.run()
line 302
public void start()5 statement(s); calls tIOStreamTask.interrupt(), ioStreamTask.start(); creates Thread.line 278
public void stop()4 statement(s); calls tIOStreamTask.interrupt().line 291

IOStreamExitHandler (nested type, lines 359–406)

class IOStreamExitHandler implements Runnable

Fields (2)

DeclarationValue / initializerDescriptionSource
Thread exitThreadNo comment in source; assigned in start(), stop().line 361
volatile boolean running= trueNo comment in source; assigned in start(), stop(); used in run().line 362

Constructors (1)

SignatureDescriptionSource
IOStreamExitHandler()1 statement(s); calls super().line 364

Methods (3)

SignatureDescriptionSource
public void run()2 statement(s); calls parentProcess.waitFor(), Thread.currentThread().interrupt(), Thread.currentThread(), destroy().
Implements Runnable.run()
line 386
public void start()3 statement(s); calls exitThread.start(); creates Thread.line 368
public void stop()4 statement(s); calls tThread.interrupt().line 375

Inherited members

Non-private members inherited from HyperView superclasses and not overridden or hidden here.

Also inherits the public/protected members of java.lang.Process (JDK class) and its superclasses.

Examples

Real usage taken from elsewhere in the HyperView 3.2 source (file and line shown; source path src/com/multiversesocial/hyperview/).

instantiation — TVDispatch.java, line 22

   22  HyperProcess tHyperProcess = new HyperProcess(curView,tvString);

declaration — HyperView.java, line 37

   37  HyperProcess process;

declaration — STDInputHandler.java, line 59

   59  STDInputHandler(HyperProcess tProcess)
   60  {
Hits--