|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.mucommander.process.AbstractProcess
public abstract class AbstractProcess
muCommander specific version of a process.
Implementations of this class are used to execute various types of processes.
It can be a LocalProcess, but some types of
abstract files, such as SFTP files,
allow for commands to be executed.
Unlike normal instances of java.lang.Process, abstract processes
will empty their own streams, preventing deadlocks from occuring on some systems.
Note that abstract processes should not be created directly. They should be
instanciated through ProcessRunner.execute(String[],com.mucommander.file.AbstractFile,ProcessListener).
| Constructor Summary | |
|---|---|
AbstractProcess()
|
|
| Method Summary | |
|---|---|
void |
destroy()
Kills the process. |
protected abstract void |
destroyProcess()
Destroys the process. |
abstract int |
exitValue()
Returns this process' exit value. |
abstract java.io.InputStream |
getErrorStream()
Returns the process' standard error stream. |
abstract java.io.InputStream |
getInputStream()
Returns the process' standard output stream. |
abstract java.io.OutputStream |
getOutputStream()
Returns the stream used to send data to the process. |
abstract boolean |
usesMergedStreams()
Returns true if this process only uses one output stream. |
abstract int |
waitFor()
Makes the current thread wait for the process to die. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public AbstractProcess()
| Method Detail |
|---|
public final void destroy()
public abstract boolean usesMergedStreams()
true if this process only uses one output stream.
Some processes will use a single stream for their standard error and standard output streams. Such
processes should return true here to prevent both streams from being monitored.
Note that if a process uses merged streams, getInputStream() will be monitored.
true if this process merges his output streams, false otherwise.
public abstract int waitFor()
throws java.lang.InterruptedException,
java.io.IOException
java.lang.InterruptedException - thrown if the current thread is interrupted while wainting on the process to die.
java.io.IOException - thrown if an error occurs while waiting for the process to die.
protected abstract void destroyProcess()
throws java.io.IOException
java.io.IOException - thrown if an error occurs while destroying the process.public abstract int exitValue()
public abstract java.io.OutputStream getOutputStream()
throws java.io.IOException
java.io.IOException - thrown if an error occurs while retrieving the process' output stream.
public abstract java.io.InputStream getInputStream()
throws java.io.IOException
java.io.IOException - thrown if an error occurs while retrieving the process' input stream.
public abstract java.io.InputStream getErrorStream()
throws java.io.IOException
java.io.IOException - thrown if an error occurs while retrieving the process' error stream.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
This file is part of muCommander - Copyright (C) 2002-2008 Maxence Bernard