Class: VertxShell::ShellService

Inherits:
Object
  • Object
show all
Defined in:
/Users/julien/java/vertx-aggregator/modules/vertx-shell/src/main/resources/vertx-shell/shell_service.rb

Overview

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

Class Method Summary (collapse)

Instance Method Summary (collapse)

Class Method Details

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

Parameters:

  • vertx (::Vertx::Vertx) (defaults to: nil)
  • options (Hash) (defaults to: nil)

Returns:

Raises:

  • (ArgumentError)


22
23
24
25
26
27
# File '/Users/julien/java/vertx-aggregator/modules/vertx-shell/src/main/resources/vertx-shell/shell_service.rb', line 22

def self.create(vertx=nil,options=nil)
  if 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::CommandRegistry) get_command_registry

@return the command registry for this service

Returns:

Raises:

  • (ArgumentError)


30
31
32
33
34
35
# File '/Users/julien/java/vertx-aggregator/modules/vertx-shell/src/main/resources/vertx-shell/shell_service.rb', line 30

def get_command_registry
  if !block_given?
    return ::Vertx::Util::Utils.safe_create(@j_del.java_method(:getCommandRegistry, []).call(),::VertxShell::CommandRegistry)
  end
  raise ArgumentError, "Invalid arguments when calling get_command_registry()"
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)


39
40
41
42
43
44
45
46
# File '/Users/julien/java/vertx-aggregator/modules/vertx-shell/src/main/resources/vertx-shell/shell_service.rb', line 39

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)


50
51
52
53
54
55
56
57
# File '/Users/julien/java/vertx-aggregator/modules/vertx-shell/src/main/resources/vertx-shell/shell_service.rb', line 50

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