Sponsored Link •
|
Advertisement
|
Advertisement
|
This page contains an archived post to the Design Forum (formerly called the Flexible Java Forum) made prior to February 25, 2002. If you wish to participate in discussions, please visit the new Artima Forums.
Message:
My problem is that I'm storing serialized file and class file in thanks in advance ...... public class MyClassLoader extends java.lang.ClassLoader { private HashMap cache = null; public synchronized Class loadClass(String className, /* check the local cache of classes */ /* check with the primordial class loader */ result = super.loadClass(className , true); /* call findClass() to fetch the class */ result = findClass(className); /* links the specified if asked to */ return result; }//loadClass private byte[] getClassFromDB(String className) byte[] result = nul; return result; }//getClassFromDB protected Class findClass(String className) throws Class result = null; /*now the great database is looked on upon*/ /* this method converts the array of bytes into an instance of result = defineClass(className,classData,0,classData.length); if(result == null) { throw new ClassFormatError(); }//if return result; }//findClass Replies: |
Sponsored Links
|