Module: TrinidadScheduler::AppJob

Includes:
ScheduledJob
Defined in:
lib/trinidad_scheduler_extension/app_job.rb

Instance Attribute Summary

Attributes included from ScheduledJob

#_context, #_logger

Class Method Summary collapse

Methods included from ScheduledJob

#execute, #run

Class Method Details

.included(other_obj) ⇒ Object



6
7
8
9
10
11
12
13
# File 'lib/trinidad_scheduler_extension/app_job.rb', line 6

def self.included(other_obj)
  new_job = TrinidadScheduler::JobDetail.new("#{ other_obj.job_detail_name rescue other_obj }", "#{other_obj}", other_obj)
  begin 
    TrinidadScheduler[$servlet_context].schedule_job(new_job, other_obj.trigger)
  rescue Exception => ex
    raise JobError.new(ex)
  end
end