Uploaded image for project: 'Confluence Cloud'
  1. Confluence Cloud
  2. CONFCLOUD-20162

Autowire job plugin modules

XMLWordPrintable

    • Our product teams collect and evaluate feedback from a number of different sources. To learn more about how we use customer feedback in the planning process, check out our new feature policy.

      NOTE: This suggestion is for Confluence Cloud. Using Confluence Server? See the corresponding suggestion.

      Currently job plugin modules are not dependency-injected (or "autowired"). They are instantiated by Quartz directly instead, because the module descriptor constructs the JobDetail bean this way:

      JobDetail jobDetail = new JobDetail();
      jobDetail.setGroup(getPluginKey());
      jobDetail.setName(getKey());
      jobDetail.setJobClass(getModuleClass());
      JobDataMap jobDetailMap = new JobDataMap();
      jobDetailMap.put("runOncePerCluster", String.valueOf(perClusterJob));
      jobDetail.setJobDataMap(jobDetailMap);
      return jobDetail;
      

      Although I haven't tested it, it should be possible to construct a delegating job class and pass the autowired plugin Job to it via the JobDataMap. I think this is how the MethodInvokingJobDetailFactoryBean works in Spring.

              matt@atlassian.com Matt Ryall
              matt@atlassian.com Matt Ryall
              Votes:
              5 Vote for this issue
              Watchers:
              6 Start watching this issue

                Created:
                Updated:
                Resolved: