Quartz Plugin

Add a dynamic scheduleJob() method to all services/artefacts

Details

  • Type: New Feature New Feature
  • Status: Open Open
  • Priority: Major Major
  • Resolution: Unresolved
  • Affects Version/s: 0.2
  • Fix Version/s: 1.0-RC
  • Component/s: None
  • Labels:
    None

Description

It would be so useful to be able to schedule some code to run at a later point, anywhere in code, that doesn't necessarily relate to a regular job - from a service or other artefact using a dynamic method. e.g:

class MyService implements InitializingBean {

  void afterPropertiesSet() {
      def svc = this
      scheduleJob( fromNow: 10*60*1000, transactional:true ) { 
           svc.loadInfo()
      }
  }
 
  void loadInfo() {
      // talk to some remote webservice to get startup info
      log.info('hello world') // and use dynamic vars we cannot use in afterPropertiesSet
  }
}

Currently you can't use log etc dynamic vars within afterPropertiesSet as the context has not finished initializing.

Activity

There are no comments yet on this issue.

People

Vote (9)
Watch (7)

Dates

  • Created:
    Updated: