Class List Method List File List

# Class: VertxShell::ShellServer

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

## Class Method Summary (collapse)

- + (Object) create(vertx = nil, options = nil)

## Instance Method Summary (collapse)

- - (Object) close
- - (Object) create_shell(term = nil)
- - (ShellServer) initialize(j_del) constructor
  A new instance of ShellServer.
- - (Object) j_del
- - (Object) listen
- - (Object) register_command_resolver(resolver = nil)
- - (Object) register_term_server(termServer = nil)

## Constructor Details

### - (`ShellServer`) initialize(j_del)

Returns a new instance of ShellServer

    21
    22
    23
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-shell/shell_server.rb', line 21

    def initialize(j_del)
      @j_del = j_del
    end

## Class Method Details

### + (`Object`) create(vertx = nil, options = nil)

Raises:

- (`ArgumentError`)

    33
    34
    35
    36
    37
    38
    39
    40
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-shell/shell_server.rb', line 33

    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::ShellServer.java_method(:create, [Java::IoVertxCore::Vertx.java_class]).call(vertx.j_del),::VertxShell::ShellServer)
      elsif vertx.class.method_defined?(:j_del) && options.class == Hash && !block_given?
        return ::Vertx::Util::Utils.safe_create(Java::IoVertxExtShell::ShellServer.java_method(:create, [Java::IoVertxCore::Vertx.java_class,Java::IoVertxExtShell::ShellServerOptions.java_class]).call(vertx.j_del,Java::IoVertxExtShell::ShellServerOptions.new(::Vertx::Util::Utils.to_json_object(options))),::VertxShell::ShellServer)
      end
      raise ArgumentError, "Invalid arguments when calling create(vertx,options)"
    end

## Instance Method Details

### - (`Object`) close

Raises:

- (`ArgumentError`)

    88
    89
    90
    91
    92
    93
    94
    95
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-shell/shell_server.rb', line 88

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

### - (`Object`) create_shell(term = nil)

Raises:

- (`ArgumentError`)

    64
    65
    66
    67
    68
    69
    70
    71
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-shell/shell_server.rb', line 64

    def create_shell(term=nil)
      if !block_given? && term == nil
        return ::Vertx::Util::Utils.safe_create(@j_del.java_method(:createShell, []).call(),::VertxShell::Shell)
      elsif term.class.method_defined?(:j_del) && !block_given?
        return ::Vertx::Util::Utils.safe_create(@j_del.java_method(:createShell, [Java::IoVertxExtShellTerm::Term.java_class]).call(term.j_del),::VertxShell::Shell)
      end
      raise ArgumentError, "Invalid arguments when calling create_shell(term)"
    end

### - (`Object`) j_del

    26
    27
    28
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-shell/shell_server.rb', line 26

    def j_del
      @j_del
    end

### - (`Object`) listen

Raises:

- (`ArgumentError`)

    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-shell/shell_server.rb', line 75

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

### - (`Object`) register_command_resolver(resolver = nil)

Raises:

- (`ArgumentError`)

    44
    45
    46
    47
    48
    49
    50
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-shell/shell_server.rb', line 44

    def register_command_resolver(resolver=nil)
      if resolver.class.method_defined?(:j_del) && !block_given?
        @j_del.java_method(:registerCommandResolver, [Java::IoVertxExtShellCommand::CommandResolver.java_class]).call(resolver.j_del)
        return self
      end
      raise ArgumentError, "Invalid arguments when calling register_command_resolver(resolver)"
    end

### - (`Object`) register_term_server(termServer = nil)

Raises:

- (`ArgumentError`)

    54
    55
    56
    57
    58
    59
    60
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-shell/shell_server.rb', line 54

    def register_term_server(termServer=nil)
      if termServer.class.method_defined?(:j_del) && !block_given?
        @j_del.java_method(:registerTermServer, [Java::IoVertxExtShellTerm::TermServer.java_class]).call(termServer.j_del)
        return self
      end
      raise ArgumentError, "Invalid arguments when calling register_term_server(termServer)"
    end