Interface ClassLoadingStrategy

  • All Known Implementing Classes:
    OSGiClassLoadingStrategy, SimpleClassLoadingStrategy

    public interface ClassLoadingStrategy
    Strategy to be able to switch class loading mechanisms, depending on the needs for a runtime environment (especially for actors and other model entities),

    In a "plain" Java SE runtime, a default implementation would use simple Class.forName() (for Java classes) or local file-lookup (for actor-oriented classes) or similar.

    In an OSGi-based runtime, more advanced options can be implemented to allow dynamic actor class updates, version management etc.

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

      • loadJavaClass

        java.lang.Class loadJavaClass​(java.lang.String className,
                                      VersionSpecification versionSpec)
                               throws java.lang.ClassNotFoundException
        Load a Java class.
        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

        CompositeEntity loadActorOrientedClass​(java.lang.String className,
                                               VersionSpecification versionSpec)
                                        throws java.lang.ClassNotFoundException
        Load an actor-oriented class, which is typically a .moml file.
        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.