org.safs.jvmagent
Class ShutdownEventMonitor

java.lang.Object
  extended by org.safs.jvmagent.SEMEventMonitor
      extended by org.safs.jvmagent.ShutdownEventMonitor
All Implemented Interfaces:
java.lang.Runnable

public class ShutdownEventMonitor
extends SEMEventMonitor

When injected into a JVM will monitor for a SEM JVMShutdown POST. Thus, the JVM must be launched with the following option for this monitor to be enabled:

An example STAF command that can trigger this event is:


Nested Class Summary
 
Nested classes/interfaces inherited from class org.safs.jvmagent.SEMEventMonitor
SEMEventMonitor.STAFMonitor
 
Field Summary
static java.lang.String SHUTDOWN_EVENT
          'JVMShutdown'
static java.lang.String SHUTDOWN_PROPERTY
          'JVMShutdownMonitor'
 
Fields inherited from class org.safs.jvmagent.SEMEventMonitor
_event, _msdelay, _process, _shutdown, _staf, _stafmon, _system, _thismon, DEFAULT_EVENT, DEFAULT_PROPERTY
 
Constructor Summary
ShutdownEventMonitor()
          Default constructor that simply forwards to the superclass.
 
Method Summary
protected  void performAction()
          Perform a System.exit(0) shutdown.
protected  void setEventCriteria()
          Subclasses override to designate a unique event to monitor.
 
Methods inherited from class org.safs.jvmagent.SEMEventMonitor
finalize, initialize, isTriggerEnabled, main, resetTrigger, run
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SHUTDOWN_EVENT

public static final java.lang.String SHUTDOWN_EVENT
'JVMShutdown'

See Also:
Constant Field Values

SHUTDOWN_PROPERTY

public static final java.lang.String SHUTDOWN_PROPERTY
'JVMShutdownMonitor'

See Also:
Constant Field Values
Constructor Detail

ShutdownEventMonitor

public ShutdownEventMonitor()
Default constructor that simply forwards to the superclass.

Method Detail

setEventCriteria

protected void setEventCriteria()
Description copied from class: SEMEventMonitor
Subclasses override to designate a unique event to monitor. This function will be called during object construction. The default setting to monitor is DEFAULT_EVENT.

This default implementation also sets the key name in System.properties that enables the trigger. This key name is stored in the local _system field. The default setting here is DEFAULT_PROPERTY.

Overrides:
setEventCriteria in class SEMEventMonitor

performAction

protected void performAction()
Perform a System.exit(0) shutdown.

Overrides:
performAction in class SEMEventMonitor