Package ptolemy.actor.injection
Class PtolemyModule
- java.lang.Object
-
- ptolemy.actor.injection.PtolemyModule
-
public class PtolemyModule extends java.lang.Object
PtolemyModule loads interface to implementation mappings from the provided ResourceBundle. The PtolemyModule is used for creating a PtolemyInjector that is responsible for dependency injection. The rationale for this class is to promote portability of the Ptolemy by providing different interface to implementation mappings for different platforms such as Android and Java SE.- Since:
- Ptolemy II 10.0
- Version:
- $Id$
- Author:
- Anar Huseynov, Erwini de Ley
- Pt.AcceptedRating:
- Red (ahuseyno)
- Pt.ProposedRating:
- Red (ahuseyno)
-
-
Constructor Summary
Constructors Constructor Description PtolemyModule(java.lang.ClassLoader classLoader, java.util.ResourceBundle moduleBundle)
Create a new instance of the PtolemyModule based on the provided moduleBundle, and specifying a specific class loader that should be used to load the implementation classes.PtolemyModule(java.util.ResourceBundle moduleBundle)
Create a new instance of the PtolemyModule based on the provided moduleBundle.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.HashMap<java.lang.String,java.lang.String>
getBindings()
Return the bindings from interfaces to their implementations.java.lang.ClassLoader
getClassLoader()
Return the (optional) specific class loader for the implementation classes.
-
-
-
Constructor Detail
-
PtolemyModule
public PtolemyModule(java.lang.ClassLoader classLoader, java.util.ResourceBundle moduleBundle)
Create a new instance of the PtolemyModule based on the provided moduleBundle, and specifying a specific class loader that should be used to load the implementation classes.- Parameters:
classLoader
- The ClassLoadermoduleBundle
- The moduleBundle contains mappings from platform independent interfaces to platform dependent implementations. The bundle must have key value mappings from the fully specified interface name to the fully specified class name.
-
PtolemyModule
public PtolemyModule(java.util.ResourceBundle moduleBundle)
Create a new instance of the PtolemyModule based on the provided moduleBundle.- Parameters:
moduleBundle
- The moduleBundle contains mappings from platform independent interfaces to platform dependent implementations. The bundle must have key value mappings from the fully specified interface name to the fully specified class name.
-
-
Method Detail
-
getBindings
public java.util.HashMap<java.lang.String,java.lang.String> getBindings()
Return the bindings from interfaces to their implementations.- Returns:
- the interface to implementations mappings.
-
getClassLoader
public java.lang.ClassLoader getClassLoader()
Return the (optional) specific class loader for the implementation classes.- Returns:
- the (optional) specific class loader for the implementation classes.
-
-