Class: Killbill::HelloWorld::HelloWorldPlugin

Inherits:
Plugin::Notification
  • Object
show all
Defined in:
lib/helloworld.rb

Instance Method Summary collapse

Instance Method Details

#after_requestObject



18
19
20
21
# File 'lib/helloworld.rb', line 18

def after_request
  # return DB connections to the Pool if required
  ActiveRecord::Base.connection.close
end

#on_event(event) ⇒ Object



23
24
25
26
27
28
29
# File 'lib/helloworld.rb', line 23

def on_event(event)
  if @listener.nil?
    logger.warn "HelloWorldPlugin wasn't started properly - check logs"
    return
  end
  @listener.update(event., event.tenant_id) if [:ACCOUNT_CREATION, :ACCOUNT_CHANGE].include?(event.event_type)
end

#start_pluginObject



13
14
15
16
# File 'lib/helloworld.rb', line 13

def start_plugin
  super
  @listener = Killbill::HelloWorld::Initializer.instance.initialize!(@conf_dir, @kb_apis, @logger)
end