Class: VertxStomp::StompServerHandler

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

Overview

STOMP server handler implements the behavior of the STOMP server when a specific event occurs. For instance, if let customize the behavior when specific STOMP frames arrives or when a connection is closed. This class has been designed to let you customize the server behavior. The default implementation is compliant with the STOMP specification. In this default implementation, not acknowledge frames are dropped.

Constant Summary

@@j_api_type =
Object.new

Class Method Summary (collapse)

Instance Method Summary (collapse)

Class Method Details

+ (Boolean) accept?(obj)

Returns:

  • (Boolean)


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

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

+ (::VertxStomp::StompServerHandler) create(vertx = nil)

Creates an instance of VertxStomp::StompServerHandler using the default (compliant) implementation.

Parameters:

  • vertx (::Vertx::Vertx) (defaults to: nil)
    the vert.x instance to use

Returns:

Raises:

  • (ArgumentError)


55
56
57
58
59
60
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-stomp/stomp_server_handler.rb', line 55

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

+ (Object) j_api_type



37
38
39
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-stomp/stomp_server_handler.rb', line 37

def self.j_api_type
  @@j_api_type
end

+ (Object) j_class



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

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

+ (Object) unwrap(obj)



34
35
36
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-stomp/stomp_server_handler.rb', line 34

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

+ (Object) wrap(obj)



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

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

Instance Method Details

- (self) abort_handler { ... }

Configures the action to execute when a ABORT frame is received.

Yields:

  • the handler

Returns:

  • (self)

Raises:

  • (ArgumentError)


155
156
157
158
159
160
161
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-stomp/stomp_server_handler.rb', line 155

def abort_handler
  if block_given?
    @j_del.java_method(:abortHandler, [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 abort_handler()"
end

- (self) ack_handler { ... }

Configures the action to execute when a ACK frame is received.

Yields:

  • the handler

Returns:

  • (self)

Raises:

  • (ArgumentError)


185
186
187
188
189
190
191
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-stomp/stomp_server_handler.rb', line 185

def ack_handler
  if block_given?
    @j_del.java_method(:ackHandler, [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 ack_handler()"
end

- (self) auth_provider(handler = nil)

Configures the to be used to authenticate the user.

Parameters:

Returns:

  • (self)

Raises:

  • (ArgumentError)


228
229
230
231
232
233
234
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-stomp/stomp_server_handler.rb', line 228

def auth_provider(handler=nil)
  if handler.class.method_defined?(:j_del) && !block_given?
    @j_del.java_method(:authProvider, [Java::IoVertxExtAuth::AuthProvider.java_class]).call(handler.j_del)
    return self
  end
  raise ArgumentError, "Invalid arguments when calling auth_provider(#{handler})"
end

- (self) begin_handler { ... }

Configures the action to execute when a BEGIN frame is received.

Yields:

  • the handler

Returns:

  • (self)

Raises:

  • (ArgumentError)


165
166
167
168
169
170
171
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-stomp/stomp_server_handler.rb', line 165

def begin_handler
  if block_given?
    @j_del.java_method(:beginHandler, [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 begin_handler()"
end

- (self) bridge(options = nil)

Configures the STOMP server to act as a bridge with the Vert.x event bus.

Parameters:

  • options (Hash) (defaults to: nil)
    the configuration options

Returns:

  • (self)

Raises:

  • (ArgumentError)


336
337
338
339
340
341
342
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-stomp/stomp_server_handler.rb', line 336

def bridge(options=nil)
  if options.class == Hash && !block_given?
    @j_del.java_method(:bridge, [Java::IoVertxExtStomp::BridgeOptions.java_class]).call(Java::IoVertxExtStomp::BridgeOptions.new(::Vertx::Util::Utils.to_json_object(options)))
    return self
  end
  raise ArgumentError, "Invalid arguments when calling bridge(#{options})"
end

- (self) close_handler { ... }

Configures the action to execute when a connection with the client is closed.

Yields:

  • the handler

Returns:

  • (self)

Raises:

  • (ArgumentError)


125
126
127
128
129
130
131
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-stomp/stomp_server_handler.rb', line 125

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

- (self) commit_handler { ... }

Configures the action to execute when a COMMIT frame is received.

Yields:

  • the handler

Returns:

  • (self)

Raises:

  • (ArgumentError)


145
146
147
148
149
150
151
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-stomp/stomp_server_handler.rb', line 145

def commit_handler
  if block_given?
    @j_del.java_method(:commitHandler, [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 commit_handler()"
end

- (self) connect_handler { ... }

Configures the action to execute when a CONNECT frame is received.

Yields:

  • the handler

Returns:

  • (self)

Raises:

  • (ArgumentError)


75
76
77
78
79
80
81
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-stomp/stomp_server_handler.rb', line 75

def connect_handler
  if block_given?
    @j_del.java_method(:connectHandler, [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 connect_handler()"
end

- (self) destination_factory(factory = nil)

Configures the DestinationFactory used to create Destination objects.

Parameters:

Returns:

  • (self)

Raises:

  • (ArgumentError)


326
327
328
329
330
331
332
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-stomp/stomp_server_handler.rb', line 326

def destination_factory(factory=nil)
  if factory.class.method_defined?(:j_del) && !block_given?
    @j_del.java_method(:destinationFactory, [Java::IoVertxExtStomp::DestinationFactory.java_class]).call(factory.j_del)
    return self
  end
  raise ArgumentError, "Invalid arguments when calling destination_factory(#{factory})"
end

- (self) disconnect_handler { ... }

Configures the action to execute when a DISCONNECT frame is received.

Yields:

  • the handler

Returns:

  • (self)

Raises:

  • (ArgumentError)


175
176
177
178
179
180
181
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-stomp/stomp_server_handler.rb', line 175

def disconnect_handler
  if block_given?
    @j_del.java_method(:disconnectHandler, [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 disconnect_handler()"
end

- (::VertxStomp::Destination) get_destination(destination = nil)

Gets the destination with the given name.

Parameters:

  • destination (String) (defaults to: nil)
    the destination

Returns:

Raises:

  • (ArgumentError)


245
246
247
248
249
250
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-stomp/stomp_server_handler.rb', line 245

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

- (Array<::VertxStomp::Destination>) get_destinations

Returns the list of destination managed by the STOMP server. Don't forget the STOMP interprets destination as opaque Strings.

Returns:

  • (Array<::VertxStomp::Destination>)
    the list of destination managed by the STOMP server. Don't forget the STOMP interprets destination as opaque Strings.

Raises:

  • (ArgumentError)


236
237
238
239
240
241
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-stomp/stomp_server_handler.rb', line 236

def get_destinations
  if !block_given?
    return @j_del.java_method(:getDestinations, []).call().to_a.map { |elt| ::Vertx::Util::Utils.safe_create(elt,::VertxStomp::Destination) }
  end
  raise ArgumentError, "Invalid arguments when calling get_destinations()"
end

- (::VertxStomp::Destination) get_or_create_destination(destination = nil)

Gets a Destination object if existing, or create a new one. The creation is delegated to the DestinationFactory.

Parameters:

  • destination (String) (defaults to: nil)
    the destination

Returns:

Raises:

  • (ArgumentError)


317
318
319
320
321
322
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-stomp/stomp_server_handler.rb', line 317

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

- (::VertxAuthCommon::User) get_user_by_session(session = nil)

Provides for authorization matches on a destination level, this will return the User created by the .

Parameters:

  • session (String) (defaults to: nil)
    session ID for the server connection.

Returns:

Raises:

  • (ArgumentError)


219
220
221
222
223
224
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-stomp/stomp_server_handler.rb', line 219

def get_user_by_session(session=nil)
  if session.class == String && !block_given?
    return ::Vertx::Util::Utils.safe_create(@j_del.java_method(:getUserBySession, [Java::java.lang.String.java_class]).call(session),::VertxAuthCommon::User)
  end
  raise ArgumentError, "Invalid arguments when calling get_user_by_session(#{session})"
end

- (void) handle(event = nil)

This method returns an undefined value.

Something has happened, so handle it.

Parameters:

Raises:

  • (ArgumentError)


46
47
48
49
50
51
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-stomp/stomp_server_handler.rb', line 46

def handle(event=nil)
  if event.class.method_defined?(:j_del) && !block_given?
    return @j_del.java_method(:handle, [Java::IoVertxExtStomp::ServerFrame.java_class]).call(event.j_del)
  end
  raise ArgumentError, "Invalid arguments when calling handle(#{event})"
end

- (self) nack_handler { ... }

Configures the action to execute when a NACK frame is received.

Yields:

  • the handler

Returns:

  • (self)

Raises:

  • (ArgumentError)


195
196
197
198
199
200
201
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-stomp/stomp_server_handler.rb', line 195

def nack_handler
  if block_given?
    @j_del.java_method(:nackHandler, [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 nack_handler()"
end

- (self) on_ack(connection = nil, subscribe = nil, messages = nil)

Method called by single message (client-individual policy) or a set of message (client policy) are acknowledged. Implementations must call the handler configured using #on_ack_handler.

Parameters:

  • connection (::VertxStomp::StompServerConnection) (defaults to: nil)
    the connection
  • subscribe (Hash) (defaults to: nil)
    the SUBSCRIBE frame
  • messages (Array<Hash>) (defaults to: nil)
    the acknowledge messages

Returns:

  • (self)

Raises:

  • (ArgumentError)


257
258
259
260
261
262
263
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-stomp/stomp_server_handler.rb', line 257

def on_ack(connection=nil,subscribe=nil,messages=nil)
  if connection.class.method_defined?(:j_del) && subscribe.class == Hash && messages.class == Array && !block_given?
    @j_del.java_method(:onAck, [Java::IoVertxExtStomp::StompServerConnection.java_class,Java::IoVertxExtStomp::Frame.java_class,Java::JavaUtil::List.java_class]).call(connection.j_del,Java::IoVertxExtStomp::Frame.new(::Vertx::Util::Utils.to_json_object(subscribe)),messages.map { |element| Java::IoVertxExtStomp::Frame.new(::Vertx::Util::Utils.to_json_object(element)) })
    return self
  end
  raise ArgumentError, "Invalid arguments when calling on_ack(#{connection},#{subscribe},#{messages})"
end

- (self) on_ack_handler { ... }

Configures the action to execute when messages are acknowledged.

Yields:

  • the handler

Returns:

  • (self)

Raises:

  • (ArgumentError)


282
283
284
285
286
287
288
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-stomp/stomp_server_handler.rb', line 282

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

- (self) on_authentication_request(connection = nil, login = nil, passcode = nil) { ... }

Called when the client connects to a server requiring authentication. It invokes the configured using #auth_provider.

Parameters:

  • connection (::VertxStomp::StompServerConnection) (defaults to: nil)
    server connection that contains session ID
  • login (String) (defaults to: nil)
    the login
  • passcode (String) (defaults to: nil)
    the password

Yields:

  • handler receiving the authentication result

Returns:

  • (self)

Raises:

  • (ArgumentError)


209
210
211
212
213
214
215
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-stomp/stomp_server_handler.rb', line 209

def on_authentication_request(connection=nil,=nil,passcode=nil)
  if connection.class.method_defined?(:j_del) && .class == String && passcode.class == String && block_given?
    @j_del.java_method(:onAuthenticationRequest, [Java::IoVertxExtStomp::StompServerConnection.java_class,Java::java.lang.String.java_class,Java::java.lang.String.java_class,Java::IoVertxCore::Handler.java_class]).call(connection.j_del,,passcode,(Proc.new { |ar| yield(ar.failed ? ar.cause : nil, ar.succeeded ? ar.result : nil) }))
    return self
  end
  raise ArgumentError, "Invalid arguments when calling on_authentication_request(#{connection},#{},#{passcode})"
end

- (void) on_close(connection = nil)

This method returns an undefined value.

Called when the connection is closed. This method executes a default behavior and must calls the configured #close_handler if any.

Parameters:

Raises:

  • (ArgumentError)


136
137
138
139
140
141
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-stomp/stomp_server_handler.rb', line 136

def on_close(connection=nil)
  if connection.class.method_defined?(:j_del) && !block_given?
    return @j_del.java_method(:onClose, [Java::IoVertxExtStomp::StompServerConnection.java_class]).call(connection.j_del)
  end
  raise ArgumentError, "Invalid arguments when calling on_close(#{connection})"
end

- (self) on_nack(connection = nil, subscribe = nil, messages = nil)

Method called by single message (client-individual policy) or a set of message (client policy) are not acknowledged. Not acknowledgment can result from a NACK frame or from a timeout (no ACK frame received in a given time. Implementations must call the handler configured using #on_nack_handler.

Parameters:

  • connection (::VertxStomp::StompServerConnection) (defaults to: nil)
    the connection
  • subscribe (Hash) (defaults to: nil)
    the SUBSCRIBE frame
  • messages (Array<Hash>) (defaults to: nil)
    the acknowledge messages

Returns:

  • (self)

Raises:

  • (ArgumentError)


272
273
274
275
276
277
278
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-stomp/stomp_server_handler.rb', line 272

def on_nack(connection=nil,subscribe=nil,messages=nil)
  if connection.class.method_defined?(:j_del) && subscribe.class == Hash && messages.class == Array && !block_given?
    @j_del.java_method(:onNack, [Java::IoVertxExtStomp::StompServerConnection.java_class,Java::IoVertxExtStomp::Frame.java_class,Java::JavaUtil::List.java_class]).call(connection.j_del,Java::IoVertxExtStomp::Frame.new(::Vertx::Util::Utils.to_json_object(subscribe)),messages.map { |element| Java::IoVertxExtStomp::Frame.new(::Vertx::Util::Utils.to_json_object(element)) })
    return self
  end
  raise ArgumentError, "Invalid arguments when calling on_nack(#{connection},#{subscribe},#{messages})"
end

- (self) on_nack_handler { ... }

Configures the action to execute when messages are not acknowledged.

Yields:

  • the handler

Returns:

  • (self)

Raises:

  • (ArgumentError)


292
293
294
295
296
297
298
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-stomp/stomp_server_handler.rb', line 292

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

- (self) ping_handler { ... }

Allows customizing the action to do when the server needs to send a `PING` to the client. By default it send a frame containing EOL (specification). However, you can customize this and send another frame. However, be aware that this may requires a custom client.

The handler will only be called if the connection supports heartbeats.

Yields:

  • the action to execute when a `PING` needs to be sent.

Returns:

  • (self)

Raises:

  • (ArgumentError)


306
307
308
309
310
311
312
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-stomp/stomp_server_handler.rb', line 306

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

- (self) received_frame_handler { ... }

Configures a handler that get notified when a STOMP frame is received by the server. This handler can be used for logging, debugging or ad-hoc behavior.

Yields:

  • the handler

Returns:

  • (self)

Raises:

  • (ArgumentError)


65
66
67
68
69
70
71
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-stomp/stomp_server_handler.rb', line 65

def received_frame_handler
  if block_given?
    @j_del.java_method(:receivedFrameHandler, [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 received_frame_handler()"
end

- (self) send_handler { ... }

Configures the action to execute when a SEND frame is received.

Yields:

  • the handler

Returns:

  • (self)

Raises:

  • (ArgumentError)


115
116
117
118
119
120
121
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-stomp/stomp_server_handler.rb', line 115

def send_handler
  if block_given?
    @j_del.java_method(:sendHandler, [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 send_handler()"
end

- (self) stomp_handler { ... }

Configures the action to execute when a STOMP frame is received.

Yields:

  • the handler

Returns:

  • (self)

Raises:

  • (ArgumentError)


85
86
87
88
89
90
91
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-stomp/stomp_server_handler.rb', line 85

def stomp_handler
  if block_given?
    @j_del.java_method(:stompHandler, [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 stomp_handler()"
end

- (self) subscribe_handler { ... }

Configures the action to execute when a SUBSCRIBE frame is received.

Yields:

  • the handler

Returns:

  • (self)

Raises:

  • (ArgumentError)


95
96
97
98
99
100
101
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-stomp/stomp_server_handler.rb', line 95

def subscribe_handler
  if block_given?
    @j_del.java_method(:subscribeHandler, [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 subscribe_handler()"
end

- (self) unsubscribe_handler { ... }

Configures the action to execute when a UNSUBSCRIBE frame is received.

Yields:

  • the handler

Returns:

  • (self)

Raises:

  • (ArgumentError)


105
106
107
108
109
110
111
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-stomp/stomp_server_handler.rb', line 105

def unsubscribe_handler
  if block_given?
    @j_del.java_method(:unsubscribeHandler, [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 unsubscribe_handler()"
end