Class SimpleClassLoadingStrategy

  • All Implemented Interfaces:
    ClassLoadingStrategy

    public class SimpleClassLoadingStrategy
    extends java.lang.Object
    implements ClassLoadingStrategy
    As the name says... a simple strategy implementation providing a bridge between the ClassLoadingStrategy approach and the usage of a plain ClassLoader, for loading Java classes.

    REMARK: It does not support loading actor-oriented classes!

    Since:
    Ptolemy II 11.0
    Version:
    $Id$
    Author:
    ErwinDL
    Pt.AcceptedRating:
    Yellow (ErwinDL)
    Pt.ProposedRating:
    Yellow (ErwinDL)
    • Constructor Detail

      • SimpleClassLoadingStrategy

        public SimpleClassLoadingStrategy()
        Construct a strategy that uses the default class loader, i.e. the one with which this own class was loaded.
      • SimpleClassLoadingStrategy

        public SimpleClassLoadingStrategy​(java.lang.ClassLoader classLoader)
        Construct a strategy that uses the given class loader.
        Parameters:
        classLoader - The class loader
    • Method Detail

      • loadJavaClass

        public java.lang.Class loadJavaClass​(java.lang.String className,
                                             VersionSpecification versionSpec)
                                      throws java.lang.ClassNotFoundException
        Load a Java class.
        Specified by:
        loadJavaClass in interface ClassLoadingStrategy
        Parameters:
        className - The namee of the class.
        versionSpec - The version
        Returns:
        the Class for the given name.
        Throws:
        java.lang.ClassNotFoundException - If the class is not found.
      • loadActorOrientedClass

        public CompositeEntity loadActorOrientedClass​(java.lang.String className,
                                                      VersionSpecification versionSpec)
                                               throws java.lang.ClassNotFoundException
        Load an actor-oriented class, which is typically a .moml file.
        Specified by:
        loadActorOrientedClass in interface ClassLoadingStrategy
        Parameters:
        className - The namee of the class.
        versionSpec - The version
        Returns:
        the Class for the given name.
        Throws:
        java.lang.ClassNotFoundException - Always thrown in this base class.