Class ShutdownHookPlugin

java.lang.Object
org.quartz.plugins.management.ShutdownHookPlugin
All Implemented Interfaces:
SchedulerPlugin

public class ShutdownHookPlugin extends Object implements SchedulerPlugin
This plugin catches the event of the JVM terminating (such as upon a CRTL-C) and tells the scheduler to shutdown.
Author:
James House
See Also:
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    initialize(String name, Scheduler scheduler)
    Called during creation of the Scheduler in order to give the SchedulerPlugin a chance to initialize.
    void
    Called in order to inform the SchedulerPlugin that it should free up all of it's resources because the scheduler is shutting down.
    void
    Called when the associated Scheduler is started, in order to let the plug-in know it can now make calls into the scheduler if it needs to.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • ShutdownHookPlugin

      public ShutdownHookPlugin()
  • Method Details

    • initialize

      public void initialize(String name, Scheduler scheduler) throws SchedulerException
      Called during creation of the Scheduler in order to give the SchedulerPlugin a chance to initialize.
      Specified by:
      initialize in interface SchedulerPlugin
      Parameters:
      name - The name by which the plugin is identified.
      scheduler - The scheduler to which the plugin is registered.
      Throws:
      SchedulerConfigException - if there is an error initializing.
      SchedulerException
    • start

      public void start()
      Description copied from interface: SchedulerPlugin
      Called when the associated Scheduler is started, in order to let the plug-in know it can now make calls into the scheduler if it needs to.
      Specified by:
      start in interface SchedulerPlugin
    • shutdown

      public void shutdown()
      Called in order to inform the SchedulerPlugin that it should free up all of it's resources because the scheduler is shutting down.
      Specified by:
      shutdown in interface SchedulerPlugin