Class: Killbill::Plugin::JPlugin

Inherits:
Object
  • Object
show all
Defined in:
lib/killbill/jplugin.rb

Direct Known Subclasses

Api::NotificationPluginApi

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(plugin_class_name, services = {}) ⇒ JPlugin

Called by the Killbill lifecycle when instantiating the plugin



40
41
42
# File 'lib/killbill/jplugin.rb', line 40

def initialize(plugin_class_name, services = {})
  @delegate_plugin = Creator.new(plugin_class_name).create(services)
end

Instance Attribute Details

#delegate_pluginObject (readonly)

Returns the value of attribute delegate_plugin.



19
20
21
# File 'lib/killbill/jplugin.rb', line 19

def delegate_plugin
  @delegate_plugin
end

#rack_handlerObject (readonly)

Returns the value of attribute rack_handler.



19
20
21
# File 'lib/killbill/jplugin.rb', line 19

def rack_handler
  @rack_handler
end

Instance Method Details

#is_activeObject



35
36
37
# File 'lib/killbill/jplugin.rb', line 35

def is_active
  @delegate_plugin.active
end

#loggerObject



44
45
46
47
# File 'lib/killbill/jplugin.rb', line 44

def logger
  require 'logger'
  @delegate_plugin.nil? ? ::Logger.new(STDOUT) : @delegate_plugin.logger
end

#start_pluginObject

Called by the Killbill lifecycle when initializing the plugin



24
25
26
27
# File 'lib/killbill/jplugin.rb', line 24

def start_plugin
  @delegate_plugin.start_plugin
  configure_rack_handler
end

#stop_pluginObject

Called by the Killbill lifecycle when stopping the plugin



30
31
32
33
# File 'lib/killbill/jplugin.rb', line 30

def stop_plugin
  unconfigure_rack_handler
  @delegate_plugin.stop_plugin
end