Class List Method List File List

# Class: VertxShell::JobController

Inherits:
  Object
  - Object
  - VertxShell::JobController
  show all
Defined in:
  /Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-shell/job_controller.rb

## Overview

The job controller.

## Constant Summary

@@j_api_type =

      Object.new

## Class Method Summary (collapse)

- + (Boolean) accept?(obj)
- + (Object) j_api_type
- + (Object) j_class
- + (Object) unwrap(obj)
- + (Object) wrap(obj)

## 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
  The current foreground job.
- - (::VertxShell::Job) get_job(id = nil)
  Returns an active job in this session by its .
- - (Set<::VertxShell::Job>) jobs
  The active jobs.

## Class Method Details

### + (`Boolean`) accept?(obj)

Returns:

- (`Boolean`)

    19
    20
    21
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-shell/job_controller.rb', line 19

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

### + (`Object`) j_api_type

    28
    29
    30
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-shell/job_controller.rb', line 28

    def self.j_api_type
      @@j_api_type
    end

### + (`Object`) j_class

    31
    32
    33
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-shell/job_controller.rb', line 31

    def self.j_class
      Java::IoVertxExtShellSystem::JobController.java_class
    end

### + (`Object`) unwrap(obj)

    25
    26
    27
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-shell/job_controller.rb', line 25

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

### + (`Object`) wrap(obj)

    22
    23
    24
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-shell/job_controller.rb', line 22

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

## 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.

Yields:

Raises:

- (`ArgumentError`)

    70
    71
    72
    73
    74
    75
    76
    77
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-shell/job_controller.rb', line 70

    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.

Parameters:

- process (`::VertxShell::Process`) (defaults to: `nil`) —
  the process
- line (`String`) (defaults to: `nil`) —
  the line

Returns:

- (`::VertxShell::Job`) —
  the created job

Raises:

- (`ArgumentError`)

    61
    62
    63
    64
    65
    66
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-shell/job_controller.rb', line 61

    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

Returns the current foreground job

Returns:

- (`::VertxShell::Job`) —
  the current foreground job

Raises:

- (`ArgumentError`)

    35
    36
    37
    38
    39
    40
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-shell/job_controller.rb', line 35

    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 .

Parameters:

- id (`Fixnum`) (defaults to: `nil`) —
  the job id

Returns:

- (`::VertxShell::Job`) —
  the job of when not found

Raises:

- (`ArgumentError`)

    51
    52
    53
    54
    55
    56
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-shell/job_controller.rb', line 51

    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

Returns the active jobs

Returns:

- (`Set<::VertxShell::Job>`) —
  the active jobs

Raises:

- (`ArgumentError`)

    42
    43
    44
    45
    46
    47
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-shell/job_controller.rb', line 42

    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