ariba.util.shutdown
Class RequestShutdownDelayer

java.lang.Object
  extended by ariba.util.shutdown.RequestShutdownDelayer
All Implemented Interfaces:
ShutdownDelayer

public class RequestShutdownDelayer
extends java.lang.Object
implements ShutdownDelayer

Generic shutdown delayer that allows short running requests to register themselves and delay a shutdown. A timeout can be given as well.


Method Summary
static void add(java.lang.Object key, java.lang.String name, long timeout)
           
 void cancelShutdown()
          Method invoked to indicate the cancelling of the shutdown sequence.
 boolean canShutdown()
          Specifies whether the system can safely shutdown.
static RequestShutdownDelayer getInstance()
           
 void initiateShutdown()
          Method invoked to indicate the beginning of the shutdown sequence.
static boolean isShuttingDown()
           
static void remove(java.lang.Object key)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

initiateShutdown

public void initiateShutdown()
Description copied from interface: ShutdownDelayer
Method invoked to indicate the beginning of the shutdown sequence. This is being called by the ShutdownManager, when an asynchronous shutdown is requested. Within this call, the application starts stopping some functionalities (for instance, new new user can login on this server) If any exception is being thrown, the delayer will be removed from the sequence.

Specified by:
initiateShutdown in interface ShutdownDelayer

canShutdown

public boolean canShutdown()
Description copied from interface: ShutdownDelayer
Specifies whether the system can safely shutdown. This is being called on a regular basis by the ShutdownManager to determine whether we can exit the VM. If any exception is being thrown, the delayer will be removed from the sequence.

Specified by:
canShutdown in interface ShutdownDelayer
Returns:
true if the system can shutdown

cancelShutdown

public void cancelShutdown()
Description copied from interface: ShutdownDelayer
Method invoked to indicate the cancelling of the shutdown sequence. This method is called by the ShutdownManager, when an asynchronous shutdown is cancelled. Within this call, the application should reverse the actions it took in initiateShutdown. The most common reason for cancelling a shutdown is the start of a rolling upgrade or rolling restart where the Ops code determines when each node is shutdown. If any exception is being thrown, the delayer will be removed from the sequence.

Specified by:
cancelShutdown in interface ShutdownDelayer

isShuttingDown

public static boolean isShuttingDown()

add

public static void add(java.lang.Object key,
                       java.lang.String name,
                       long timeout)

remove

public static void remove(java.lang.Object key)

getInstance

public static RequestShutdownDelayer getInstance()


AribaWeb User Interface Development Framework
Copyright © 2000-2014 Ariba, Inc. All Rights Reserved.