类 AutomaticJobRegistrar

  • 所有已实现的接口:
    org.springframework.beans.factory.Aware, org.springframework.beans.factory.InitializingBean, org.springframework.context.ApplicationContextAware, org.springframework.context.Lifecycle, org.springframework.context.Phased, org.springframework.context.SmartLifecycle, org.springframework.core.Ordered

    public class AutomaticJobRegistrar
    extends java.lang.Object
    implements org.springframework.core.Ordered, org.springframework.context.SmartLifecycle, org.springframework.context.ApplicationContextAware, org.springframework.beans.factory.InitializingBean
    Loads and unloads Jobs when the application context is created and destroyed. Each resource provided is loaded as an application context with the current context as its parent, and then all the jobs from the child context are registered under their bean names. A JobRegistry is required.
    从以下版本开始:
    2.1
    作者:
    Lucas Ward, Dave Syer, Mahmoud Ben Hassine
    • 方法详细资料

      • setApplicationContext

        public void setApplicationContext​(org.springframework.context.ApplicationContext applicationContext)
        The enclosing application context, which can be used to check if events come from the expected source.
        指定者:
        setApplicationContext 在接口中 org.springframework.context.ApplicationContextAware
        参数:
        applicationContext - the enclosing application context if there is one
        另请参阅:
        ApplicationContextAware.setApplicationContext(ApplicationContext)
      • setJobLoader

        public void setJobLoader​(JobLoader jobLoader)
        The job loader that will be used to load and manage jobs.
        参数:
        jobLoader - the JobLoader to set
      • getOrder

        public int getOrder()
        指定者:
        getOrder 在接口中 org.springframework.core.Ordered
      • setOrder

        public void setOrder​(int order)
        The order to start up and shutdown.
        参数:
        order - the order (default Ordered.LOWEST_PRECEDENCE).
        另请参阅:
        Ordered
      • afterPropertiesSet

        public void afterPropertiesSet()
        指定者:
        afterPropertiesSet 在接口中 org.springframework.beans.factory.InitializingBean
      • stop

        public void stop()
        Delegates to JobLoader.clear().
        指定者:
        stop 在接口中 org.springframework.context.Lifecycle
        另请参阅:
        Lifecycle.stop()
      • start

        public void start()
        Take all the contexts from the factories provided and pass them to the JobLoader.
        指定者:
        start 在接口中 org.springframework.context.Lifecycle
        另请参阅:
        Lifecycle.start()
      • isRunning

        public boolean isRunning()
        Check if this component has been started.
        指定者:
        isRunning 在接口中 org.springframework.context.Lifecycle
        返回:
        true if started successfully and not stopped
        另请参阅:
        Lifecycle.isRunning()
      • isAutoStartup

        public boolean isAutoStartup()
        指定者:
        isAutoStartup 在接口中 org.springframework.context.SmartLifecycle
      • getPhase

        public int getPhase()
        指定者:
        getPhase 在接口中 org.springframework.context.Phased
        指定者:
        getPhase 在接口中 org.springframework.context.SmartLifecycle
      • setPhase

        public void setPhase​(int phase)
        参数:
        phase - the phase.
        另请参阅:
        getPhase()
      • stop

        public void stop​(java.lang.Runnable callback)
        指定者:
        stop 在接口中 org.springframework.context.SmartLifecycle