|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--fdda.utils.ObjectCache
The instance of this class (Singleton) caches instances of the classes that
have to be loaded dynamically (via Class.forName()). The loaded class itself
is also cached, in case of the need for several new instances.
The cache is
Class
Constructor Summary | |
protected |
ObjectCache()
The default constructor. |
Method Summary | |
static ObjectCache |
getInstance()
Returns the instance of ObjectCache (Singleton-Pattern). |
Object |
getObject(String className)
Returns an instance of a dynamically loaded class. |
Class |
loadClass(String className)
Loads a class dynamically, if it isn't cached. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
protected ObjectCache()
Method Detail |
public static ObjectCache getInstance()
public final Class loadClass(String className) throws ClassNotFoundException
className
- the name of the class
ClassNotFoundException
- if the class doesn't exist in the CLASSPATHpublic final Object getObject(String className) throws ClassNotFoundException, InstantiationException, IllegalAccessException
className
- the name of the class
ClassNotFoundException
- if the class doesn't exist in the CLASSPATH
InstantiationException
- if no instance of the class can be created
IllegalAccessException
- if no default constructor is available
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |