Class List Method List File List

# Class: Vertx::Vertx

Inherits:
  Object
  - Object
  - Vertx::Vertx
  show all
Includes:
  Measured
Defined in:
  /Users/julien/java/vertx-stack/stack-docs/target/rb/vertx/vertx.rb

## Class Method Summary (collapse)

- + (Object) clustered_vertx(options = nil)
- + (Object) current_context
- + (Object) vertx(options = nil)

## Instance Method Summary (collapse)

- - (Boolean) cancel_timer?(id = nil)
- - (Object) close
- - (Boolean) clustered?
- - (Object) create_datagram_socket(options = nil)
- - (Object) create_dns_client(port = nil, host = nil)
- - (Object) create_http_client(options = nil)
- - (Object) create_http_server(options = nil)
- - (Object) create_net_client(options = nil)
- - (Object) create_net_server(options = nil)
- - (Object) create_shared_worker_executor(name = nil, poolSize = nil, maxExecuteTime = nil)
- - (Object) deploy_verticle(name = nil, options = nil)
- - (Object) deployment_i_ds
- - (Object) event_bus
- - (Object) exception_handler
- - (Object) execute_blocking(blockingCodeHandler = nil, ordered = nil)
- - (Object) file_system
- - (Object) get_or_create_context
- - (Vertx) initialize(j_del) constructor
  A new instance of Vertx.
- - (Object) j_del
- - (Boolean) metrics_enabled?
- - (Object) periodic_stream(delay = nil)
- - (Object) run_on_context
- - (Object) set_periodic(delay = nil)
- - (Object) set_timer(delay = nil)
- - (Object) shared_data
- - (Object) timer_stream(delay = nil)
- - (Object) undeploy(deploymentID = nil)

## Constructor Details

### - (`Vertx`) initialize(j_del)

Returns a new instance of Vertx

    43
    44
    45
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx/vertx.rb', line 43

    def initialize(j_del)
      @j_del = j_del
    end

## Class Method Details

### + (`Object`) clustered_vertx(options = nil)

Raises:

- (`ArgumentError`)

    76
    77
    78
    79
    80
    81
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx/vertx.rb', line 76

    def self.clustered_vertx(options=nil)
      if options.class == Hash && block_given?
        return Java::IoVertxCore::Vertx.java_method(:clusteredVertx, [Java::IoVertxCore::VertxOptions.java_class,Java::IoVertxCore::Handler.java_class]).call(Java::IoVertxCore::VertxOptions.new(::Vertx::Util::Utils.to_json_object(options)),(Proc.new { |ar| yield(ar.failed ? ar.cause : nil, ar.succeeded ? ::Vertx::Util::Utils.safe_create(ar.result,::Vertx::Vertx) : nil) }))
      end
      raise ArgumentError, "Invalid arguments when calling clustered_vertx(options)"
    end

### + (`Object`) current_context

Raises:

- (`ArgumentError`)

    84
    85
    86
    87
    88
    89
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx/vertx.rb', line 84

    def self.current_context
      if !block_given?
        return ::Vertx::Util::Utils.safe_create(Java::IoVertxCore::Vertx.java_method(:currentContext, []).call(),::Vertx::Context)
      end
      raise ArgumentError, "Invalid arguments when calling current_context()"
    end

### + (`Object`) vertx(options = nil)

Raises:

- (`ArgumentError`)

    62
    63
    64
    65
    66
    67
    68
    69
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx/vertx.rb', line 62

    def self.vertx(options=nil)
      if !block_given? && options == nil
        return ::Vertx::Util::Utils.safe_create(Java::IoVertxCore::Vertx.java_method(:vertx, []).call(),::Vertx::Vertx)
      elsif options.class == Hash && !block_given?
        return ::Vertx::Util::Utils.safe_create(Java::IoVertxCore::Vertx.java_method(:vertx, [Java::IoVertxCore::VertxOptions.java_class]).call(Java::IoVertxCore::VertxOptions.new(::Vertx::Util::Utils.to_json_object(options))),::Vertx::Vertx)
      end
      raise ArgumentError, "Invalid arguments when calling vertx(options)"
    end

## Instance Method Details

### - (`Boolean`) cancel_timer?(id = nil)

Returns:

- (`Boolean`)

Raises:

