ShutdownHookPlugin (Quartz Parent POM 2.0.1 API)

Quartz Java



org.quartz.plugins.management Class ShutdownHookPlugin

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

public class ShutdownHookPlugin
extends Object
implements org.quartz.spi.SchedulerPlugin

This plugin catches the event of the JVM terminating (such as upon a CRTL-C) and tells the scheuler to shutdown.

Author:
James House
See Also:
Scheduler.shutdown(boolean)

Constructor Summary
ShutdownHookPlugin()
           
 
Method Summary
protected  org.slf4j.Logger getLog()
           
 void initialize(String name, Scheduler scheduler)
           Called during creation of the Scheduler in order to give the SchedulerPlugin a chance to initialize.
 boolean isCleanShutdown()
          Determine whether or not the plug-in is configured to cause a clean shutdown of the scheduler.
 void setCleanShutdown(boolean b)
          Set whether or not the plug-in is configured to cause a clean shutdown of the scheduler.
 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.
 void start()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ShutdownHookPlugin

public ShutdownHookPlugin()
Method Detail

isCleanShutdown

public boolean isCleanShutdown()
Determine whether or not the plug-in is configured to cause a clean shutdown of the scheduler.

The default value is true.

See Also:
Scheduler.shutdown(boolean)

setCleanShutdown

public void setCleanShutdown(boolean b)
Set whether or not the plug-in is configured to cause a clean shutdown of the scheduler.

The default value is true.

See Also:
Scheduler.shutdown(boolean)

getLog

protected org.slf4j.Logger getLog()

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 org.quartz.spi.SchedulerPlugin
Throws:
SchedulerConfigException - if there is an error initializing.
SchedulerException

start

public void start()
Specified by:
start in interface org.quartz.spi.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 org.quartz.spi.SchedulerPlugin


Copyright 2001-2011, Terracotta, Inc.