Class: BBMB::Util::App
- Inherits:
-
SBSM::App
- Object
- SBSM::App
- BBMB::Util::App
- Defined in:
- lib/bbmb/util/app.rb
Instance Attribute Summary collapse
-
#db_manager ⇒ Object
Returns the value of attribute db_manager.
-
#yus_server ⇒ Object
Returns the value of attribute yus_server.
Instance Method Summary collapse
-
#initialize ⇒ App
constructor
A new instance of App.
- #start_service ⇒ Object
Constructor Details
#initialize ⇒ App
Returns a new instance of App.
58 59 60 61 62 63 64 |
# File 'lib/bbmb/util/app.rb', line 58 def initialize super SBSM.logger.info "Starting Rack-Service #{self.class} and service #{BBMB.config.server_url}" Thread.new { start_service } end |
Instance Attribute Details
#db_manager ⇒ Object
Returns the value of attribute db_manager.
29 30 31 |
# File 'lib/bbmb/util/app.rb', line 29 def db_manager @db_manager end |
#yus_server ⇒ Object
Returns the value of attribute yus_server.
29 30 31 |
# File 'lib/bbmb/util/app.rb', line 29 def yus_server @yus_server end |
Instance Method Details
#start_service ⇒ Object
30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 |
# File 'lib/bbmb/util/app.rb', line 30 def start_service case BBMB.config.persistence when 'odba' DRb.install_id_conv ODBA::DRbIdConv.new BBMB.persistence = BBMB::Persistence::ODBA end BBMB.auth = DRb::DRbObject.new(nil, BBMB.config.auth_url) BBMB.server = BBMB::Util::Server.new(BBMB.persistence, self) BBMB.server.extend(DRbUndumped) BBMB.server = BBMB.server if(BBMB.config.update?) BBMB.server.run_updater end if(BBMB.config.invoice?) BBMB.server.run_invoicer end url = BBMB.config.server_url url.untaint DRb.start_service(url, BBMB.server) $SAFE = 1 $0 = BBMB.config.name SBSM.logger.info("started bbmb-server on #{url}") DRb.thread.join SBSM.logger.info('finished') { sprintf("starting bbmb-server on %s", url) } rescue Exception => error SBSM.logger.error('fatal') raise end |