Class List Method List File List

# Class: VertxShell::ShellService

Inherits:
  Object
  - Object
  - VertxShell::ShellService
  show all
Defined in:
  /Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-shell/shell_service.rb

## Overview

The shell service, provides a remotely accessible shell available via Telnet or SSH according to the Hash configuration.

The shell service will expose commands using CommandResolver on the classpath and the shared command registry for the Vert.x instance.

## Class Method Summary (collapse)

- + (::VertxShell::ShellService) create(vertx = nil, options = nil)
  Create a new shell service.

## Instance Method Summary (collapse)

- - (::VertxShell::ShellServer) server
  @return the shell server.
- - (void) start { ... }
  Start the shell service, this is an asynchronous start.
- - (void) stop { ... }
  Stop the shell service, this is an asynchronous start.

## Class Method Details

### + (`::VertxShell::ShellService`) create(vertx = nil, options = nil)

Create a new shell service.

Parameters:

- vertx (`::Vertx::Vertx`) (defaults to: `nil`) —
  the Vert.x instance
- options (`Hash`) (defaults to: `nil`) —
  the service config options

Returns:

- (`::VertxShell::ShellService`) —
  the shell service

Raises:

- (`ArgumentError`)

    26
    27
    28
    29
    30
    31
    32
    33
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-shell/shell_service.rb', line 26

    def self.create(vertx=nil,options=nil)
      if vertx.class.method_defined?(:j_del) && !block_given? && options == nil
        return ::Vertx::Util::Utils.safe_create(Java::IoVertxExtShell::ShellService.java_method(:create, [Java::IoVertxCore::Vertx.java_class]).call(vertx.j_del),::VertxShell::ShellService)
      elsif vertx.class.method_defined?(:j_del) && options.class == Hash && !block_given?
        return ::Vertx::Util::Utils.safe_create(Java::IoVertxExtShell::ShellService.java_method(:create, [Java::IoVertxCore::Vertx.java_class,Java::IoVertxExtShell::ShellServiceOptions.java_class]).call(vertx.j_del,Java::IoVertxExtShell::ShellServiceOptions.new(::Vertx::Util::Utils.to_json_object(options))),::VertxShell::ShellService)
      end
      raise ArgumentError, "Invalid arguments when calling create(vertx,options)"
    end

## Instance Method Details

### - (`::VertxShell::ShellServer`) server

@return the shell server

Returns:

- (`::VertxShell::ShellServer`)

Raises:

- (`ArgumentError`)

    47
    48
    49
    50
    51
    52
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-shell/shell_service.rb', line 47

    def server
      if !block_given?
        return ::Vertx::Util::Utils.safe_create(@j_del.java_method(:server, []).call(),::VertxShell::ShellServer)
      end
      raise ArgumentError, "Invalid arguments when calling server()"
    end

### - (`void`) start { ... }

This method returns an undefined value.

Start the shell service, this is an asynchronous start.

Yields:

- handler for getting notified when service is started

Raises:

- (`ArgumentError`)

    37
    38
    39
    40
    41
    42
    43
    44
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-shell/shell_service.rb', line 37

    def start
      if !block_given?
        return @j_del.java_method(:start, []).call()
      elsif block_given?
        return @j_del.java_method(:start, [Java::IoVertxCore::Handler.java_class]).call((Proc.new { |ar| yield(ar.failed ? ar.cause : nil) }))
      end
      raise ArgumentError, "Invalid arguments when calling start()"
    end

### - (`void`) stop { ... }

This method returns an undefined value.

Stop the shell service, this is an asynchronous start.

Yields:

- handler for getting notified when service is stopped

Raises:

- (`ArgumentError`)

    56
    57
    58
    59
    60
    61
    62
    63
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-shell/shell_service.rb', line 56

    def stop
      if !block_given?
        return @j_del.java_method(:stop, []).call()
      elsif block_given?
        return @j_del.java_method(:stop, [Java::IoVertxCore::Handler.java_class]).call((Proc.new { |ar| yield(ar.failed ? ar.cause : nil) }))
      end
      raise ArgumentError, "Invalid arguments when calling stop()"
    end