|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectorg.argouml.application.modules.ModuleLoader
Handles loading of modules and plugins for ArgoUML.
| Nested Class Summary | |
(package private) class |
ModuleLoader.JarFileFilter
|
| Field Summary | |
private static String |
argoHome
|
private static String |
argoRoot
|
static String |
CLASS_SUFFIX
Class file suffix |
private static Logger |
LOG
Logger for this class. |
private Vector |
menuActionList
|
private ArrayList |
moduleClasses
|
private static ModuleLoader |
singleton
|
private static Hashtable |
singletons
|
| Constructor Summary | |
private |
ModuleLoader()
Make sure the module loader cannot be instantiated from outside. |
| Method Summary | |
boolean |
activateModule(ArgoModule module)
Activate a loaded module. |
void |
addModuleAction(Vector popUpActions,
Object context)
Process all of the modules to add popup actions for the given context. |
private boolean |
classImplements(Object implementor,
Class implemented)
|
private void |
fireEvent(int eventType,
ArgoModule module)
|
String |
getArgoHome()
Returns argo home. |
String |
getArgoRoot()
Returns argo root. |
static ArgoModule |
getCurrentSingleton(Class moduleClass)
Gets the current singleton of the module type requested. |
static ModuleLoader |
getInstance()
Get the singleton instance. |
Object |
getModule(String key)
Locates a module by key. |
ArrayList |
getModules()
Get the list of modules. |
Pluggable |
getPlugin(Class pluginType,
Object[] context)
Returns a plug-in of a given type. |
ArrayList |
getPlugins(Class pluginType,
Object[] context)
Returns all plug-in of a given type. |
boolean |
hasPlugin(Class pluginType,
Object[] context)
Indicates whether a requested plug-in is available. |
void |
initialize()
Load the internal modules. |
private boolean |
keyAlreadyLoaded(String key)
|
private void |
loadClassFromLoader(ClassLoader classloader,
String key,
String classname,
boolean secure)
|
boolean |
loadInternalModules(Class loaderClass,
String rsrcName)
Load modules listed in Argo resources. |
boolean |
loadModules(InputStream is,
String filename)
Load modules from an input stream. |
void |
loadModulesFromClassPathJars()
Load modules from jars in the class path |
void |
loadModulesFromExtensionDir()
Search for and load modules from classpath, and from other places. |
boolean |
loadModulesFromFile(String moduleFile)
Load modules from a property file. |
void |
loadModulesFromJar(String filename)
Load modules from a jar file. |
private void |
loadModulesFromNamedDirectory(String dirname)
|
void |
loadModulesFromPredefinedLists()
Search for and load modules from predefined places. |
private void |
processJarFile(ClassLoader classloader,
File file)
Check the manifest of a jar file for an argo extension. |
static boolean |
requestNewSingleton(Class modClass,
ArgoSingletonModule moduleInstance)
Requests the passed singleton to become the current singleton of the module type requested. |
void |
shutdown()
Shut down all modules. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
private static final Logger LOG
public static final String CLASS_SUFFIX
private static ModuleLoader singleton
private ArrayList moduleClasses
private Vector menuActionList
private static Hashtable singletons
private static String argoRoot
private static String argoHome
| Constructor Detail |
private ModuleLoader()
| Method Detail |
public static ModuleLoader getInstance()
public void initialize()
public void loadModulesFromPredefinedLists()
private void processJarFile(ClassLoader classloader,
File file)
public void loadModulesFromExtensionDir()
private void loadModulesFromNamedDirectory(String dirname)
public void loadModulesFromJar(String filename)
filename - jar file name to load frompublic void loadModulesFromClassPathJars()
public boolean loadInternalModules(Class loaderClass,
String rsrcName)
loaderClass - class to retrieve classloader fromrsrcName - resource name to load
public boolean loadModulesFromFile(String moduleFile)
moduleFile - name of file
private boolean keyAlreadyLoaded(String key)
private void loadClassFromLoader(ClassLoader classloader,
String key,
String classname,
boolean secure)
public boolean loadModules(InputStream is,
String filename)
is - input stream in property file formatfilename - the input stream is from (for reporting purposes)
public void shutdown()
public void addModuleAction(Vector popUpActions,
Object context)
popUpActions - vector of actionscontext - to filter bypublic ArrayList getModules()
public Object getModule(String key)
key - module identifier to find
public boolean activateModule(ArgoModule module)
module - to activate
public static ArgoModule getCurrentSingleton(Class moduleClass)
moduleClass - the class of the module singleton
public static boolean requestNewSingleton(Class modClass,
ArgoSingletonModule moduleInstance)
modClass - class which identifies the singletonmoduleInstance - the module to make the singleton
public Pluggable getPlugin(Class pluginType,
Object[] context)
pluginType - a Class which extends Pluggable and indicates
the type of plug-in to return.context - Additional information used to choose between
plugins.
public boolean hasPlugin(Class pluginType,
Object[] context)
pluginType - a Class which extends Pluggable and indicates
the type of plug-in to return.context - Additional information used to choose between
plugins.
public ArrayList getPlugins(Class pluginType,
Object[] context)
pluginType - a Class which extends Pluggable and indicates
the type of plug-in to return.context - An object (or null) which allows the plugin to
determine if it should be included in a list.
public String getArgoHome()
public String getArgoRoot()
private boolean classImplements(Object implementor,
Class implemented)
private void fireEvent(int eventType,
ArgoModule module)
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
| ArgoUML © 1996-2004 (20050222) | ArgoUML Homepage | ArgoUML Developers' page | ArgoUML Cookbook |