- (`ArgumentError`)

    241
    242
    243
    244
    245
    246
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx/vertx.rb', line 241

    def cancel_timer?(id=nil)
      if id.class == Fixnum && !block_given?
        return @j_del.java_method(:cancelTimer, [Java::long.java_class]).call(id)
      end
      raise ArgumentError, "Invalid arguments when calling cancel_timer?(id)"
    end

### - (`Object`) close

Raises:

- (`ArgumentError`)

    260
    261
    262
    263
    264
    265
    266
    267
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx/vertx.rb', line 260

    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 { |ar| yield(ar.failed ? ar.cause : nil) }))
      end
      raise ArgumentError, "Invalid arguments when calling close()"
    end

### - (`Boolean`) clustered?

Returns:

- (`Boolean`)

Raises:

- (`ArgumentError`)

    308
    309
    310
    311
    312
    313
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx/vertx.rb', line 308

    def clustered?
      if !block_given?
        return @j_del.java_method(:isClustered, []).call()
      end
      raise ArgumentError, "Invalid arguments when calling clustered?()"
    end

### - (`Object`) create_datagram_socket(options = nil)

Raises:

- (`ArgumentError`)

    145
    146
    147
    148
    149
    150
    151
    152
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx/vertx.rb', line 145

    def create_datagram_socket(options=nil)
      if !block_given? && options == nil
        return ::Vertx::Util::Utils.safe_create(@j_del.java_method(:createDatagramSocket, []).call(),::Vertx::DatagramSocket)
      elsif options.class == Hash && !block_given?
        return ::Vertx::Util::Utils.safe_create(@j_del.java_method(:createDatagramSocket, [Java::IoVertxCoreDatagram::DatagramSocketOptions.java_class]).call(Java::IoVertxCoreDatagram::DatagramSocketOptions.new(::Vertx::Util::Utils.to_json_object(options))),::Vertx::DatagramSocket)
      end
      raise ArgumentError, "Invalid arguments when calling create_datagram_socket(options)"
    end

### - (`Object`) create_dns_client(port = nil, host = nil)

Raises:

- (`ArgumentError`)

    179
    180
    181
    182
    183
    184
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx/vertx.rb', line 179

    def create_dns_client(port=nil,host=nil)
      if port.class == Fixnum && host.class == String && !block_given?
        return ::Vertx::Util::Utils.safe_create(@j_del.java_method(:createDnsClient, [Java::int.java_class,Java::java.lang.String.java_class]).call(port,host),::Vertx::DnsClient)
      end
      raise ArgumentError, "Invalid arguments when calling create_dns_client(port,host)"
    end

### - (`Object`) create_http_client(options = nil)

Raises:

- (`ArgumentError`)

    134
    135
    136
    137
    138
    139
    140
    141
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx/vertx.rb', line 134

    def create_http_client(options=nil)
      if !block_given? && options == nil
        return ::Vertx::Util::Utils.safe_create(@j_del.java_method(:createHttpClient, []).call(),::Vertx::HttpClient)
      elsif options.class == Hash && !block_given?
        return ::Vertx::Util::Utils.safe_create(@j_del.java_method(:createHttpClient, [Java::IoVertxCoreHttp::HttpClientOptions.java_class]).call(Java::IoVertxCoreHttp::HttpClientOptions.new(::Vertx::Util::Utils.to_json_object(options))),::Vertx::HttpClient)
      end
      raise ArgumentError, "Invalid arguments when calling create_http_client(options)"
    end

### - (`Object`) create_http_server(options = nil)

Raises:

- (`ArgumentError`)

    123
    124
    125
    126
    127
    128
    129
    130
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx/vertx.rb', line 123

    def create_http_server(options=nil)
      if !block_given? && options == nil
        return ::Vertx::Util::Utils.safe_create(@j_del.java_method(:createHttpServer, []).call(),::Vertx::HttpServer)
      elsif options.class == Hash && !block_given?
        return ::Vertx::Util::Utils.safe_create(@j_del.java_method(:createHttpServer, [Java::IoVertxCoreHttp::HttpServerOptions.java_class]).call(Java::IoVertxCoreHttp::HttpServerOptions.new(::Vertx::Util::Utils.to_json_object(options))),::Vertx::HttpServer)
      end
      raise ArgumentError, "Invalid arguments when calling create_http_server(options)"
    end

### - (`Object`) create_net_client(options = nil)

Raises:

