Package org.ptolemy.classloading
Class SimpleClassLoadingStrategy
- java.lang.Object
-
- org.ptolemy.classloading.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 theClassLoadingStrategy
approach and the usage of a plainClassLoader
, 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 Summary
Constructors Constructor Description SimpleClassLoadingStrategy()
Construct a strategy that uses the default class loader, i.e.SimpleClassLoadingStrategy(java.lang.ClassLoader classLoader)
Construct a strategy that uses the given class loader.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description CompositeEntity
loadActorOrientedClass(java.lang.String className, VersionSpecification versionSpec)
Load an actor-oriented class, which is typically a .moml file.java.lang.Class
loadJavaClass(java.lang.String className, VersionSpecification versionSpec)
Load a Java class.
-
-
-
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 interfaceClassLoadingStrategy
- 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 interfaceClassLoadingStrategy
- 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.
-
-