1 21 package com.db4o; 22 23 import java.lang.reflect.*; 24 import java.net.*; 25 import java.util.*; 26 27 import com.db4o.config.*; 28 import com.db4o.ext.*; 29 import com.db4o.foundation.*; 30 import com.db4o.reflect.*; 31 import com.db4o.reflect.generic.*; 32 import com.db4o.types.*; 33 34 37 public class JDK { 38 39 Thread addShutdownHook(Runnable runnable){ 40 return null; 41 } 42 43 Db4oCollections collections(YapStream session){ 44 return null; 45 } 46 47 Class constructorClass(){ 48 return null; 49 } 50 51 Object createReferenceQueue() { 52 return null; 53 } 54 55 public Object createWeakReference(Object obj){ 56 return obj; 57 } 58 59 Object createYapRef(Object queue, YapObject ref, Object obj) { 60 return null; 61 } 62 63 Object deserialize(byte[] bytes) { 64 throw new Db4oException(Messages.NOT_IMPLEMENTED); 65 } 66 67 public Config4Class extendConfiguration(ReflectClass clazz, Configuration config, Config4Class classConfig) { 68 return classConfig; 69 } 70 71 void forEachCollectionElement(Object obj, Visitor4 visitor) { 72 if(! Deploy.csharp){ 73 Enumeration e = null; 74 if (obj instanceof Hashtable) { 75 e = ((Hashtable)obj).elements(); 76 } else if (obj instanceof Vector) { 77 e = ((Vector)obj).elements(); 78 } 79 if (e != null) { 80 while (e.hasMoreElements()) { 81 visitor.visit(e.nextElement()); 82 } 83 } 84 } 85 } 86 87 String format(Date date, boolean showTime) { 88 return date.toString(); 89 } 90 91 Object getContextClassLoader(){ 92 return null; 93 } 94 95 Object getYapRefObject(Object obj) { 96 return null; 97 } 98 99 boolean isCollectionTranslator(Config4Class config) { 100 if(!Deploy.csharp){ 101 if (config != null) { 102 ObjectTranslator ot = config.getTranslator(); 103 if (ot != null) { 104 return ot instanceof THashtable; 105 } 106 } 107 } 108 return false; 109 } 110 111 public boolean isConnected(Socket socket){ 112 return socket != null; 113 } 114 115 public int ver(){ 116 return 1; 117 } 118 119 void killYapRef(Object obj){ 120 121 } 122 123 synchronized void lockFile(Object file) { 124 } 125 126 130 boolean methodIsAvailable(String className, String methodName, Class [] params) { 131 return false; 132 } 133 134 void pollReferenceQueue(YapStream session, Object referenceQueue) { 135 136 } 137 138 public void registerCollections(GenericReflector reflector) { 139 140 } 141 142 void removeShutdownHook(Thread thread){ 143 144 } 145 146 public Constructor serializableConstructor(Class clazz){ 147 return null; 148 } 149 150 byte[] serialize(Object obj) throws Exception { 151 throw new Db4oException(Messages.NOT_IMPLEMENTED); 152 } 153 154 void setAccessible(Object accessibleObject) { 155 } 156 157 boolean isEnum(Reflector reflector, ReflectClass clazz) { 158 return false; 159 } 160 161 synchronized void unlockFile(Object file) { 162 } 163 164 public Object weakReferenceTarget(Object weakRef){ 165 return weakRef; 166 } 167 168 public Reflector createReflector(Object classLoader) { 169 return null; 170 } 171 } 172 | Popular Tags |