- (`ArgumentError`)

    112
    113
    114
    115
    116
    117
    118
    119
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx/vertx.rb', line 112

    def create_net_client(options=nil)
      if !block_given? && options == nil
        return ::Vertx::Util::Utils.safe_create(@j_del.java_method(:createNetClient, []).call(),::Vertx::NetClient)
      elsif options.class == Hash && !block_given?
        return ::Vertx::Util::Utils.safe_create(@j_del.java_method(:createNetClient, [Java::IoVertxCoreNet::NetClientOptions.java_class]).call(Java::IoVertxCoreNet::NetClientOptions.new(::Vertx::Util::Utils.to_json_object(options))),::Vertx::NetClient)
      end
      raise ArgumentError, "Invalid arguments when calling create_net_client(options)"
    end

### - (`Object`) create_net_server(options = nil)

Raises:

- (`ArgumentError`)

    101
    102
    103
    104
    105
    106
    107
    108
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx/vertx.rb', line 101

    def create_net_server(options=nil)
      if !block_given? && options == nil
        return ::Vertx::Util::Utils.safe_create(@j_del.java_method(:createNetServer, []).call(),::Vertx::NetServer)
      elsif options.class == Hash && !block_given?
        return ::Vertx::Util::Utils.safe_create(@j_del.java_method(:createNetServer, [Java::IoVertxCoreNet::NetServerOptions.java_class]).call(Java::IoVertxCoreNet::NetServerOptions.new(::Vertx::Util::Utils.to_json_object(options))),::Vertx::NetServer)
      end
      raise ArgumentError, "Invalid arguments when calling create_net_server(options)"
    end

### - (`Object`) create_shared_worker_executor(name = nil, poolSize = nil, maxExecuteTime = nil)

Raises:

- (`ArgumentError`)

    351
    352
    353
    354
    355
    356
    357
    358
    359
    360
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx/vertx.rb', line 351

    def create_shared_worker_executor(name=nil,poolSize=nil,maxExecuteTime=nil)
      if name.class == String && !block_given? && poolSize == nil && maxExecuteTime == nil
        return ::Vertx::Util::Utils.safe_create(@j_del.java_method(:createSharedWorkerExecutor, [Java::java.lang.String.java_class]).call(name),::Vertx::WorkerExecutor)
      elsif name.class == String && poolSize.class == Fixnum && !block_given? && maxExecuteTime == nil
        return ::Vertx::Util::Utils.safe_create(@j_del.java_method(:createSharedWorkerExecutor, [Java::java.lang.String.java_class,Java::int.java_class]).call(name,poolSize),::Vertx::WorkerExecutor)
      elsif name.class == String && poolSize.class == Fixnum && maxExecuteTime.class == Fixnum && !block_given?
        return ::Vertx::Util::Utils.safe_create(@j_del.java_method(:createSharedWorkerExecutor, [Java::java.lang.String.java_class,Java::int.java_class,Java::long.java_class]).call(name,poolSize,maxExecuteTime),::Vertx::WorkerExecutor)
      end
      raise ArgumentError, "Invalid arguments when calling create_shared_worker_executor(name,poolSize,maxExecuteTime)"
    end

### - (`Object`) deploy_verticle(name = nil, options = nil)

Raises:

- (`ArgumentError`)

    274
    275
    276
    277
    278
    279
    280
    281
    282
    283
    284
    285
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx/vertx.rb', line 274

    def deploy_verticle(name=nil,options=nil)
      if name.class == String && !block_given? && options == nil
        return @j_del.java_method(:deployVerticle, [Java::java.lang.String.java_class]).call(name)
      elsif name.class == String && block_given? && options == nil
        return @j_del.java_method(:deployVerticle, [Java::java.lang.String.java_class,Java::IoVertxCore::Handler.java_class]).call(name,(Proc.new { |ar| yield(ar.failed ? ar.cause : nil, ar.succeeded ? ar.result : nil) }))
      elsif name.class == String && options.class == Hash && !block_given?
        return @j_del.java_method(:deployVerticle, [Java::java.lang.String.java_class,Java::IoVertxCore::DeploymentOptions.java_class]).call(name,Java::IoVertxCore::DeploymentOptions.new(::Vertx::Util::Utils.to_json_object(options)))
      elsif name.class == String && options.class == Hash && block_given?
        return @j_del.java_method(:deployVerticle, [Java::java.lang.String.java_class,Java::IoVertxCore::DeploymentOptions.java_class,Java::IoVertxCore::Handler.java_class]).call(name,Java::IoVertxCore::DeploymentOptions.new(::Vertx::Util::Utils.to_json_object(options)),(Proc.new { |ar| yield(ar.failed ? ar.cause : nil, ar.succeeded ? ar.result : nil) }))
      end
      raise ArgumentError, "Invalid arguments when calling deploy_verticle(name,options)"
    end

### - (`Object`) deployment_i_ds

Raises:

- (`ArgumentError`)

    300
    301
    302
    303
    304
    305
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx/vertx.rb', line 300

    def deployment_i_ds
      if !block_given?
        return ::Vertx::Util::Utils.to_set(@j_del.java_method(:deploymentIDs, []).call()).map! { |elt| elt }
      end
      raise ArgumentError, "Invalid arguments when calling deployment_i_ds()"
    end

### - (`Object`) event_bus

Raises:

- (`ArgumentError`)

    166
    167
    168
    169
    170
    171
    172
    173
    174
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx/vertx.rb', line 166

    def event_bus
      if !block_given?
        if @cached_event_bus != nil
          return @cached_event_bus
        end
        return @cached_event_bus = ::Vertx::Util::Utils.safe_create(@j_del.java_method(:eventBus, []).call(),::Vertx::EventBus)
      end
      raise ArgumentError, "Invalid arguments when calling event_bus()"
    end

### - (`Object`) exception_handler

Raises:

- (`ArgumentError`)

    364
    365
    366
    367
    368
    369
    370
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx/vertx.rb', line 364

    def exception_handler
      if block_given?
        @j_del.java_method(:exceptionHandler, [Java::IoVertxCore::Handler.java_class]).call((Proc.new { |event| yield(::Vertx::Util::Utils.from_throwable(event)) }))
        return self
      end
      raise ArgumentError, "Invalid arguments when calling exception_handler()"
    end

### - (`Object`) execute_blocking(blockingCodeHandler = nil, ordered = nil)

Raises:

- (`ArgumentError`)

    331
    332
    333
    334
    335
    336
    337
    338
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx/vertx.rb', line 331

    def execute_blocking(blockingCodeHandler=nil,ordered=nil)
      if blockingCodeHandler.class == Proc && block_given? && ordered == nil
        return @j_del.java_method(:executeBlocking, [Java::IoVertxCore::Handler.java_class,Java::IoVertxCore::Handler.java_class]).call((Proc.new { |event| blockingCodeHandler.call(::Vertx::Util::Utils.safe_create(event,::Vertx::Future)) }),(Proc.new { |ar| yield(ar.failed ? ar.cause : nil, ar.succeeded ? ::Vertx::Util::Utils.from_object(ar.result) : nil) }))
      elsif blockingCodeHandler.class == Proc && (ordered.class == TrueClass || ordered.class == FalseClass) && block_given?
        return @j_del.java_method(:executeBlocking, [Java::IoVertxCore::Handler.java_class,Java::boolean.java_class,Java::IoVertxCore::Handler.java_class]).call((Proc.new { |event| blockingCodeHandler.call(::Vertx::Util::Utils.safe_create(event,::Vertx::Future)) }),ordered,(Proc.new { |ar| yield(ar.failed ? ar.cause : nil, ar.succeeded ? ::Vertx::Util::Utils.from_object(ar.result) : nil) }))
      end
      raise ArgumentError, "Invalid arguments when calling execute_blocking(blockingCodeHandler,ordered)"
    end

### - (`Object`) file_system

Raises:

- (`ArgumentError`)

    155
    156
    157
    158
    159
    160
    161
    162
    163
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx/vertx.rb', line 155

    def file_system
      if !block_given?
        if @cached_file_system != nil
          return @cached_file_system
        end
        return @cached_file_system = ::Vertx::Util::Utils.safe_create(@j_del.java_method(:fileSystem, []).call(),::Vertx::FileSystem)
      end
      raise ArgumentError, "Invalid arguments when calling file_system()"
    end

### - (`Object`) get_or_create_context

Raises:

- (`ArgumentError`)

    92
    93
    94
    95
    96
    97
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx/vertx.rb', line 92

    def get_or_create_context
      if !block_given?
        return ::Vertx::Util::Utils.safe_create(@j_del.java_method(:getOrCreateContext, []).call(),::Vertx::Context)
      end
      raise ArgumentError, "Invalid arguments when calling get_or_create_context()"
    end

### - (`Object`) j_del

    48
    49
    50
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx/vertx.rb', line 48

    def j_del
      @j_del
    end

### - (`Boolean`) metrics_enabled?

Returns:

- (`Boolean`)

Raises:

- (`ArgumentError`)

    53
    54
    55
    56
    57
    58
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx/vertx.rb', line 53

    def metrics_enabled?
      if !block_given?
        return @j_del.java_method(:isMetricsEnabled, []).call()
      end
      raise ArgumentError, "Invalid arguments when calling metrics_enabled?()"
    end

### - (`Object`) periodic_stream(delay = nil)

Raises:

- (`ArgumentError`)

    232
    233
    234
    235
    236
    237
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx/vertx.rb', line 232

    def periodic_stream(delay=nil)
      if delay.class == Fixnum && !block_given?
        return ::Vertx::Util::Utils.safe_create(@j_del.java_method(:periodicStream, [Java::long.java_class]).call(delay),::Vertx::TimeoutStream)
      end
      raise ArgumentError, "Invalid arguments when calling periodic_stream(delay)"
    end

### - (`Object`) run_on_context

Raises:

- (`ArgumentError`)

    251
    252
    253
    254
    255
    256
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx/vertx.rb', line 251

    def run_on_context
      if block_given?
        return @j_del.java_method(:runOnContext, [Java::IoVertxCore::Handler.java_class]).call(Proc.new { yield })
      end
      raise ArgumentError, "Invalid arguments when calling run_on_context()"
    end

### - (`Object`) set_periodic(delay = nil)

Raises:

- (`ArgumentError`)

    222
    223
    224
    225
    226
    227
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx/vertx.rb', line 222

    def set_periodic(delay=nil)
      if delay.class == Fixnum && block_given?
        return @j_del.java_method(:setPeriodic, [Java::long.java_class,Java::IoVertxCore::Handler.java_class]).call(delay,(Proc.new { |event| yield(event) }))
      end
      raise ArgumentError, "Invalid arguments when calling set_periodic(delay)"
    end

### - (`Object`) set_timer(delay = nil)

Raises:

- (`ArgumentError`)

    201
    202
    203
    204
    205
    206
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx/vertx.rb', line 201

    def set_timer(delay=nil)
      if delay.class == Fixnum && block_given?
        return @j_del.java_method(:setTimer, [Java::long.java_class,Java::IoVertxCore::Handler.java_class]).call(delay,(Proc.new { |event| yield(event) }))
      end
      raise ArgumentError, "Invalid arguments when calling set_timer(delay)"
    end

### - (`Object`) shared_data

Raises:

- (`ArgumentError`)

    187
    188
    189
    190
    191
    192
    193
    194
    195
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx/vertx.rb', line 187

    def shared_data
      if !block_given?
        if @cached_shared_data != nil
          return @cached_shared_data
        end
        return @cached_shared_data = ::Vertx::Util::Utils.safe_create(@j_del.java_method(:sharedData, []).call(),::Vertx::SharedData)
      end
      raise ArgumentError, "Invalid arguments when calling shared_data()"
    end

### - (`Object`) timer_stream(delay = nil)

Raises:

- (`ArgumentError`)

    211
    212
    213
    214
    215
    216
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx/vertx.rb', line 211

    def timer_stream(delay=nil)
      if delay.class == Fixnum && !block_given?
        return ::Vertx::Util::Utils.safe_create(@j_del.java_method(:timerStream, [Java::long.java_class]).call(delay),::Vertx::TimeoutStream)
      end
      raise ArgumentError, "Invalid arguments when calling timer_stream(delay)"
    end

### - (`Object`) undeploy(deploymentID = nil)

Raises:

- (`ArgumentError`)

    290
    291
    292
    293
    294
    295
    296
    297
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx/vertx.rb', line 290

    def undeploy(deploymentID=nil)
      if deploymentID.class == String && !block_given?
        return @j_del.java_method(:undeploy, [Java::java.lang.String.java_class]).call(deploymentID)
      elsif deploymentID.class == String && block_given?
        return @j_del.java_method(:undeploy, [Java::java.lang.String.java_class,Java::IoVertxCore::Handler.java_class]).call(deploymentID,(Proc.new { |ar| yield(ar.failed ? ar.cause : nil) }))
      end
      raise ArgumentError, "Invalid arguments when calling undeploy(deploymentID)"
    end