Package io.vertx.ext.shell
Interface ShellServer
-
public interface ShellServer
The shell server. A shell server is associated with a collection ofterm servers
: theregisterTermServer(TermServer)
method registers a term server. Term servers life cycle are managed by this server. When aterm server
receives an incoming connection, aJobController
instance is created and associated with this connection. ThecreateShell()
method can be used to createJobController
instance for testing purposes.- Author:
- Julien Viet
-
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Modifier and Type Method Description Future<Void>
close()
Close the shell server, this is an asynchronous close.static ShellServer
create(Vertx vertx)
Create a new shell server with specific options.static ShellServer
create(Vertx vertx, ShellServerOptions options)
Create a new shell server with default options.Shell
createShell()
Create a new shell, the returned shell should be closed explicitely.Shell
createShell(Term term)
Create a new shell, the returned shell should be closed explicitely.Future<Void>
listen()
Start the shell service, this is an asynchronous start.ShellServer
registerCommandResolver(CommandResolver resolver)
Register a command resolver for this server.ShellServer
registerTermServer(TermServer termServer)
Register a term server to this shell server, the term server lifecycle methods are managed by this shell server.void
shellHandler(Handler<Shell> shellHandler)
Called when a new shell is created.
-
-
-
Method Detail
-
create
static ShellServer create(Vertx vertx, ShellServerOptions options)
Create a new shell server with default options.- Parameters:
vertx
- the vertxoptions
- the options- Returns:
- the created shell server
-
create
static ShellServer create(Vertx vertx)
Create a new shell server with specific options.- Parameters:
vertx
- the vertx- Returns:
- the created shell server
-
registerCommandResolver
ShellServer registerCommandResolver(CommandResolver resolver)
Register a command resolver for this server.- Parameters:
resolver
- the resolver- Returns:
- a reference to this, so the API can be used fluently
-
registerTermServer
ShellServer registerTermServer(TermServer termServer)
Register a term server to this shell server, the term server lifecycle methods are managed by this shell server.- Parameters:
termServer
- the term server to add- Returns:
- a reference to this, so the API can be used fluently
-
createShell
Shell createShell(Term term)
Create a new shell, the returned shell should be closed explicitely.- Parameters:
term
- the shell associated terminal- Returns:
- the created shell
-
createShell
Shell createShell()
Create a new shell, the returned shell should be closed explicitely.- Returns:
- the created shell
-
-