goodslib
Class ClassLibrary

java.lang.Object
  extended bygoodsjpi.Persistent
      extended bygoodslib.HashTable
          extended bygoodslib.ClassLibrary
All Implemented Interfaces:
java.io.Serializable

public class ClassLibrary
extends HashTable

Class providing load and store of classes from/to database

See Also:
Serialized Form

Field Summary
protected  goodslib.PersistentClassLoader loader
           
 
Fields inherited from class goodslib.HashTable
count, loadFactor, table, threshold
 
Fields inherited from class goodsjpi.Persistent
defaultMetaobject, metaobject
 
Constructor Summary
ClassLibrary()
           
 
Method Summary
 java.lang.Class loadClass(java.lang.String name)
          Load class from the storage.
 void storeClass(java.lang.String className)
          Store class with specified name in the storage.
 
Methods inherited from class goodslib.HashTable
canonicalHashCode, clear, get, put, put, rehash, remove, size
 
Methods inherited from class goodsjpi.Persistent
attachToStorage, clone, clusterWith, finalize, getDatabase, getOid, getStorageId, hashCode, onLoad
 
Methods inherited from class java.lang.Object
equals, getClass, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

loader

protected transient goodslib.PersistentClassLoader loader
Constructor Detail

ClassLibrary

public ClassLibrary()
Method Detail

storeClass

public void storeClass(java.lang.String className)
                throws java.io.IOException
Store class with specified name in the storage. Parameter className should be fully qualified Java class name separated by period character. File name of the class file is produced by replacing period character with OS file separator symbol and appending suffix ".class". Then contents of the file is placed in GOODS storage and reference to it is inserted in the hash table. This class can throw IOException if it fails to read the class file data.

Throws:
java.io.IOException

loadClass

public java.lang.Class loadClass(java.lang.String name)
Load class from the storage. The name parameter should be the same as in correspondent storeClass method. This name is used as search key in hash table with stored classes. Class is loaded and resolved using special persistent class loader and pointer to created Class object is returned. If no class definition was found in the hash table, than null is returned.