Class: VertxShell::JobController
- Inherits:
-
Object
- Object
- VertxShell::JobController
- Defined in:
- /Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-shell/job_controller.rb
Overview
The job controller.
Instance Method Summary (collapse)
-
- (void) close { ... }
Close the controller and terminate all the underlying jobs, a closed controller does not accept anymore jobs.
-
- (::VertxShell::Job) create_job(process = nil, line = nil)
Create a job wrapping a process.
-
- (::VertxShell::Job) foreground_job
@return the current foreground job.
-
- (::VertxShell::Job) get_job(id = nil)
Returns an active job in this session by its .
-
- (Set<::VertxShell::Job>) jobs
@return the active jobs.
Instance Method Details
- (void) close { ... }
This method returns an undefined value.
Close the controller and terminate all the underlying jobs, a closed controller does not accept anymore jobs.
56 57 58 59 60 61 62 63 |
# File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-shell/job_controller.rb', line 56 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 { yield }) end raise ArgumentError, "Invalid arguments when calling close()" end |
- (::VertxShell::Job) create_job(process = nil, line = nil)
Create a job wrapping a process.
47 48 49 50 51 52 |
# File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-shell/job_controller.rb', line 47 def create_job(process=nil,line=nil) if process.class.method_defined?(:j_del) && line.class == String && !block_given? return ::Vertx::Util::Utils.safe_create(@j_del.java_method(:createJob, [Java::IoVertxExtShellSystem::Process.java_class,Java::java.lang.String.java_class]).call(process.j_del,line),::VertxShell::Job) end raise ArgumentError, "Invalid arguments when calling create_job(process,line)" end |
- (::VertxShell::Job) foreground_job
@return the current foreground job
20 21 22 23 24 25 |
# File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-shell/job_controller.rb', line 20 def foreground_job if !block_given? return ::Vertx::Util::Utils.safe_create(@j_del.java_method(:foregroundJob, []).call(),::VertxShell::Job) end raise ArgumentError, "Invalid arguments when calling foreground_job()" end |
- (::VertxShell::Job) get_job(id = nil)
Returns an active job in this session by its .
37 38 39 40 41 42 |
# File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-shell/job_controller.rb', line 37 def get_job(id=nil) if id.class == Fixnum && !block_given? return ::Vertx::Util::Utils.safe_create(@j_del.java_method(:getJob, [Java::int.java_class]).call(id),::VertxShell::Job) end raise ArgumentError, "Invalid arguments when calling get_job(id)" end |
- (Set<::VertxShell::Job>) jobs
@return the active jobs
28 29 30 31 32 33 |
# File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-shell/job_controller.rb', line 28 def jobs if !block_given? return ::Vertx::Util::Utils.to_set(@j_del.java_method(:jobs, []).call()).map! { |elt| ::Vertx::Util::Utils.safe_create(elt,::VertxShell::Job) } end raise ArgumentError, "Invalid arguments when calling jobs()" end |