diff options
| author | Ted Ross <tross@apache.org> | 2009-10-02 17:45:58 +0000 |
|---|---|---|
| committer | Ted Ross <tross@apache.org> | 2009-10-02 17:45:58 +0000 |
| commit | 0f7c02dae11afed532bf60302cf2185f422fd23c (patch) | |
| tree | 9b176b6ebbe29419aa4bfe5d24102d5091dc2a72 /qpid/cpp/bindings/qmf/ruby | |
| parent | 4b60b602712e767a4438b2c6552cb50fa9aa97cb (diff) | |
| download | qpid-python-0f7c02dae11afed532bf60302cf2185f422fd23c.tar.gz | |
QMF Fixes:
- In ruby: waitForStable => wait_for_stable
- Setting an unknown attribute on connection settings now throws an exception
- Added connected? accessor to Connection
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@821109 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'qpid/cpp/bindings/qmf/ruby')
| -rw-r--r-- | qpid/cpp/bindings/qmf/ruby/qmf.rb | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/qpid/cpp/bindings/qmf/ruby/qmf.rb b/qpid/cpp/bindings/qmf/ruby/qmf.rb index 548b50874c..f79fb5ed88 100644 --- a/qpid/cpp/bindings/qmf/ruby/qmf.rb +++ b/qpid/cpp/bindings/qmf/ruby/qmf.rb @@ -60,7 +60,8 @@ module Qmf raise ArgumentError, "Value for attribute '#{key}' has unsupported type: #{val.class}" end - @impl.setAttr(key, v) + good = @impl.setAttr(key, v) + raise "Invalid attribute '#{key}'" unless good end def method_missing(name_in, *args) @@ -96,12 +97,17 @@ module Qmf @new_conn_handlers = [] @conn_handlers_to_delete = [] @conn_handlers = [] + @connected = nil @thread = Thread.new do run end end + def connected? + @connected + end + def kick @sockEngine.write(".") @sockEngine.flush @@ -123,7 +129,6 @@ module Qmf def run() eventImpl = Qmfengine::ResilientConnectionEvent.new - connected = nil new_handlers = nil del_handlers = nil bt_count = 0 @@ -140,7 +145,7 @@ module Qmf new_handlers.each do |nh| @conn_handlers << nh - nh.conn_event_connected() if connected + nh.conn_event_connected() if @connected end new_handlers = nil @@ -154,10 +159,10 @@ module Qmf begin case eventImpl.kind when Qmfengine::ResilientConnectionEvent::CONNECTED - connected = :true + @connected = :true @conn_handlers.each { |h| h.conn_event_connected() } when Qmfengine::ResilientConnectionEvent::DISCONNECTED - connected = nil + @connected = nil @conn_handlers.each { |h| h.conn_event_disconnected(eventImpl.errorText) } when Qmfengine::ResilientConnectionEvent::SESSION_CLOSED eventImpl.sessionContext.handler.sess_event_session_closed(eventImpl.sessionContext, eventImpl.errorText) @@ -1049,7 +1054,7 @@ module Qmf @operational = :false end - def waitForStable(timeout = nil) + def wait_for_stable(timeout = nil) synchronize do return if @stable if timeout |
