org.springframework.scheduling.quartz

Class AdaptableJobFactory

  • java.lang.Object
    • org.springframework.scheduling.quartz.AdaptableJobFactory
    • Constructor Detail

      • AdaptableJobFactory

        public AdaptableJobFactory()
    • Method Detail

      • createJobInstance

        protected java.lang.Object createJobInstance(TriggerFiredBundle bundle)
                                              throws java.lang.Exception
        Create an instance of the specified job class.

        Can be overridden to post-process the job instance.

        Parameters:
        bundle - the TriggerFiredBundle from which the JobDetail and other info relating to the trigger firing can be obtained
        Returns:
        the job instance
        Throws:
        java.lang.Exception - if job instantiation failed
      • adaptJob

        protected Job adaptJob(java.lang.Object jobObject)
                        throws java.lang.Exception
        Adapt the given job object to the Quartz Job interface.

        The default implementation supports straight Quartz Jobs as well as Runnables, which get wrapped in a DelegatingJob.

        Parameters:
        jobObject - the original instance of the specified job class
        Returns:
        the adapted Quartz Job instance
        Throws:
        java.lang.Exception - if the given job could not be adapted
        See Also:
        DelegatingJob