History | Log In     View a printable version of the current page.  
Issue Details (XML | Word | Printable)

Key: GRAILSPLUGINS-357
Type: New Feature New Feature
Status: Open Open
Priority: Major Major
Assignee: Sergey Nebolsin
Reporter: Marc Palmer
Votes: 1
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
Grails Plugins

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

Created: 07/May/08 09:41 AM   Updated: 12/May/08 05:42 PM
Component/s: Grails-Quartz
Affects Version/s: Grails-Quartz 0.2
Fix Version/s: Grails-Quartz 0.4

Time Tracking:
Not Specified


 Description  « Hide
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.



 All   Comments   Work Log   Change History      Sort Order: Ascending order - Click to sort in descending order
There are no comments yet on this issue.