org.apache.jdo.impl.model.java.reflection
Class ReflectionJavaModelFactory
java.lang.Object
org.apache.jdo.impl.model.java.AbstractJavaModelFactory
org.apache.jdo.impl.model.java.reflection.ReflectionJavaModelFactory
- All Implemented Interfaces:
- JavaModelFactory
- Direct Known Subclasses:
- RuntimeJavaModelFactory, XMLExists.XMLExistsJDOModelFactory
- public abstract class ReflectionJavaModelFactory
- extends AbstractJavaModelFactory
A reflection based JavaModelFactory implementation.
- Since:
- 1.1
Method Summary |
static java.lang.Class |
forNamePrivileged(java.lang.String name,
boolean initialize,
java.lang.ClassLoader loader)
Calls Class.forName in a doPrivileged block. |
static java.lang.ClassLoader |
getClassLoaderPrivileged(java.lang.Class clazz)
Calls getClassLoader on the specified Class instance in a
doPrivileged block. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
msg
private static final I18NHelper msg
- I18N support
ReflectionJavaModelFactory
public ReflectionJavaModelFactory()
getClassLoaderPrivileged
public static java.lang.ClassLoader getClassLoaderPrivileged(java.lang.Class clazz)
- Calls getClassLoader on the specified Class instance in a
doPrivileged block. Any SecurityException is wrapped into a
ModelFatalException.
- Parameters:
clazz
- the class to get the ClassLoader from.
- Returns:
- the class loader that loaded the specified Class instance.
- Throws:
ModelFatalException
- wraps the SecurityException thrown by
getClassLoader.
forNamePrivileged
public static java.lang.Class forNamePrivileged(java.lang.String name,
boolean initialize,
java.lang.ClassLoader loader)
throws java.lang.ClassNotFoundException
- Calls Class.forName in a doPrivileged block. Any SecurityException is
wrapped into a ModelFatalException.
- Parameters:
name
- fully qualified name of the desired classinitialize
- whether the class must be initializedloader
- class loader from which the class must be loaded
- Returns:
- class object representing the desired class.
- Throws:
ModelFatalException
- wraps the SecurityException thrown by
getClassLoader.
java.lang.ClassNotFoundException
- if the class cannot be located by the
specified class loader.