Class List Method List File List

# Class: VertxStomp::StompServer

Inherits:
  Object
  - Object
  - VertxStomp::StompServer
  show all
Defined in:
  /Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-stomp/stomp_server.rb

## Class Method Summary (collapse)

- + (Object) create(param_1 = nil, param_2 = nil, param_3 = nil)

## Instance Method Summary (collapse)

- - (Object) actual_port
- - (Object) close
- - (Object) handler(handler = nil)
- - (StompServer) initialize(j_del) constructor
  A new instance of StompServer.
- - (Object) j_del
- - (Object) listen(port = nil, host = nil)
- - (Boolean) listening?
- - (Object) options
- - (Object) stomp_handler
- - (Object) vertx
- - (Object) web_socket_handler
- - (Object) writing_frame_handler

## Constructor Details

### - (`StompServer`) initialize(j_del)

Returns a new instance of StompServer

    14
    15
    16
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-stomp/stomp_server.rb', line 14

    def initialize(j_del)
      @j_del = j_del
    end

## Class Method Details

### + (`Object`) create(param_1 = nil, param_2 = nil, param_3 = nil)

Raises:

- (`ArgumentError`)

    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-stomp/stomp_server.rb', line 36

    def self.create(param_1=nil,param_2=nil,param_3=nil)
      if param_1.class.method_defined?(:j_del) && !block_given? && param_2 == nil && param_3 == nil
        return ::Vertx::Util::Utils.safe_create(Java::IoVertxExtStomp::StompServer.java_method(:create, [Java::IoVertxCore::Vertx.java_class]).call(param_1.j_del),::VertxStomp::StompServer)
      elsif param_1.class.method_defined?(:j_del) && param_2.class == Hash && !block_given? && param_3 == nil
        return ::Vertx::Util::Utils.safe_create(Java::IoVertxExtStomp::StompServer.java_method(:create, [Java::IoVertxCore::Vertx.java_class,Java::IoVertxExtStomp::StompServerOptions.java_class]).call(param_1.j_del,Java::IoVertxExtStomp::StompServerOptions.new(::Vertx::Util::Utils.to_json_object(param_2))),::VertxStomp::StompServer)
      elsif param_1.class.method_defined?(:j_del) && param_2.class.method_defined?(:j_del) && !block_given? && param_3 == nil
        return ::Vertx::Util::Utils.safe_create(Java::IoVertxExtStomp::StompServer.java_method(:create, [Java::IoVertxCore::Vertx.java_class,Java::IoVertxCoreNet::NetServer.java_class]).call(param_1.j_del,param_2.j_del),::VertxStomp::StompServer)
      elsif param_1.class.method_defined?(:j_del) && param_2.class.method_defined?(:j_del) && param_3.class == Hash && !block_given?
        return ::Vertx::Util::Utils.safe_create(Java::IoVertxExtStomp::StompServer.java_method(:create, [Java::IoVertxCore::Vertx.java_class,Java::IoVertxCoreNet::NetServer.java_class,Java::IoVertxExtStomp::StompServerOptions.java_class]).call(param_1.j_del,param_2.j_del,Java::IoVertxExtStomp::StompServerOptions.new(::Vertx::Util::Utils.to_json_object(param_3))),::VertxStomp::StompServer)
      end
      raise ArgumentError, "Invalid arguments when calling create(param_1,param_2,param_3)"
    end

## Instance Method Details

### - (`Object`) actual_port

Raises:

- (`ArgumentError`)

    109
    110
    111
    112
    113
    114
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-stomp/stomp_server.rb', line 109

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

### - (`Object`) close

Raises:

- (`ArgumentError`)

    89
    90
    91
    92
    93
    94
    95
    96
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-stomp/stomp_server.rb', line 89

    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

### - (`Object`) handler(handler = nil)

Raises:

- (`ArgumentError`)

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

    def handler(handler=nil)
      if handler.class.method_defined?(:j_del) && !block_given?
        @j_del.java_method(:handler, [Java::IoVertxExtStomp::StompServerHandler.java_class]).call(handler.j_del)
        return self
      end
      raise ArgumentError, "Invalid arguments when calling handler(handler)"
    end

### - (`Object`) j_del

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

    def j_del
      @j_del
    end

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

Raises:

- (`ArgumentError`)

    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    85
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-stomp/stomp_server.rb', line 64

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

### - (`Boolean`) listening?

Returns:

- (`Boolean`)

Raises:

- (`ArgumentError`)

    99
    100
    101
    102
    103
    104
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-stomp/stomp_server.rb', line 99

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

### - (`Object`) options

Raises:

- (`ArgumentError`)

    116
    117
    118
    119
    120
    121
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-stomp/stomp_server.rb', line 116

    def options
      if !block_given?
        return @j_del.java_method(:options, []).call() != nil ? JSON.parse(@j_del.java_method(:options, []).call().toJson.encode) : nil
      end
      raise ArgumentError, "Invalid arguments when calling options()"
    end

### - (`Object`) stomp_handler

Raises:

- (`ArgumentError`)

    130
    131
    132
    133
    134
    135
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-stomp/stomp_server.rb', line 130

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

### - (`Object`) vertx

Raises:

- (`ArgumentError`)

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

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

### - (`Object`) web_socket_handler

Raises:

- (`ArgumentError`)

    139
    140
    141
    142
    143
    144
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-stomp/stomp_server.rb', line 139

    def web_socket_handler
      if !block_given?
        return ::Vertx::Util::Utils.to_handler_proc(@j_del.java_method(:webSocketHandler, []).call()) { |val| val.j_del }
      end
      raise ArgumentError, "Invalid arguments when calling web_socket_handler()"
    end

### - (`Object`) writing_frame_handler

Raises:

- (`ArgumentError`)

    149
    150
    151
    152
    153
    154
    155
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-stomp/stomp_server.rb', line 149

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