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 | ee477a65e6ac9532a27cdf589df6d9aba7d97796 (patch) | |
| tree | 7699a50a7a5bc3fdf2a3550cb288837a92dd0fba /cpp/bindings/qmf/ruby | |
| parent | cc6ec1079431b7eb45031d36f5a6ad5e9a6675ac (diff) | |
| download | qpid-python-ee477a65e6ac9532a27cdf589df6d9aba7d97796.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/qpid@821109 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/bindings/qmf/ruby')
| -rw-r--r-- | cpp/bindings/qmf/ruby/qmf.rb | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/cpp/bindings/qmf/ruby/qmf.rb b/cpp/bindings/qmf/ruby/qmf.rb index 548b50874c..f79fb5ed88 100644 --- a/cpp/bindings/qmf/ruby/qmf.rb +++ b/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 |
