|
||||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.argouml.application.modules.ModuleLoader
Handles loading of modules and plugins for ArgoUML.
Nested Class Summary | |
---|---|
(package private) class |
ModuleLoader.JarFileFilter
|
Field Summary | |
---|---|
private java.util.Vector |
_menuActionList
|
private java.util.ArrayList |
_moduleClasses
|
private static java.util.Hashtable |
_singletons
|
private static java.lang.String |
argoHome
|
private static java.lang.String |
argoRoot
|
private static Logger |
cat
logger |
static java.lang.String |
CLASS_SUFFIX
Class file suffix |
private static ModuleLoader |
SINGLETON
|
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(java.util.Vector popUpActions,
java.lang.Object context)
Process all of the modules to add popup actions for the given context. |
private boolean |
classImplements(java.lang.Object implementor,
java.lang.Class implemented)
|
private void |
fireEvent(int eventType,
ArgoModule module)
|
java.lang.String |
getArgoHome()
Returns argo home |
java.lang.String |
getArgoRoot()
Returns argo root |
static ArgoModule |
getCurrentSingleton(java.lang.Class moduleClass)
Gets the current singleton of the module type requested. |
static ModuleLoader |
getInstance()
Get the singleton instance |
java.lang.Object |
getModule(java.lang.String key)
Locates a module by key. |
java.util.ArrayList |
getModules()
Get the list of modules |
Pluggable |
getPlugin(java.lang.Class pluginType,
java.lang.Object[] context)
Returns a plug-in of a given type. |
java.util.ArrayList |
getPlugins(java.lang.Class pluginType,
java.lang.Object[] context)
Returns all plug-in of a given type. |
boolean |
hasPlugin(java.lang.Class pluginType,
java.lang.Object[] context)
Indicates whether a requested plug-in is available. |
void |
initialize()
Load the internal modules. |
private boolean |
keyAlreadyLoaded(java.lang.String key)
|
private void |
loadClassFromLoader(java.lang.ClassLoader classloader,
java.lang.String key,
java.lang.String classname,
boolean secure)
|
boolean |
loadInternalModules(java.lang.Class loaderClass,
java.lang.String rsrcName)
Load modules listed in Argo resources. |
boolean |
loadModules(java.io.InputStream is,
java.lang.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(java.lang.String moduleFile)
Load modules from a property file. |
void |
loadModulesFromJar(java.lang.String filename)
Load modules from a jar file |
private void |
loadModulesFromNamedDirectory(java.lang.String dirname)
|
void |
loadModulesFromPredefinedLists()
Search for and load modules from predefined places. |
private void |
processJarFile(java.lang.ClassLoader classloader,
java.io.File file)
Check the manifest of a jar file for an argo extension. |
static boolean |
requestNewSingleton(java.lang.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 Logger cat
public static final java.lang.String CLASS_SUFFIX
private static ModuleLoader SINGLETON
private java.util.ArrayList _moduleClasses
private java.util.Vector _menuActionList
private static java.util.Hashtable _singletons
private static java.lang.String argoRoot
private static java.lang.String argoHome
Constructor Detail |
private ModuleLoader()
Method Detail |
public static ModuleLoader getInstance()
public void initialize()
public void loadModulesFromPredefinedLists()
private void processJarFile(java.lang.ClassLoader classloader, java.io.File file)
public void loadModulesFromExtensionDir()
private void loadModulesFromNamedDirectory(java.lang.String dirname)
public void loadModulesFromJar(java.lang.String filename)
filename
- jar file name to load frompublic void loadModulesFromClassPathJars()
public boolean loadInternalModules(java.lang.Class loaderClass, java.lang.String rsrcName)
loaderClass
- class to retrieve classloader fromrsrcName
- resource name to load
public boolean loadModulesFromFile(java.lang.String moduleFile)
moduleFile
- name of file
private boolean keyAlreadyLoaded(java.lang.String key)
private void loadClassFromLoader(java.lang.ClassLoader classloader, java.lang.String key, java.lang.String classname, boolean secure)
public boolean loadModules(java.io.InputStream is, java.lang.String filename)
is
- input stream in property file formatfilename
- the input stream is from (for reporting purposes)
public void shutdown()
public void addModuleAction(java.util.Vector popUpActions, java.lang.Object context)
popUpActions
- vector of actionscontext
- to filter bypublic java.util.ArrayList getModules()
public java.lang.Object getModule(java.lang.String key)
key
- module identifier to find
public boolean activateModule(ArgoModule module)
module
- to activate
public static ArgoModule getCurrentSingleton(java.lang.Class moduleClass)
moduleClass
- the class of the module singleton
public static boolean requestNewSingleton(java.lang.Class modClass, ArgoSingletonModule moduleInstance)
modClass
- class which identifies the singletonmoduleInstance
- the module to make the singleton
public Pluggable getPlugin(java.lang.Class pluginType, java.lang.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(java.lang.Class pluginType, java.lang.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 java.util.ArrayList getPlugins(java.lang.Class pluginType, java.lang.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 java.lang.String getArgoHome()
public java.lang.String getArgoRoot()
private boolean classImplements(java.lang.Object implementor, java.lang.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 (20040306) | ArgoUML Homepage | ArgoUML Developers' page | ArgoUML Cookbook |