Class ShellServer
- java.lang.Object
-
- io.vertx.mutiny.ext.shell.ShellServer
-
public class ShellServer extends Object
The shell server. A shell server is associated with a collection of : theregisterTermServer(io.vertx.mutiny.ext.shell.term.TermServer)
method registers a term server. Term servers life cycle are managed by this server. When a receives an incoming connection, a instance is created and associated with this connection. ThecreateShell(io.vertx.mutiny.ext.shell.term.Term)
method can be used to create instance for testing purposes. NOTE: This class has been automatically generated from theoriginal
non Mutiny-ified interface using Vert.x codegen.
-
-
Field Summary
Fields Modifier and Type Field Description static TypeArg<ShellServer>
__TYPE_ARG
-
Constructor Summary
Constructors Constructor Description ShellServer(io.vertx.ext.shell.ShellServer delegate)
ShellServer(Object delegate)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description io.smallrye.mutiny.Uni<Void>
close()
Close the shell server, this is an asynchronous close.Void
closeAndAwait()
Blocking variant ofclose()
.void
closeAndForget()
Variant ofclose()
that ignores the result of the operation.static ShellServer
create(Vertx vertx)
static ShellServer
create(Vertx vertx, io.vertx.ext.shell.ShellServerOptions options)
Shell
createShell()
Shell
createShell(Term term)
boolean
equals(Object o)
io.vertx.ext.shell.ShellServer
getDelegate()
int
hashCode()
io.smallrye.mutiny.Uni<Void>
listen()
Start the shell service, this is an asynchronous start.Void
listenAndAwait()
Blocking variant oflisten()
.ShellServer
listenAndForget()
Variant oflisten()
that ignores the result of the operation.static ShellServer
newInstance(io.vertx.ext.shell.ShellServer arg)
ShellServer
registerCommandResolver(CommandResolver resolver)
ShellServer
registerTermServer(TermServer termServer)
void
shellHandler(Consumer<Shell> shellHandler)
String
toString()
-
-
-
Field Detail
-
__TYPE_ARG
public static final TypeArg<ShellServer> __TYPE_ARG
-
-
Constructor Detail
-
ShellServer
public ShellServer(io.vertx.ext.shell.ShellServer delegate)
-
ShellServer
public ShellServer(Object delegate)
-
-
Method Detail
-
getDelegate
public io.vertx.ext.shell.ShellServer getDelegate()
-
create
public static ShellServer create(Vertx vertx, io.vertx.ext.shell.ShellServerOptions options)
- Parameters:
vertx
- the vertxoptions
- the options- Returns:
- the created shell server
-
create
public static ShellServer create(Vertx vertx)
- Parameters:
vertx
- the vertx- Returns:
- the created shell server
-
registerCommandResolver
public ShellServer registerCommandResolver(CommandResolver resolver)
- Parameters:
resolver
- the resolver- Returns:
- a reference to this, so the API can be used fluently
-
registerTermServer
public ShellServer registerTermServer(TermServer termServer)
- Parameters:
termServer
- the term server to add- Returns:
- a reference to this, so the API can be used fluently
-
createShell
public Shell createShell(Term term)
- Parameters:
term
- the shell associated terminal- Returns:
- the created shell
-
createShell
public Shell createShell()
- Returns:
- the created shell
-
listen
public io.smallrye.mutiny.Uni<Void> listen()
Start the shell service, this is an asynchronous start.Unlike the bare Vert.x variant, this method returns a
Uni
. Don't forget to subscribe on it to trigger the operation.- Returns:
- the
uni
firing the result of the operation when completed, or a failure if the operation failed.
-
listenAndAwait
public Void listenAndAwait()
Blocking variant oflisten()
.This method waits for the completion of the underlying asynchronous operation. If the operation completes successfully, the result is returned, otherwise the failure is thrown (potentially wrapped in a RuntimeException).
- Returns:
- the Void instance produced by the operation.
-
listenAndForget
public ShellServer listenAndForget()
Variant oflisten()
that ignores the result of the operation.This method subscribes on the result of
listen()
, but discards the outcome (item or failure). This method is useful to trigger the asynchronous operation fromlisten()
but you don't need to compose it with other operations.- Returns:
- the instance of ShellServer to chain method calls.
-
close
public io.smallrye.mutiny.Uni<Void> close()
Close the shell server, this is an asynchronous close.Unlike the bare Vert.x variant, this method returns a
Uni
. Don't forget to subscribe on it to trigger the operation.- Returns:
- the
uni
firing the result of the operation when completed, or a failure if the operation failed.
-
closeAndAwait
public Void closeAndAwait()
Blocking variant ofclose()
.This method waits for the completion of the underlying asynchronous operation. If the operation completes successfully, the result is returned, otherwise the failure is thrown (potentially wrapped in a RuntimeException).
- Returns:
- the Void instance produced by the operation.
-
closeAndForget
public void closeAndForget()
-
shellHandler
public void shellHandler(Consumer<Shell> shellHandler)
- Parameters:
shellHandler
- handler for getting notified when the server creates a new shell.
-
newInstance
public static ShellServer newInstance(io.vertx.ext.shell.ShellServer arg)
-
-