Class ImplementationCreatorImpl

  • All Implemented Interfaces:
    java.io.Serializable, ImplementationCreator

    public class ImplementationCreatorImpl
    extends java.lang.Object
    implements java.io.Serializable, ImplementationCreator
    Creator of persistable objects using the ASM bytecode manipulation library.
    See Also:
    Serialized Form
    • Constructor Detail

      • ImplementationCreatorImpl

        public ImplementationCreatorImpl​(MetaDataManager mmgr)
        Constructor.
        Parameters:
        mmgr - MetaData manager
    • Method Detail

      • getClassLoader

        public java.lang.ClassLoader getClassLoader()
        Accessor for the ClassLoader.
        Specified by:
        getClassLoader in interface ImplementationCreator
        Returns:
        The ClassLoader
      • newInstance

        public java.lang.Object newInstance​(java.lang.Class cls,
                                            ClassLoaderResolver clr)
        Method to generate an instance of an interface, abstract class, or concrete PC class.
        Specified by:
        newInstance in interface ImplementationCreator
        Parameters:
        cls - The class of the interface, abstract class, or concrete class defined in MetaData
        clr - ClassLoader resolver
        Returns:
        The instance of this type
      • newInstance

        protected Persistable newInstance​(InterfaceMetaData imd,
                                          ClassLoaderResolver clr)
                                   throws java.lang.ClassNotFoundException,
                                          java.lang.InstantiationException,
                                          java.lang.IllegalAccessException,
                                          java.lang.reflect.InvocationTargetException,
                                          java.lang.NoSuchMethodException
        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 - If an error occurs
        java.lang.InstantiationException - If an error occurs
        java.lang.IllegalAccessException - If an error occurs
        java.lang.reflect.InvocationTargetException - If an error occurs
        java.lang.NoSuchMethodException - If an error occurs
      • newInstance

        protected Persistable newInstance​(ClassMetaData cmd,
                                          ClassLoaderResolver clr)
                                   throws java.lang.ClassNotFoundException,
                                          java.lang.InstantiationException,
                                          java.lang.IllegalAccessException,
                                          java.lang.NoSuchMethodException,
                                          java.lang.reflect.InvocationTargetException
        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 - if an error occurs
        java.lang.InstantiationException - if an error occurs
        java.lang.IllegalAccessException - if an error occurs
        java.lang.reflect.InvocationTargetException - If an error occurs
        java.lang.NoSuchMethodException - If an error occurs
      • getGenerator

        protected ImplementationGenerator getGenerator​(AbstractClassMetaData acmd,
                                                       java.lang.String implClassName)
        Method to return the generator for the implementation.
        Parameters:
        acmd - MetaData for the interface or abstract class
        implClassName - Name of the implementation class to create
        Returns:
        The implementation generator