Class ShellServer


  • public class ShellServer
    extends Object
    The shell server.

    A shell server is associated with a collection of : the registerTermServer(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.

    The createShell(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 the original non Mutiny-ified interface using Vert.x codegen.

    • 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()
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object
      • create

        public static ShellServer create​(Vertx vertx,
                                         io.vertx.ext.shell.ShellServerOptions options)
        Parameters:
        vertx - the vertx
        options - 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 of listen().

        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 of listen() 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 from listen() 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 of close().

        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()
        Variant of close() that ignores the result of the operation.

        This method subscribes on the result of close(), but discards the outcome (item or failure). This method is useful to trigger the asynchronous operation from close() but you don't need to compose it with other operations.

      • 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)