Package io.vertx.ext.shell.command
Interface CommandProcess
-
- All Superinterfaces:
Tty
public interface CommandProcess extends Tty
The command process provides interaction with the process of the command provided by Vert.x Shell.- Author:
- Julien Viet
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description List<String>
args()
List<CliToken>
argsTokens()
CommandProcess
backgroundHandlerโ(Handler<Void> handler)
Set a background handler, this handler is called when the command is running and put to background.CommandLine
commandLine()
void
end()
End the process with the exit status 0void
endโ(int status)
End the process.CommandProcess
endHandlerโ(Handler<Void> handler)
Set an end handler, this handler is called when the command is ended, for instance the command is running and the shell closes.CommandProcess
foregroundHandlerโ(Handler<Void> handler)
Set a foreground handler, this handler is called when the command is running and put to foreground.CommandProcess
interruptHandlerโ(Handler<Void> handler)
Set an interrupt handler, this handler is called when the command is interrupted, for instance user pressCtrl-C
.boolean
isForeground()
CommandProcess
resizehandlerโ(Handler<Void> handler)
Set a resize handler, the handler is called when the tty size changes.CommandProcess
resumeHandlerโ(Handler<Void> handler)
Set a resume handler, this handler is called when the command is resumed, for instance user typesbg
orfg
to resume the command.Session
session()
CommandProcess
stdinHandlerโ(Handler<String> handler)
Set a stream handler on the standard input to read the data.CommandProcess
suspendHandlerโ(Handler<Void> handler)
Set a suspend handler, this handler is called when the command is suspended, for instance user pressCtrl-Z
.Vertx
vertx()
CommandProcess
writeโ(String data)
Write some text to the standard output.
-
-
-
Method Detail
-
vertx
Vertx vertx()
- Returns:
- the current Vert.x instance
-
commandLine
CommandLine commandLine()
- Returns:
- the command line object or null
-
session
Session session()
- Returns:
- the shell session
-
isForeground
boolean isForeground()
- Returns:
- true if the command is running in foreground
-
stdinHandler
CommandProcess stdinHandlerโ(Handler<String> handler)
Description copied from interface:Tty
Set a stream handler on the standard input to read the data.- Specified by:
stdinHandler
in interfaceTty
- Parameters:
handler
- the standard input- Returns:
- this object
-
interruptHandler
CommandProcess interruptHandlerโ(Handler<Void> handler)
Set an interrupt handler, this handler is called when the command is interrupted, for instance user pressCtrl-C
.- Parameters:
handler
- the interrupt handler- Returns:
- this command
-
suspendHandler
CommandProcess suspendHandlerโ(Handler<Void> handler)
Set a suspend handler, this handler is called when the command is suspended, for instance user pressCtrl-Z
.- Parameters:
handler
- the interrupt handler- Returns:
- this command
-
resumeHandler
CommandProcess resumeHandlerโ(Handler<Void> handler)
Set a resume handler, this handler is called when the command is resumed, for instance user typesbg
orfg
to resume the command.- Parameters:
handler
- the interrupt handler- Returns:
- this command
-
endHandler
CommandProcess endHandlerโ(Handler<Void> handler)
Set an end handler, this handler is called when the command is ended, for instance the command is running and the shell closes.- Parameters:
handler
- the end handler- Returns:
- a reference to this, so the API can be used fluently
-
write
CommandProcess writeโ(String data)
Write some text to the standard output.
-
backgroundHandler
CommandProcess backgroundHandlerโ(Handler<Void> handler)
Set a background handler, this handler is called when the command is running and put to background.- Parameters:
handler
- the background handler- Returns:
- this command
-
foregroundHandler
CommandProcess foregroundHandlerโ(Handler<Void> handler)
Set a foreground handler, this handler is called when the command is running and put to foreground.- Parameters:
handler
- the foreground handler- Returns:
- this command
-
resizehandler
CommandProcess resizehandlerโ(Handler<Void> handler)
Description copied from interface:Tty
Set a resize handler, the handler is called when the tty size changes.- Specified by:
resizehandler
in interfaceTty
- Parameters:
handler
- the resize handler- Returns:
- this object
-
end
void end()
End the process with the exit status 0
-
end
void endโ(int status)
End the process.- Parameters:
status
- the exit status.
-
-