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)


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

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

+ (::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{String => Object}) (defaults to: nil)
    the service config options

Returns:

Raises:

  • (ArgumentError)


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

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

+ (Object) j_api_type



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

def self.j_api_type
  @@j_api_type
end

+ (Object) j_class



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

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

+ (Object) unwrap(obj)



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

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

+ (Object) wrap(obj)



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

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

Instance Method Details

- (::VertxShell::ShellServer) server

Returns the shell server

Returns:

Raises:

  • (ArgumentError)


62
63
64
65
66
67
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-shell/shell_service.rb', line 62

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)


53
54
55
56
57
58
59
60
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-shell/shell_service.rb', line 53

def start
  if !block_given?
    return @j_del.java_method(:start, []).call()
  elsif true
    return @j_del.java_method(:start, [Java::IoVertxCore::Handler.java_class]).call((Proc.new { |ar| yield(ar.failed ? ar.cause : nil) } unless !block_given?))
  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)


71
72
73
74
75
76
77
78
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-shell/shell_service.rb', line 71

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