org.apache.jdo.impl.model.java.reflection
Class ReflectionJavaModelFactory

java.lang.Object
  extended by org.apache.jdo.impl.model.java.AbstractJavaModelFactory
      extended by org.apache.jdo.impl.model.java.reflection.ReflectionJavaModelFactory
All Implemented Interfaces:
JavaModelFactory
Direct Known Subclasses:
RuntimeJavaModelFactory

public abstract class ReflectionJavaModelFactory
extends AbstractJavaModelFactory

A reflection based JavaModelFactory implementation.

Since:
1.1

Constructor Summary
ReflectionJavaModelFactory()
           
 
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 org.apache.jdo.impl.model.java.AbstractJavaModelFactory
createJavaModel, getJavaModel, getJavaType
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ReflectionJavaModelFactory

public ReflectionJavaModelFactory()
Method Detail

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 class
initialize - whether the class must be initialized
loader - 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.


Copyright © 2005-2012 Apache Software Foundation. All Rights Reserved.