Class: Killbill::Plugin::Api::NotificationPluginApi

Inherits:
JPlugin show all
Defined in:
lib/killbill/gen/plugin-api/notification_plugin_api.rb

Instance Attribute Summary

Attributes inherited from JPlugin

#delegate_plugin, #rack_handler

Instance Method Summary collapse

Methods inherited from JPlugin

#is_active, #logger, #start_plugin, #stop_plugin

Constructor Details

#initialize(real_class_name, services = {}) ⇒ NotificationPluginApi

Returns a new instance of NotificationPluginApi.



37
38
39
# File 'lib/killbill/gen/plugin-api/notification_plugin_api.rb', line 37

def initialize(real_class_name, services = {})
  super(real_class_name, services)
end

Instance Method Details

#on_event(killbillEvent) ⇒ Object



43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
# File 'lib/killbill/gen/plugin-api/notification_plugin_api.rb', line 43

def on_event(killbillEvent)

  # conversion for killbillEvent [type = org.killbill.billing.notification.plugin.api.ExtBusEvent]
  killbillEvent = Killbill::Plugin::Model::ExtBusEvent.new.to_ruby(killbillEvent) unless killbillEvent.nil?
  begin
    @delegate_plugin.on_event(killbillEvent)
  rescue Exception => e
    message = "Failure in on_event: #{e}"
    unless e.backtrace.nil?
      message = "#{message}\n#{e.backtrace.join("\n")}"
    end
    logger.warn message
    raise Java::org.killbill.billing.payment.plugin.api.PaymentPluginApiException.new("on_event failure", e.message)
  ensure
    @delegate_plugin.after_request
  end
end