org.netbeans.core.startup/1 1.40

org.netbeans.core.startup
Class ModuleSystem

java.lang.Object
  extended by org.netbeans.core.startup.ModuleSystem

public final class ModuleSystem
extends Object

Controller of the IDE's whole module system. Contains higher-level convenience methods to access the basic functionality and procedural stages of the module system. Main should hold a reference to one instance. Methods are thread-safe.


Constructor Summary
ModuleSystem(FileSystem systemFileSystem)
          Initialize module system.
 
Method Summary
 String getEffectiveClasspath(Module m)
          Get the effective "classpath" used by a module.
 Events getEvents()
          Get the event-logging handler.
 ModuleManager getManager()
          Get the raw module manager.
 List<File> getModuleJars()
          Produce a list of JAR files including all installed modules, their extensions, and enabled locale variants of both.
 boolean isShowInAutoUpdateClient(ModuleInfo mi)
          Checks whether the provided module will be visible in autoupdate client.
 void loadBootModules()
          Load modules found in the classpath.
 void readList()
          Read disk settings and determine what the known modules are.
 void refresh()
          Refreshes the list of modules.
 void restore()
          Install read modules.
 boolean shutDown(Runnable midHook)
          Shut down the system: ask modules to shut down.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ModuleSystem

public ModuleSystem(FileSystem systemFileSystem)
             throws IOException
Initialize module system. The system file system is needed as that holds the Modules/ folder. Note if the systemFileSystem is read-only, no module list will be created, so it is forbidden to call readList, scanForNewAndRestore, or installNew.

Throws:
IOException
Method Detail

getManager

public ModuleManager getManager()
Get the raw module manager. Useful for pieces of the UI needing to directly affect the set of installed modules. For example, the Modules node in the Options window may use this.


getEvents

public Events getEvents()
Get the event-logging handler.


getModuleJars

public List<File> getModuleJars()
Produce a list of JAR files including all installed modules, their extensions, and enabled locale variants of both. Will be returned in a classpath-like order. Intended for use by the execution engine (though sort of deprecated).

Returns:
list of module-related JARs/ZIPs

loadBootModules

public void loadBootModules()
Load modules found in the classpath. Note that they might not satisfy all their dependencies, in which case oh well...


refresh

public final void refresh()
Refreshes the list of modules. Used from autoupdate.services.

Since:
1.28

readList

public void readList()
Read disk settings and determine what the known modules are.


restore

public void restore()
Install read modules.


shutDown

public boolean shutDown(Runnable midHook)
Shut down the system: ask modules to shut down. Some of them may refuse.


getEffectiveClasspath

public String getEffectiveClasspath(Module m)
Get the effective "classpath" used by a module.

This is a somewhat stretched notion, but should give something that looks as much like a classpath as possible, i.e. a list of directories or JARs separated by the standard separator, which roughly represents what resources are visible to the module's classloader. May use special syntax to represent situations in which only certain packages are available from a particular "classpath" entry.

Disabled modules have no classpath (empty string).

Call within a mutex.

Parameters:
m - the module to build a classpath for
Returns:
an approximation of that module's classpath
Since:
org.netbeans.core/1 > 1.5
See Also:
"#22466"

isShowInAutoUpdateClient

public boolean isShowInAutoUpdateClient(ModuleInfo mi)
Checks whether the provided module will be visible in autoupdate client. Seeks for AutoUpdate-Show-In-Client attribute in manifest. The module is visible if the attribute is missing or if it is set to true. Uses caches to remember the value between restarts.

Parameters:
mi - the module to test
Returns:
true if the module is supposed to be visible in autoupdate client
Since:
1.38

org.netbeans.core.startup/1 1.40

Built on May 22 2012.  |  Portions Copyright 1997-2012 Oracle. All rights reserved.