Class: VertxShell::ShellService

Inherits:
Object
  • Object
show all
Defined in:
/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-shell/shell_service.rb

Overview

The shell service, provides a remotely accessible shell available via Telnet or SSH according to the => Object} configuration.

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

Constant Summary

@@j_api_type =
Object.new

Class Method Summary (collapse)

Instance Method Summary (collapse)

Class Method Details

+ (Boolean) accept?(obj)

Returns:

  • (Boolean)


24
25
26
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-shell/shell_service.rb', line 24

def @@j_api_type.accept?(obj)
  obj.class == ShellService
end

+ (::VertxShell::ShellService) create(vertx) + (::VertxShell::ShellService) create(vertx, options)

Create a new shell service.

Overloads:

Returns:



104
105
106
107
108
109
110
111
112
113
114
115
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-shell/shell_service.rb', line 104

def self.create(*args)
  if args[0].class.method_defined?(:j_del) && !block_given? && args[1] == nil
    return ::Vertx::Util::Utils.safe_create(Java::IoVertxExtShell::ShellService.java_method(:create, [Java::IoVertxCore::Vertx.java_class]).call(args[0].j_del),::VertxShell::ShellService)
  elsif args[0].class.method_defined?(:j_del) && args[1].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(args[0].j_del,Java::IoVertxExtShell::ShellServiceOptions.new(::Vertx::Util::Utils.to_json_object(args[1]))),::VertxShell::ShellService)
  end
  if defined?(super)
    super
  else
    raise ArgumentError, "Invalid arguments when calling create(#{args[0]},#{args[1]})"
  end
end

+ (Object) j_api_type



33
34
35
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-shell/shell_service.rb', line 33

def self.j_api_type
  @@j_api_type
end

+ (Object) j_class



36
37
38
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-shell/shell_service.rb', line 36

def self.j_class
  Java::IoVertxExtShell::ShellService.java_class
end

+ (Object) unwrap(obj)



30
31
32
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-shell/shell_service.rb', line 30

def @@j_api_type.unwrap(obj)
  obj.j_del
end

+ (Object) wrap(obj)



27
28
29
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-shell/shell_service.rb', line 27

def @@j_api_type.wrap(obj)
  ShellService.new(obj)
end

Instance Method Details

- (::VertxShell::ShellServer) server

Returns the shell server

Returns:



41
42
43
44
45
46
47
48
49
50
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-shell/shell_service.rb', line 41

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

- (void) start - (void) start(startHandler) { ... }

This method returns an undefined value.

Start the shell service, this is an asynchronous start.

Overloads:

  • - (void) start(startHandler) { ... }

    Yields:

    • handler for getting notified when service is started


79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-shell/shell_service.rb', line 79

def start
  if !block_given?
    return @j_del.java_method(:start, []).call()
  elsif true
    if (block_given?)
      return @j_del.java_method(:start, [Java::IoVertxCore::Handler.java_class]).call(block_given? ? Proc.new { |ar| yield(ar.failed ? ar.cause : nil, ar.succeeded ? nil : nil) } : promise)
    else
      promise = ::Vertx::Util::Utils.promise
      @j_del.java_method(:start, [Java::IoVertxCore::Handler.java_class]).call(block_given? ? Proc.new { |ar| yield(ar.failed ? ar.cause : nil, ar.succeeded ? nil : nil) } : promise)
      return ::Vertx::Util::Utils.safe_create(promise.future(),::Vertx::Future, nil)
    end
  end
  if defined?(super)
    super
  else
    raise ArgumentError, "Invalid arguments when calling start()"
  end
end

- (void) stop - (void) stop(stopHandler) { ... }

This method returns an undefined value.

Stop the shell service, this is an asynchronous start.

Overloads:

  • - (void) stop(stopHandler) { ... }

    Yields:

    • handler for getting notified when service is stopped


56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-shell/shell_service.rb', line 56

def stop
  if !block_given?
    return @j_del.java_method(:stop, []).call()
  elsif true
    if (block_given?)
      return @j_del.java_method(:stop, [Java::IoVertxCore::Handler.java_class]).call(block_given? ? Proc.new { |ar| yield(ar.failed ? ar.cause : nil, ar.succeeded ? nil : nil) } : promise)
    else
      promise = ::Vertx::Util::Utils.promise
      @j_del.java_method(:stop, [Java::IoVertxCore::Handler.java_class]).call(block_given? ? Proc.new { |ar| yield(ar.failed ? ar.cause : nil, ar.succeeded ? nil : nil) } : promise)
      return ::Vertx::Util::Utils.safe_create(promise.future(),::Vertx::Future, nil)
    end
  end
  if defined?(super)
    super
  else
    raise ArgumentError, "Invalid arguments when calling stop()"
  end
end