Parent

Files

Class/Module Index [+]

Quicksearch

ActiveMessaging::Processor

Attributes

message[R]

Public Class Methods

subscribes_to(destination_name, headers={}) click to toggle source
# File lib/activemessaging/processor.rb, line 10
def subscribes_to destination_name, headers={}
  ActiveMessaging::Gateway.subscribe_to destination_name, self, headers
end

Public Instance Methods

logger() click to toggle source
# File lib/activemessaging/processor.rb, line 15
def logger()
  @@logger ||= ActiveMessaging.logger
end
on_error(exception) click to toggle source
# File lib/activemessaging/processor.rb, line 23
def on_error(exception)
  raise exception
end
on_message(message) click to toggle source
# File lib/activemessaging/processor.rb, line 19
def on_message(message)
  raise NotImplementedError.new("Implement the on_message method in your own processor class that extends ActiveMessaging::Processor")
end
process!(message) click to toggle source

Bind the processor to the current message so that the processor could potentially access headers and other attributes of the message

# File lib/activemessaging/processor.rb, line 29
def process!(message)
  @message = message
  return on_message(message.body)
rescue Object=>err
  begin
    on_error(err)
  rescue ActiveMessaging::AbortMessageException => rpe
    logger.error "Processor:process! - AbortMessageException caught."
    raise rpe
  rescue Object=>ex
    logger.error "Processor:process! - error in on_error, will propagate no further: #{ex.message}\n\t#{ex.backtrace.join("\n\t")}"
  end
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.