KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > db4o > JDK


1 /* Copyright (C) 2004 - 2006 db4objects Inc. http://www.db4o.com
2
3 This file is part of the db4o open source object database.
4
5 db4o is free software; you can redistribute it and/or modify it under
6 the terms of version 2 of the GNU General Public License as published
7 by the Free Software Foundation and as clarified by db4objects' GPL
8 interpretation policy, available at
9 http://www.db4o.com/about/company/legalpolicies/gplinterpretation/
10 Alternatively you can write to db4objects, Inc., 1900 S Norfolk Street,
11 Suite 350, San Mateo, CA 94403, USA.
12
13 db4o is distributed in the hope that it will be useful, but WITHOUT ANY
14 WARRANTY; without even the implied warranty of MERCHANTABILITY or
15 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
16 for more details.
17
18 You should have received a copy of the GNU General Public License along
19 with this program; if not, write to the Free Software Foundation, Inc.,
20 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */

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 /**
35  * @exclude
36  */

37 public class JDK {
38     
39     Thread JavaDoc addShutdownHook(Runnable JavaDoc runnable){
40         return null;
41     }
42     
43     Db4oCollections collections(YapStream session){
44         return null;
45     }
46     
47     Class JavaDoc constructorClass(){
48         return null;
49     }
50     
51     Object JavaDoc createReferenceQueue() {
52         return null;
53     }
54
55     public Object JavaDoc createWeakReference(Object JavaDoc obj){
56         return obj;
57     }
58     
59     Object JavaDoc createYapRef(Object JavaDoc queue, YapObject ref, Object JavaDoc obj) {
60         return null;
61     }
62     
63     Object JavaDoc 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 JavaDoc 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 JavaDoc format(Date date, boolean showTime) {
88         return date.toString();
89     }
90     
91     Object JavaDoc getContextClassLoader(){
92         return null;
93     }
94
95     Object JavaDoc getYapRefObject(Object JavaDoc 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 JavaDoc obj){
120         
121     }
122     
123     synchronized void lockFile(Object JavaDoc file) {
124     }
125     
126     /**
127      * use for system classes only, since not ClassLoader
128      * or Reflector-aware
129      */

130     boolean methodIsAvailable(String JavaDoc className, String JavaDoc methodName, Class JavaDoc[] params) {
131         return false;
132     }
133
134     void pollReferenceQueue(YapStream session, Object JavaDoc referenceQueue) {
135         
136     }
137     
138     public void registerCollections(GenericReflector reflector) {
139         
140     }
141     
142     void removeShutdownHook(Thread JavaDoc thread){
143         
144     }
145     
146     public Constructor serializableConstructor(Class JavaDoc clazz){
147         return null;
148     }
149     
150     byte[] serialize(Object JavaDoc obj) throws Exception JavaDoc{
151         throw new Db4oException(Messages.NOT_IMPLEMENTED);
152     }
153
154     void setAccessible(Object JavaDoc accessibleObject) {
155     }
156     
157     boolean isEnum(Reflector reflector, ReflectClass clazz) {
158         return false;
159     }
160     
161     synchronized void unlockFile(Object JavaDoc file) {
162     }
163     
164     public Object JavaDoc weakReferenceTarget(Object JavaDoc weakRef){
165         return weakRef;
166     }
167     
168     public Reflector createReflector(Object JavaDoc classLoader) {
169         return null;
170     }
171 }
172
Popular Tags