Module: TrinidadScheduler::ScheduledJob
- Included in:
- AppJob
- Defined in:
- lib/trinidad_scheduler_extension/scheduled_job.rb
Defined Under Namespace
Classes: JobError
Instance Attribute Summary collapse
-
#_context ⇒ Object
Returns the value of attribute _context.
-
#_logger ⇒ Object
Returns the value of attribute _logger.
Instance Method Summary collapse
Instance Attribute Details
#_context ⇒ Object
Returns the value of attribute _context.
5 6 7 |
# File 'lib/trinidad_scheduler_extension/scheduled_job.rb', line 5 def _context @_context end |
#_logger ⇒ Object
Returns the value of attribute _logger.
6 7 8 |
# File 'lib/trinidad_scheduler_extension/scheduled_job.rb', line 6 def _logger @_logger end |
Instance Method Details
#execute(context) ⇒ Object
12 13 14 15 16 17 18 19 20 |
# File 'lib/trinidad_scheduler_extension/scheduled_job.rb', line 12 def execute(context) begin @_context = context @_logger = org.apache.log4j.Logger.getLogger("#{self.class}") run() rescue Exception => ex raise JobError.new(ex) end end |
#run ⇒ Object
8 9 10 |
# File 'lib/trinidad_scheduler_extension/scheduled_job.rb', line 8 def run raise "Implement a [run] method if you are going to use #{self.class} as a job class" end |