Class: ManqodDB
Overview
this file is part of manqod manqod is distributed under the CDDL licence the author of manqod is Dobai-Pataky Balint([email protected])
Instance Attribute Summary collapse
-
#acache ⇒ Object
readonly
Returns the value of attribute acache.
-
#cache ⇒ Object
readonly
Returns the value of attribute cache.
-
#ccache ⇒ Object
readonly
Returns the value of attribute ccache.
-
#connected ⇒ Object
readonly
Returns the value of attribute connected.
-
#manqod_db ⇒ Object
readonly
Returns the value of attribute manqod_db.
Instance Method Summary collapse
Instance Attribute Details
#acache ⇒ Object (readonly)
Returns the value of attribute acache.
11 12 13 |
# File 'lib/Common/ManqodDB.rb', line 11 def acache @acache end |
#cache ⇒ Object (readonly)
Returns the value of attribute cache.
11 12 13 |
# File 'lib/Common/ManqodDB.rb', line 11 def cache @cache end |
#ccache ⇒ Object (readonly)
Returns the value of attribute ccache.
11 12 13 |
# File 'lib/Common/ManqodDB.rb', line 11 def ccache @ccache end |
#connected ⇒ Object (readonly)
Returns the value of attribute connected.
11 12 13 |
# File 'lib/Common/ManqodDB.rb', line 11 def connected @connected end |
#manqod_db ⇒ Object (readonly)
Returns the value of attribute manqod_db.
11 12 13 |
# File 'lib/Common/ManqodDB.rb', line 11 def manqod_db @manqod_db end |
Instance Method Details
#connect_to_server ⇒ Object
28 29 30 31 32 33 34 35 36 37 38 |
# File 'lib/Common/ManqodDB.rb', line 28 def connect_to_server einfo("connecting to #{@manqod_db_uri}","drb") @connected=false begin @manqod_db=DRb::DRbObject.new_with_uri(@manqod_db_uri) unless @manqod_db_uri.nil? @connected=@manqod_db.alive? rescue =>err Eprint.eerror("connecting failed: #{err}\n#{err.backtrace.join("\n")}","drb") end @connected end |
#set_manqod_db_uri(manqod_db_uri) ⇒ Object
13 14 15 16 17 18 19 20 21 22 23 24 25 26 |
# File 'lib/Common/ManqodDB.rb', line 13 def set_manqod_db_uri(manqod_db_uri) @manqod_db_uri=manqod_db_uri connect_to_server begin @cache = Memcache.new([@manqod_db.connection['cache_host']],{:prefix_key=>@manqod_db.key_name}) if connected @acache = Memcache.new([@manqod_db.admin.connection['cache_host']],{:prefix_key=>@manqod_db.admin.key_name}) if connected @ccache = Memcache.new([@manqod_db.client.connection['cache_host']],{:prefix_key=>@manqod_db.client.key_name}) if connected && manqod_db.client GtkAttributeStorage.instance.load_all rescue => err Eprint.eerror("connecting to cache failed: #{err}\n#{err.backtrace.join("\n")}","drb") end @connected end |