Class List Method List File List

# Class: VertxAmqpBridge::AmqpBridge

Inherits:
  Object
  - Object
  - VertxAmqpBridge::AmqpBridge
  show all
Defined in:
  /Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-amqp-bridge/amqp_bridge.rb

## Class Method Summary (collapse)

- + (Object) create(vertx = nil, options = nil)

## Instance Method Summary (collapse)

- - (Object) close
- - (Object) create_consumer(amqpAddress = nil)
- - (Object) create_producer(amqpAddress = nil)
- - (AmqpBridge) initialize(j_del) constructor
  A new instance of AmqpBridge.
- - (Object) j_del
- - (Object) start(hostname = nil, port = nil, username = nil, password = nil)

## Constructor Details

### - (`AmqpBridge`) initialize(j_del)

Returns a new instance of AmqpBridge

    11
    12
    13
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-amqp-bridge/amqp_bridge.rb', line 11

    def initialize(j_del)
      @j_del = j_del
    end

## Class Method Details

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

Raises:

- (`ArgumentError`)

    23
    24
    25
    26
    27
    28
    29
    30
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-amqp-bridge/amqp_bridge.rb', line 23

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

## Instance Method Details

### - (`Object`) close

Raises:

- (`ArgumentError`)

    73
    74
    75
    76
    77
    78
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-amqp-bridge/amqp_bridge.rb', line 73

    def close
      if 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

### - (`Object`) create_consumer(amqpAddress = nil)

Raises:

- (`ArgumentError`)

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

    def create_consumer(amqpAddress=nil)
      if amqpAddress.class == String && !block_given?
        return ::Vertx::Util::Utils.safe_create(@j_del.java_method(:createConsumer, [Java::java.lang.String.java_class]).call(amqpAddress),::Vertx::MessageConsumer)
      end
      raise ArgumentError, "Invalid arguments when calling create_consumer(amqpAddress)"
    end

### - (`Object`) create_producer(amqpAddress = nil)

Raises:

- (`ArgumentError`)

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

    def create_producer(amqpAddress=nil)
      if amqpAddress.class == String && !block_given?
        return ::Vertx::Util::Utils.safe_create(@j_del.java_method(:createProducer, [Java::java.lang.String.java_class]).call(amqpAddress),::Vertx::MessageProducer)
      end
      raise ArgumentError, "Invalid arguments when calling create_producer(amqpAddress)"
    end

### - (`Object`) j_del

    16
    17
    18
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-amqp-bridge/amqp_bridge.rb', line 16

    def j_del
      @j_del
    end

### - (`Object`) start(hostname = nil, port = nil, username = nil, password = nil)

Raises:

- (`ArgumentError`)

    38
    39
    40
    41
    42
    43
    44
    45
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-amqp-bridge/amqp_bridge.rb', line 38

    def start(hostname=nil,port=nil,username=nil,password=nil)
      if hostname.class == String && port.class == Fixnum && block_given? && username == nil && password == nil
        return @j_del.java_method(:start, [Java::java.lang.String.java_class,Java::int.java_class,Java::IoVertxCore::Handler.java_class]).call(hostname,port,(Proc.new { |ar| yield(ar.failed ? ar.cause : nil, ar.succeeded ? ::Vertx::Util::Utils.safe_create(ar.result,::VertxAmqpBridge::AmqpBridge) : nil) }))
      elsif hostname.class == String && port.class == Fixnum && username.class == String && password.class == String && block_given?
        return @j_del.java_method(:start, [Java::java.lang.String.java_class,Java::int.java_class,Java::java.lang.String.java_class,Java::java.lang.String.java_class,Java::IoVertxCore::Handler.java_class]).call(hostname,port,username,password,(Proc.new { |ar| yield(ar.failed ? ar.cause : nil, ar.succeeded ? ::Vertx::Util::Utils.safe_create(ar.result,::VertxAmqpBridge::AmqpBridge) : nil) }))
      end
      raise ArgumentError, "Invalid arguments when calling start(hostname,port,username,password)"
    end