1 21 package com.db4o; 22 23 import com.db4o.foundation.*; 24 25 28 public abstract class Debug extends Debug4 { 29 30 public static final boolean indexAllFields = false; 31 32 public static final boolean queries = false; 33 34 public static final boolean atHome = false; 35 36 public static boolean longTimeOuts = false; 37 38 public static final boolean freespace = Deploy.debug ? true :false; 39 40 public static final boolean xbytes = freespace ? true : false; 41 42 public static final boolean freespaceChecker = false; 43 44 public static final boolean checkSychronization = false; 45 46 public static final boolean configureAllClasses = indexAllFields; 47 public static final boolean configureAllFields = indexAllFields; 48 49 public static final boolean weakReferences = true; 50 51 public static final boolean fakeServer = false; 52 53 public static final boolean messages = false; 54 55 public static final boolean nio = true; 56 57 public static final boolean lockFile = true; 58 59 public static void expect(boolean cond){ 60 if(! cond){ 61 throw new RuntimeException ("Should never happen"); 62 } 63 } 64 65 public static void ensureLock(Object obj) { 66 if (atHome) { 67 try { 68 obj.wait(1); 69 } catch (IllegalMonitorStateException imse) { 70 System.err.println("No Lock Alarm."); 71 imse.printStackTrace(); 72 } catch (Exception e) { 73 e.printStackTrace(); 74 } 75 } 76 } 77 78 public static boolean exceedsMaximumBlockSize(int a_length) { 79 if (a_length > YapConst.MAXIMUM_BLOCK_SIZE) { 80 if (atHome) { 81 System.err.println("Maximum block size exceeded!!!"); 82 new Exception ().printStackTrace(); 83 } 84 return true; 85 } 86 return false; 87 } 88 89 public static boolean exceedsMaximumArrayEntries(int a_entries, boolean a_primitive){ 90 if (a_entries > (a_primitive ? YapConst.MAXIMUM_ARRAY_ENTRIES_PRIMITIVE : YapConst.MAXIMUM_ARRAY_ENTRIES)) { 91 if (atHome) { 92 System.err.println("Maximum array elements exceeded!!!"); 93 new Exception ().printStackTrace(); 94 } 95 return true; 96 } 97 return false; 98 } 99 } 100 | Popular Tags |