home *** CD-ROM | disk | FTP | other *** search
/ PC Pro 1999 April / DPPCPRO0499.ISO / April / Notes / 50b2wic.exe / DATA1.CAB / NotesProgramFilesJavaSupport / rt.jar / sun / misc / VM.class (.txt) < prev    next >
Encoding:
Java Class File  |  1998-04-23  |  1.9 KB  |  64 lines

  1. package sun.misc;
  2.  
  3. import java.util.Enumeration;
  4. import java.util.Vector;
  5.  
  6. // $FF: renamed from: sun.misc.VM
  7. public class class_0 {
  8.    public static final int STATE_GREEN = 1;
  9.    public static final int STATE_YELLOW = 2;
  10.    public static final int STATE_RED = 3;
  11.    static Vector callbacks = new Vector();
  12.    static VMNotifierThread notifier;
  13.    static VMNotifierThread notifier_red = new VMNotifierThread("Red Alloc State Notifier");
  14.  
  15.    public static final native int getState();
  16.  
  17.    static final native boolean threadsSuspended();
  18.  
  19.    public static boolean allowThreadSuspension(ThreadGroup var0, boolean var1) {
  20.       return var0.allowThreadSuspension(var1);
  21.    }
  22.  
  23.    public static native void unsuspendThreads();
  24.  
  25.    public static native void unsuspendSomeThreads();
  26.  
  27.    public static void registerVMNotification(VMNotification var0) {
  28.       callbacks.addElement(var0);
  29.    }
  30.  
  31.    static VMNotifierThread whichNotifier(int var0) {
  32.       return var0 == 3 ? notifier_red : notifier;
  33.    }
  34.  
  35.    public static void asChange(int var0, int var1) {
  36.       whichNotifier(var1).enqueue(var0, var1);
  37.    }
  38.  
  39.    public static void asChange_otherthread(int var0, int var1) {
  40.       Enumeration var2 = callbacks.elements();
  41.  
  42.       while(var2.hasMoreElements()) {
  43.          ((VMNotification)var2.nextElement()).newAllocState(var0, var1, true);
  44.       }
  45.  
  46.    }
  47.  
  48.    public static native void resumeJavaMonitor();
  49.  
  50.    public static native void suspendJavaMonitor();
  51.  
  52.    public static native void resetJavaMonitor();
  53.  
  54.    public static native void writeJavaMonitorReport();
  55.  
  56.    static {
  57.       notifier_red.setPriority(10);
  58.       notifier_red.start();
  59.       notifier = new VMNotifierThread("Alloc State Notifier");
  60.       notifier.setPriority(notifier_red.getPriority() - 1);
  61.       notifier.start();
  62.    }
  63. }
  64.