Class: Qpid::Proton::Handler::MessagingHandler Deprecated

Inherits:
Object
  • Object
show all
Includes:
Util::Deprecation
Defined in:
lib/handler/messaging_handler.rb

Overview

Deprecated.

Constant Summary

Constants included from Util::Deprecation

Util::Deprecation::DEPRECATE_FULL_TRACE, Util::Deprecation::MATCH_DIR

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Util::Deprecation

deprecated, #deprecated, included

Constructor Details

#initialize(opts) ⇒ MessagingHandler #initialize(prefetch = 10, auto_accept = true, auto_settle = true, peer_close_is_error = false) ⇒ MessagingHandler

Deprecated.

use initialize(opts) overload

Returns a new instance of MessagingHandler.

Overloads:

  • #initialize(opts) ⇒ MessagingHandler

    Create a Qpid::Proton::Handler::MessagingHandler with options opts

    Options Hash (opts):

    • :prefetch (Integer) — default: 10

      The number of messages to fetch in advance, 0 disables prefetch.

    • :auto_accept (Boolean) — default: true

      If true, incoming messages are accepted automatically after #on_message. If false, the application can accept, reject or release the message by calling methods on Delivery when the message has been processed.

    • :auto_settle (Boolean) — default: true

      If true, outgoing messages are settled automatically when the remote peer settles. If false, the application must call Delivery#settle explicitly.

    • :auto_open (Boolean) — default: true

      If true, incoming connections are opened automatically. If false, the application must call Connection#open to open incoming connections.

    • :auto_close (Boolean) — default: true

      If true, respond to a remote close automatically with a local close. If false, the application must call Connection#close to finish closing connections.

    • :peer_close_is_error (Boolean) — default: false

      If true, and the remote peer closes the connection without an error condition, the set the local error condition Condition(“error”, “unexpected peer close”)



53
54
55
56
57
58
59
60
61
62
63
64
# File 'lib/handler/messaging_handler.rb', line 53

def initialize(*args)
  deprecated MessagingHandler, Qpid::Proton::MessagingHandler
  @options = {}
  if args.size == 1 && args[0].is_a?(Hash)
    @options.replace(args[0])
  else                      # Fill options from deprecated fixed arguments
    [:prefetch, :auto_accept, :auto_settle, :peer_close_is_error].each do |k|
      opts[k] = args.shift unless args.empty?
    end
  end
  # NOTE: the options are processed by {Handler::Adapater}
end

Instance Attribute Details

#optionsHash (readonly)

Returns handler options, see #initialize.

Returns:



69
70
71
# File 'lib/handler/messaging_handler.rb', line 69

def options
  @options
end

Instance Method Details

#on_aborted(event) ⇒ Object

Called when message delivery is aborted by the sender. The Event#delivery provides information about the delivery, but the message should be ignored.



# File 'lib/handler/messaging_handler.rb', line 152

#on_accepted(event) ⇒ Object

Called when the remote peer accepts an outgoing message.

Parameters:

  • event (Event)

    The event.



# File 'lib/handler/messaging_handler.rb', line 124

#on_connection_closed(event) ⇒ Object

Called when the connection is closed.

Parameters:

  • event (Event)

    The event.



# File 'lib/handler/messaging_handler.rb', line 91

#on_connection_closing(event) ⇒ Object

Called when the peer initiates the closing of the connection.

Parameters:

  • event (Event)

    The event.



# File 'lib/handler/messaging_handler.rb', line 103

#on_disconnected(event) ⇒ Object

Called when the socket is disconnected.

Parameters:

  • event (Event)

    The event.



# File 'lib/handler/messaging_handler.rb', line 115

#on_error(event) ⇒ Object

If on_xxx_error method is missing, #on_error is called instead. If #on_error is missing, the connection is closed with the error.

Parameters:



# File 'lib/handler/messaging_handler.rb', line 156

Called when the link is closed.

Parameters:

  • event (Event)

    The event.



# File 'lib/handler/messaging_handler.rb', line 99

Called when the peer initiates the closing of the link.

Parameters:

  • event (Event)

    The event.



# File 'lib/handler/messaging_handler.rb', line 111

Called when the peer closes the link with an error condition.

Parameters:

  • event (Event)

    The event.



# File 'lib/handler/messaging_handler.rb', line 83

#on_message(event) ⇒ Object

Called when a message is received.

The message is available from Event#message, to accept or reject the message use Event#delivery

Parameters:

  • event (Event)

    The event.



# File 'lib/handler/messaging_handler.rb', line 145

#on_modified(event) ⇒ Object

Called when the remote peer releases an outgoing message for re-delivery with modifications.

Parameters:

  • event (Event)

    The event.



# File 'lib/handler/messaging_handler.rb', line 136

#on_rejected(event) ⇒ Object

Called when the remote peer rejects an outgoing message.

Parameters:

  • event (Event)

    The event.



# File 'lib/handler/messaging_handler.rb', line 128

#on_released(event) ⇒ Object

Called when the remote peer releases an outgoing message for re-delivery as-is.

Parameters:

  • event (Event)

    The event.



# File 'lib/handler/messaging_handler.rb', line 132

#on_sendable(event) ⇒ Object

Called when the sender link has credit and messages can therefore be transferred.

Parameters:

  • event (Event)

    The event.



# File 'lib/handler/messaging_handler.rb', line 119

#on_session_closed(event) ⇒ Object

Called when the session is closed.

Parameters:

  • event (Event)

    The event.



# File 'lib/handler/messaging_handler.rb', line 95

#on_session_closing(event) ⇒ Object

Called when the peer initiates the closing of the session.

Parameters:

  • event (Event)

    The event.



# File 'lib/handler/messaging_handler.rb', line 107

#on_session_error(event) ⇒ Object

Called when the peer closes the session with an error condition.

Parameters:

  • event (Qpid:Proton::Event)

    The event.



# File 'lib/handler/messaging_handler.rb', line 79

#on_settled(event) ⇒ Object

Called when the remote peer has settled hte outgoing message. This is the point at which it should never be retransmitted.

Parameters:

  • event (Event)

    The event.



# File 'lib/handler/messaging_handler.rb', line 140

#on_start(event) ⇒ Object

Called when the event loop starts.

Parameters:

  • event (Event)

    The event.



# File 'lib/handler/messaging_handler.rb', line 87

#on_transport_error(event) ⇒ Object

Called when the transport fails or closes unexpectedly.

Parameters:

  • event (Event)

    The event.



# File 'lib/handler/messaging_handler.rb', line 71

#on_unhandled(event) ⇒ Object

If an on_xxx method is missing, #on_unhandled is called instead.

Parameters:



# File 'lib/handler/messaging_handler.rb', line 161

#proton_adapter_classObject



27
# File 'lib/handler/messaging_handler.rb', line 27

def proton_adapter_class() Handler::ReactorMessagingAdapter; end