Uploaded image for project: 'Confluence Data Center'
  1. Confluence Data Center
  2. CONFSERVER-20162

Autowire job plugin modules

    XMLWordPrintable

Details

    • We collect Confluence feedback from various sources, and we evaluate what we've collected when planning our product roadmap. To understand how this piece of feedback will be reviewed, see our Implementation of New Features Policy.

    Description

      NOTE: This suggestion is for Confluence Server. Using Confluence Cloud? 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.

      Attachments

        Issue Links

          Activity

            People

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

              Dates

                Created:
                Updated:
                Resolved: