Class List Method List File List

# Class: VertxStomp::DestinationFactory

Inherits:
  Object
  - Object
  - VertxStomp::DestinationFactory
  show all
Defined in:
  /Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-stomp/destination_factory.rb

## Overview

Interface implemented to customize the destination creation.

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

- - (::VertxStomp::Destination) create(vertx = nil, name = nil)
  Creates a destination for the given address.

## Class Method Details

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

Returns:

- (`Boolean`)

    19
    20
    21
    # File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-stomp/destination_factory.rb', line 19

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

### + (`Object`) j_api_type

    28
    29
    30
    # File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-stomp/destination_factory.rb', line 28

    def self.j_api_type
      @@j_api_type
    end

### + (`Object`) j_class

    31
    32
    33
    # File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-stomp/destination_factory.rb', line 31

    def self.j_class
      Java::IoVertxExtStomp::DestinationFactory.java_class
    end

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

    25
    26
    27
    # File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-stomp/destination_factory.rb', line 25

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

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

    22
    23
    24
    # File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-stomp/destination_factory.rb', line 22

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

## Instance Method Details

### - (`::VertxStomp::Destination`) create(vertx = nil, name = nil)

Creates a destination for the given address.

Parameters:

- vertx (`::Vertx::Vertx`) (defaults to: `nil`) —
  the vert.x instance used by the STOMP server.
- name (`String`) (defaults to: `nil`) —
  the destination name.

Returns:

- (`::VertxStomp::Destination`) —
  the destination, `null` to reject the creation.

Raises:

- (`ArgumentError`)

    38
    39
    40
    41
    42
    43
    # File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-stomp/destination_factory.rb', line 38

    def create(vertx=nil,name=nil)
      if vertx.class.method_defined?(:j_del) && name.class == String && !block_given?
        return ::Vertx::Util::Utils.safe_create(@j_del.java_method(:create, [Java::IoVertxCore::Vertx.java_class,Java::java.lang.String.java_class]).call(vertx.j_del,name),::VertxStomp::Destination)
      end
      raise ArgumentError, "Invalid arguments when calling create(#{vertx},#{name})"
    end