org.datanucleus.enhancer
Class AbstractImplementationCreator

java.lang.Object
  extended by org.datanucleus.enhancer.AbstractImplementationCreator
All Implemented Interfaces:
org.datanucleus.ImplementationCreator
Direct Known Subclasses:
ASMImplementationCreator

public abstract class AbstractImplementationCreator
extends java.lang.Object
implements org.datanucleus.ImplementationCreator

Abstract representation of an implementation creator. Creates implementations of interfaces or abstract classes.


Field Summary
protected  EnhancerClassLoader loader
          ClassLoader for newly defined classes
protected static org.datanucleus.util.Localiser LOCALISER
           
 
Constructor Summary
AbstractImplementationCreator()
          Constructor.
 
Method Summary
 java.lang.ClassLoader getClassLoader()
          Accessor for the ClassLoader.
protected abstract  AbstractImplementationGenerator getGenerator(org.datanucleus.metadata.AbstractClassMetaData acmd, java.lang.String implClassName)
          Method to return the generator for the implementation.
protected  javax.jdo.spi.PersistenceCapable newInstance(org.datanucleus.metadata.ClassMetaData cmd, org.datanucleus.ClassLoaderResolver clr)
          Constructs an implementation for an abstract class and instantiates it.
 java.lang.Object newInstance(java.lang.Class cls, org.datanucleus.metadata.MetaDataManager mmgr, org.datanucleus.ClassLoaderResolver clr)
          Method to generate an instance of an interface, abstract class, or concrete PC class.
protected  javax.jdo.spi.PersistenceCapable newInstance(org.datanucleus.metadata.InterfaceMetaData imd, org.datanucleus.ClassLoaderResolver clr)
          Constructs an implementation for an interface and instantiates it.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LOCALISER

protected static org.datanucleus.util.Localiser LOCALISER

loader

protected final EnhancerClassLoader loader
ClassLoader for newly defined classes

Constructor Detail

AbstractImplementationCreator

public AbstractImplementationCreator()
Constructor.

Method Detail

newInstance

public java.lang.Object newInstance(java.lang.Class cls,
                                    org.datanucleus.metadata.MetaDataManager mmgr,
                                    org.datanucleus.ClassLoaderResolver clr)
Method to generate an instance of an interface, abstract class, or concrete PC class.

Specified by:
newInstance in interface org.datanucleus.ImplementationCreator
Parameters:
cls - The class of the interface, abstract class, or concrete class defined in MetaData
mmgr - MetaData Manager
clr - ClassLoader resolver
Returns:
The instance of this type

newInstance

protected javax.jdo.spi.PersistenceCapable newInstance(org.datanucleus.metadata.InterfaceMetaData imd,
                                                       org.datanucleus.ClassLoaderResolver clr)
                                                throws java.lang.ClassNotFoundException,
                                                       java.lang.InstantiationException,
                                                       java.lang.IllegalAccessException
Constructs an implementation for an interface and instantiates it.

Parameters:
imd - The MetaData for the interface
clr - The ClassLoader
Returns:
The instance implementing the interface
Throws:
java.lang.ClassNotFoundException
java.lang.InstantiationException
java.lang.IllegalAccessException

newInstance

protected javax.jdo.spi.PersistenceCapable newInstance(org.datanucleus.metadata.ClassMetaData cmd,
                                                       org.datanucleus.ClassLoaderResolver clr)
                                                throws java.lang.ClassNotFoundException,
                                                       java.lang.InstantiationException,
                                                       java.lang.IllegalAccessException
Constructs an implementation for an abstract class and instantiates it.

Parameters:
cmd - The MetaData for the abstract class
clr - The ClassLoader
Returns:
The instance implementing the abstract class.
Throws:
java.lang.ClassNotFoundException
java.lang.InstantiationException
java.lang.IllegalAccessException

getGenerator

protected abstract AbstractImplementationGenerator getGenerator(org.datanucleus.metadata.AbstractClassMetaData acmd,
                                                                java.lang.String implClassName)
Method to return the generator for the implementation.

Parameters:
acmd - MetaData for the class/interface we need an implementation for
implClassName - Name of the implementation class to create
Returns:
The implementation generator

getClassLoader

public java.lang.ClassLoader getClassLoader()
Accessor for the ClassLoader.

Specified by:
getClassLoader in interface org.datanucleus.ImplementationCreator
Returns:
The ClassLoader


Copyright © 2009. All Rights Reserved.