Class: VertxShell::ShellService
- Inherits:
-
Object
- Object
- VertxShell::ShellService
- 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)
- + (Boolean) accept?(obj)
-
+ (::VertxShell::ShellService) create(*args)
Create a new shell service.
- + (Object) j_api_type
- + (Object) j_class
- + (Object) unwrap(obj)
- + (Object) wrap(obj)
Instance Method Summary (collapse)
-
- (::VertxShell::ShellServer) server
The shell server.
-
- (void) start(startHandler) { ... }
Start the shell service, this is an asynchronous start.
-
- (void) stop(stopHandler) { ... }
Stop the shell service, this is an asynchronous start.
Class Method Details
+ (Boolean) accept?(obj)
25 26 27 |
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-shell/shell_service.rb', line 25 def @@j_api_type.accept?(obj) obj.class == ShellService end |
+ (::VertxShell::ShellService) create(vertx) + (::VertxShell::ShellService) create(vertx, options)
Create a new shell service.
99 100 101 102 103 104 105 106 107 108 109 110 |
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-shell/shell_service.rb', line 99 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
34 35 36 |
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-shell/shell_service.rb', line 34 def self.j_api_type @@j_api_type end |
+ (Object) j_class
37 38 39 |
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-shell/shell_service.rb', line 37 def self.j_class Java::IoVertxExtShell::ShellService.java_class end |
+ (Object) unwrap(obj)
31 32 33 |
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-shell/shell_service.rb', line 31 def @@j_api_type.unwrap(obj) obj.j_del end |
+ (Object) wrap(obj)
28 29 30 |
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-shell/shell_service.rb', line 28 def @@j_api_type.wrap(obj) ShellService.new(obj) end |
Instance Method Details
- (::VertxShell::ShellServer) server
Returns the shell server
42 43 44 45 46 47 48 49 50 51 |
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-shell/shell_service.rb', line 42 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(startHandler) { ... }
This method returns an undefined value.
Start the shell service, this is an asynchronous start.
76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 |
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-shell/shell_service.rb', line 76 def start if 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(stopHandler) { ... }
This method returns an undefined value.
Stop the shell service, this is an asynchronous start.
56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 |
# 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 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 |