class Qpid::Proton::Endpoint
Endpoint is the parent classes for Link and Session.
It provides a namespace for constant values that relate to the current state of both links and sessions.
@example
conn = Qpid::Proton::Connection.new puts "Local connection flags : #{conn.state || Qpid::Proton::Endpoint::LOCAL_MASK}" puts "Remote connection flags: #{conn.state || Qpid::Proton::Endpoint::REMOTE_MASK}"
Constants
- LOCAL_ACTIVE
The local connection is active.
- LOCAL_CLOSED
The local connection is closed.
- LOCAL_MASK
Bitmask for the local-only flags.
- LOCAL_UNINIT
The local connection is uninitialized.
- REMOTE_ACTIVE
The remote connection is active.
- REMOTE_CLOSED
The remote connection is closed.
- REMOTE_MASK
Bitmask for the remote-only flags.
- REMOTE_UNINIT
The remote connection is unitialized.
Public Class Methods
new()
click to toggle source
@private
# File lib/core/endpoint.rb, line 63 def initialize @condition = nil end
Public Instance Methods
_update_condition()
click to toggle source
@private
# File lib/core/endpoint.rb, line 68 def _update_condition object_to_condition(@condition, self._local_condition) end
check_state(state_mask)
click to toggle source
# File lib/core/endpoint.rb, line 109 def check_state(state_mask) !(self.state & state_mask).zero? end
handler()
click to toggle source
# File lib/core/endpoint.rb, line 113 def handler reactor = Qpid::Proton::Reactor::Reactor.wrap(Cproton.pn_object_reactor(@impl)) if reactor.nil? on_error = nil else on_error = reactor.method(:on_error) end record = self.attachments puts "record=#{record}" WrappedHandler.wrap(Cproton.pn_record_get_handler(record), on_error) end
handler=(handler)
click to toggle source
# File lib/core/endpoint.rb, line 125 def handler=(handler) reactor = Qpid::Proton::Reactor::Reactor.wrap(Cproton.pn_object_reactor(@impl)) if reactor.nil? on_error = nil else on_error = reactor.method(:on_error) end impl = chandler(handler, on_error) record = self.attachments Cproton.pn_record_set_handler(record, impl) Cproton.pn_decref(impl) end
local_active?()
click to toggle source
# File lib/core/endpoint.rb, line 89 def local_active? check_state(LOCAL_ACTIVE) end
local_closed?()
click to toggle source
# File lib/core/endpoint.rb, line 93 def local_closed? check_state(LOCAL_CLOSED) end
local_uninit?()
click to toggle source
# File lib/core/endpoint.rb, line 85 def local_uninit? check_state(LOCAL_UNINIT) end
remote_active?()
click to toggle source
# File lib/core/endpoint.rb, line 101 def remote_active? check_state(REMOTE_ACTIVE) end
remote_closed?()
click to toggle source
# File lib/core/endpoint.rb, line 105 def remote_closed? check_state(REMOTE_CLOSED) end
remote_condition()
click to toggle source
@private
# File lib/core/endpoint.rb, line 73 def remote_condition condition_to_object(self._remote_condition) end
remote_uninit?()
click to toggle source
# File lib/core/endpoint.rb, line 97 def remote_uninit? check_state(REMOTE_UNINIT) end
transport()
click to toggle source
Return the transport associated with this endpoint.
@return [Transport] The transport.
# File lib/core/endpoint.rb, line 81 def transport self.connection.transport end