Reputation: 740
I would like to implement my own custom trigger. the main purpose of the trigger twice: on start date and end date (think of it as on/off switch, "on" state and start date and "off" state on end date).
What is best way to achieve that?
AbstractTrigger or implement ITrigger?
Implementing IScheduleBuilder is required?
Upvotes: 0
Views: 1465
Reputation: 740
I created the custom trigger by extending AbstactTrigger and implementing ISchedulerBuilder specified to this trigger type.
Upvotes: 1
Reputation: 6884
When you start to wonder whether to implement your own trigger there's possibly something going to the wrong direction. Quartz has a rich set of triggers that should cater for various scheduling needs which are based on interval/reoccurrence rules.
Not fully understanding your use case, I'd just schedule two triggers for start and stop actions. You could parametrize the triggers to supply the operation mode via job data map (TurnOn, TurnOff). You easily have start action to run on times like 8:35 am, every Monday, Wednesday and Saturday and corresponding stop trigger say the given dates on 10 pm.
Upvotes: 1