wyvern.world
Class SystemMonitor

java.lang.Object
  extended bywyvern.world.SystemMonitor
All Implemented Interfaces:
Timed

public final class SystemMonitor
extends java.lang.Object
implements Timed

This class touches a file periodically, which an external process monitors to make sure the server is alive. The file-touch happens on a game timer, so the game scheduler must be working properly in order for the file to be touched. The game scheduler is the most fragile piece of the system, which makes it a good candidate for monitoring.

Version:
1.0, Mar 12, 2001
Author:
Steve Yegge

Method Summary
 void checkFreeMem()
          Workaround for HotSpot garbage collector bugs in 1.4.1 and 1.4.2.
static void start()
          Starts the monitor timer.
 void timerExpired()
          Timer went off.
 java.lang.String toString()
          Returns debugging string.
static void writeShutdownFile()
          Writes a file that says we shut down on purpose.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Method Detail

start

public static void start()
Starts the monitor timer.


timerExpired

public void timerExpired()
Timer went off.

Specified by:
timerExpired in interface Timed

toString

public java.lang.String toString()
Returns debugging string.


writeShutdownFile

public static void writeShutdownFile()
Writes a file that says we shut down on purpose. If the VM just exits or crashes, this file doesn't get written.


checkFreeMem

public void checkFreeMem()
Workaround for HotSpot garbage collector bugs in 1.4.1 and 1.4.2. Run the GC manually if mem gets too low.