|
org.netbeans.bootstrap/1 2.52 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.openide.modules.Modules
org.netbeans.ModuleManager
public final class ModuleManager
Manages a collection of modules.
Must use mutex() to access its important methods.
| Field Summary | |
|---|---|
static String |
PROP_CLASS_LOADER
|
static String |
PROP_ENABLED_MODULES
|
static String |
PROP_MODULES
|
| Constructor Summary | |
|---|---|
ModuleManager(ModuleInstaller installer,
Events ev)
Create a manager, initially with no managed modules. |
|
| Method Summary | |
|---|---|
void |
addPropertyChangeListener(PropertyChangeListener l)
Add a change listener. |
Module |
create(File jar,
Object history,
boolean reloadable,
boolean autoload)
Deprecated. since org.netbeans.core/1 1.3 |
Module |
create(File jar,
Object history,
boolean reloadable,
boolean autoload,
boolean eager)
Create a module from a JAR and add it to the managed set. |
Module |
createBundle(File jar,
Object history,
boolean reloadable,
boolean autoload,
boolean eager,
int startLevel)
Create a module from a JAR representing an OSGi bundle and adds it to the managed set. |
Module |
createFixed(Manifest mani,
Object history,
ClassLoader loader)
Create a fixed module (e.g. |
Module |
createFixed(Manifest mani,
Object history,
ClassLoader loader,
boolean autoload,
boolean eager)
Create a fixed module (e.g. |
void |
delete(Module m)
Remove a module from the managed set. |
void |
disable(Module m)
Disable a single module. |
void |
disable(Set<Module> modules)
Disable a set of modules together. |
void |
enable(Module m)
Enable a single module. |
void |
enable(Set<Module> modules)
Enable a set of modules together. |
Module |
get(String codeNameBase)
Convenience method to find a module by name. |
ClassLoader |
getClassLoader()
Get a classloader capable of loading from any of the enabled modules or their declared extensions. |
Set<Module> |
getEnabledModules()
Get a set of modules managed which are currently enabled. |
Events |
getEvents()
Access for ManifestSection. |
Set<Module> |
getModuleInterdependencies(Module m,
boolean reverse,
boolean transitive)
Deprecated. Use getModuleInterdependencies(Module, boolean, boolean, boolean) instead. |
Set<Module> |
getModuleInterdependencies(Module m,
boolean reverse,
boolean transitive,
boolean considerNeeds)
Get a set of modules depended upon or depending on this module. |
Lookup |
getModuleLookup()
Retrieve set of modules in Lookup form. |
Set<Module> |
getModules()
Get a set of Modules being managed. |
Mutex |
mutex()
Get a locking mutex for this module installer. |
Mutex.Privileged |
mutexPrivileged()
Classes in this package can, if careful, use the privileged form. |
ModuleInfo |
ownerOf(Class<?> clazz)
|
void |
refineClassLoader(Module m,
List parents)
Used by Module to communicate with the ModuleInstaller re. |
void |
releaseModuleManifests()
Release storage for all module manifests. |
void |
reload(Module m)
Reload a module. |
void |
removePropertyChangeListener(PropertyChangeListener l)
Remove a change listener. |
void |
replaceJaveleonModule(Module module,
Module newModule)
Only for use with Javeleon modules. |
boolean |
shouldDelegateResource(Module m,
Module parent,
String pkg)
Use by OneModuleClassLoader to communicate with the ModuleInstaller re. |
boolean |
shutDown()
Try to shut down the system. |
boolean |
shutDown(Runnable midHook)
Try to shut down the system. |
List<Module> |
simulateDisable(Set<Module> modules)
Simulate what would happen if a set of modules were to be disabled. |
List<Module> |
simulateEnable(Set<Module> modules)
Simulate what would happen if a set of modules were to be enabled. |
List<Module> |
simulateJaveleonReload(Module moduleToReload)
Only for use from Javeleon code. |
| Methods inherited from class org.openide.modules.Modules |
|---|
getDefault |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final String PROP_MODULES
public static final String PROP_ENABLED_MODULES
public static final String PROP_CLASS_LOADER
| Constructor Detail |
|---|
public ModuleManager(ModuleInstaller installer,
Events ev)
| Method Detail |
|---|
public final Events getEvents()
public final Mutex mutex()
public final Mutex.Privileged mutexPrivileged()
public void releaseModuleManifests()
Module.releaseManifest()public final void addPropertyChangeListener(PropertyChangeListener l)
public final void removePropertyChangeListener(PropertyChangeListener l)
public Lookup getModuleLookup()
public Set<Module> getModules()
Modules being managed.
No two contained modules may at any time share the same code name base.
PROP_MODULESpublic final Set<Module> getEnabledModules()
PROP_ENABLED_MODULESpublic final Module get(String codeNameBase)
public ModuleInfo ownerOf(Class<?> clazz)
ownerOf in class Modules
@Deprecated
public Set<Module> getModuleInterdependencies(Module m,
boolean reverse,
boolean transitive)
getModuleInterdependencies(Module, boolean, boolean, boolean) instead.
public Set<Module> getModuleInterdependencies(Module m,
boolean reverse,
boolean transitive,
boolean considerNeeds)
Note that provide-require/need dependencies are listed alongside direct dependencies; a module with a required token is considered to depend on all modules providing that token (though in fact only one is needed to enable it).
Illegal cyclic dependencies are omitted.
m - a module to start from; may be enabled or not, but must be owned by this managerreverse - if true, find modules depending on this module; if false, find
modules this module depends upontransitive - if true, these dependencies are considered transitively as wellconsiderNeeds - if true, dependencies of type Dependency.TYPE_NEEDS are considered
public ClassLoader getClassLoader()
Thread.getContextClassLoader().
Thread-safe.
PROP_CLASS_LOADER
public void replaceJaveleonModule(Module module,
Module newModule)
@Deprecated
public Module create(File jar,
Object history,
boolean reloadable,
boolean autoload)
throws IOException,
DuplicateException
IOException
DuplicateExceptioncreate(File,Object,boolean,boolean,boolean)
public Module create(File jar,
Object history,
boolean reloadable,
boolean autoload,
boolean eager)
throws IOException,
DuplicateException
Will initially be disabled.
To make sure all available eager modules get enabled, just call:
enable(org.netbeans.Module)(Collections.emptySet())
May throw an IOException if the JAR file cannot be opened for some reason, or is malformed.
If there is already a module of the same name managed, throws a duplicate exception. In this case you may wish to delete the original and try again.
You must give it some history object which can be used to provide context for where the module came from and whether it has been here before.
You cannot request that a module be both autoload and eager.
IOException
DuplicateException
public Module createBundle(File jar,
Object history,
boolean reloadable,
boolean autoload,
boolean eager,
int startLevel)
throws IOException,
DuplicateException
create(java.io.File, java.lang.Object, boolean, boolean, boolean)
just adds additional start level info.
startLevel - an OSGi start level. Zero indicates, no changes to default level.
InvalidException - if the JAR does not represent an OSGi bundle
IOException
DuplicateException
public Module createFixed(Manifest mani,
Object history,
ClassLoader loader)
throws InvalidException,
DuplicateException
InvalidException
DuplicateException
public Module createFixed(Manifest mani,
Object history,
ClassLoader loader,
boolean autoload,
boolean eager)
throws InvalidException,
DuplicateException
InvalidException
DuplicateException
public void refineClassLoader(Module m,
List parents)
public boolean shouldDelegateResource(Module m,
Module parent,
String pkg)
public void delete(Module m)
throws IllegalArgumentException
IllegalArgumentException
public void reload(Module m)
throws IllegalArgumentException,
IOException
IllegalArgumentException
IOException
public final void enable(Module m)
throws IllegalArgumentException,
InvalidException
IllegalArgumentException
InvalidExceptionenable(Set)
public final void disable(Module m)
throws IllegalArgumentException
IllegalArgumentExceptiondisable(Set)
public void enable(Set<Module> modules)
throws IllegalArgumentException,
InvalidException
Must have satisfied their dependencies (possibly with one another).
Must not contain autoload nor eager modules.
Might contain fixed modules (they can only be installed once of course).
Other modules may become enabled automatically according to simulateEnable(java.util.Set.
It is permissible to pass in modules which in fact at runtime cannot
satisfy their package dependencies, or which ModuleInstaller.prepare(org.netbeans.Module)
rejects on the basis of missing contents. In such a case InvalidException
will be thrown and nothing will be installed. The InvalidException in such
a case should contain a reference to the offending module.
IllegalArgumentException
InvalidException
public void disable(Set<Module> modules)
throws IllegalArgumentException
Must not be required by any enabled modules (except one another).
Must not contain autoload nor eager modules.
Must not contain fixed modules.
Other modules may become disabled automatically according to simulateDisable(java.util.Set.
IllegalArgumentException
public List<Module> simulateEnable(Set<Module> modules)
throws IllegalArgumentException
ModuleInstaller.prepare(org.netbeans.Module)
indicates that the modules are not in a valid format to install; or
creating the module classloader fails unexpectedly.
IllegalArgumentException
public List<Module> simulateJaveleonReload(Module moduleToReload)
throws IllegalArgumentException
IllegalArgumentException
public List<Module> simulateDisable(Set<Module> modules)
throws IllegalArgumentException
IllegalArgumentExceptionpublic boolean shutDown()
public boolean shutDown(Runnable midHook)
midHook - a hook to run before closing modules if they agree to close
|
org.netbeans.bootstrap/1 2.52 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||