| Modifier and Type | Field and Description |
|---|---|
| pack-priv final ClassLoader | |
| pack-priv final ModuleDefinition | |
| pack-priv final ModulesRegistry |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public void | |
| public HK2Module | addImport(ModuleDependency dependency)
Implements com. Create and add a new module to this module's list of imports. |
| public void | addListener(ModuleChangeListener listener)
Implements com. Add a new module change listener |
| public void | detach()
Implements com. Detach this module from its registry. |
| public void | |
| public ClassLoader | getClassLoader()
Implements com. Return the |
| public List | getImports()
Implements com. Returns the list of imported modules. |
| public ModuleMetadata | getMetadata()
Implements com. Gets the metadata of this module. |
| public ModuleDefinition | getModuleDefinition()
Implements com. Returns the module definition for this module instance |
| public String | getName()
Implements com. Short-cut for |
| public <T> Iterable | getProvidersClass(Class<T> serviceClass)
Implements com.
|
| public Iterable | |
| public ModulesRegistry | getRegistry()
Implements com. Returns the registry owning this module |
| public ModuleState | |
| public boolean | hasProvider(Class<T> serviceClass)
Implements com. Returns true if this module has any provider for the given service class. |
| public boolean | isShared()
Implements com. Returns true if this module is sharable. |
| public boolean | isSticky()
Implements com. Returns true if the module is sticky. |
| public void | refresh()
Implements com. Trigger manual refresh mechanism, the module will check all its URLs and generate change events if any of them has changed. |
| public void | removeListener(ModuleChangeListener listener)
Implements com. Unregister a module change listener |
| public void | resolve()
Implements com. Ensure that this module is |
| public void | setSticky(boolean sticky)
Implements com. Sets the sticky flag. |
| public void | |
| public boolean | |
| public void | uninstall()
Implements com. Removes the module from the registry backing store, the module will need be reinstalled to be loaded. |
| classLoader | back to summary |
|---|---|
| pack-priv final ClassLoader classLoader | |
| moduleDef | back to summary |
|---|---|
| pack-priv final ModuleDefinition moduleDef | |
| modulesRegistry | back to summary |
|---|---|
| pack-priv final ModulesRegistry modulesRegistry | |
| ProxyModule | back to summary |
|---|---|
| public ProxyModule(ModulesRegistry registry, ModuleDefinition moduleDef, ClassLoader cl) | |
| addImport | back to summary |
|---|---|
| public void addImport(HK2Module module) Implements com. | |
| addImport | back to summary |
|---|---|
| public HK2Module addImport(ModuleDependency dependency) Implements com. Doc from com. Create and add a new module to this module's list of imports. | |
| addListener | back to summary |
|---|---|
| public void addListener(ModuleChangeListener listener) Implements com. Doc from com. Add a new module change listener | |
| detach | back to summary |
|---|---|
| public void detach() Implements com. Doc from com. Detach this module from its registry. This does not free any of the loaded resources. Only proper release of all references to the public class loader will ensure module being garbage collected. Detached modules are orphan and will be garbage collected if resources are properly disposed. | |
| dumpState | back to summary |
|---|---|
| public void dumpState(PrintStream writer) Implements com. | |
| getClassLoader | back to summary |
|---|---|
| public ClassLoader getClassLoader() Implements com. Doc from com. Return the | |
| getImports | back to summary |
|---|---|
| public List Implements com. Doc from com. Returns the list of imported modules.
This is the module version of
To enforce the stable class visibility, once | |
| getMetadata | back to summary |
|---|---|
| public ModuleMetadata getMetadata() Implements com. Doc from com. Gets the metadata of this module. | |
| getModuleDefinition | back to summary |
|---|---|
| public ModuleDefinition getModuleDefinition() Implements com. Doc from com. Returns the module definition for this module instance | |
| getName | back to summary |
|---|---|
| public String getName() Implements com. Doc from com. Short-cut for | |
| getProvidersClass | back to summary |
|---|---|
| public <T> Iterable Implements com. | |
| getProvidersClass | back to summary |
|---|---|
| public Iterable Implements com. | |
| getRegistry | back to summary |
|---|---|
| public ModulesRegistry getRegistry() Implements com. Doc from com. Returns the registry owning this module | |
| getState | back to summary |
|---|---|
| public ModuleState getState() Implements com. Doc from com. Returns the module's state | |
| hasProvider | back to summary |
|---|---|
| public boolean hasProvider(Class<T> serviceClass) Implements com. Doc from com. Returns true if this module has any provider for the given service class. | |
| isShared | back to summary |
|---|---|
| public boolean isShared() Implements com. Doc from com. Returns true if this module is sharable. A sharable module means that onlu one instance of the module classloader will be used by all users. | |
| isSticky | back to summary |
|---|---|
| public boolean isSticky() Implements com. Doc from com. Returns true if the module is sticky. A sticky module cannot be stopped or unloaded. Once a sticky module is loaded or started, it will stay in the JVM until it exists. | |
| refresh | back to summary |
|---|---|
| public void refresh() Implements com. Doc from com. Trigger manual refresh mechanism, the module will check all its URLs and generate change events if any of them has changed. This will allow the owning registry to force a module upgrade at next module request. | |
| removeListener | back to summary |
|---|---|
| public void removeListener(ModuleChangeListener listener) Implements com. Doc from com. Unregister a module change listener | |
| resolve | back to summary |
|---|---|
| public void resolve() throws ResolveError Implements com. Doc from com. Ensure that this module is
If the module is already resolved, this method does nothing.
Otherwise, iterate over all declared ModuleDependency instances and use the
associated
| |
| setSticky | back to summary |
|---|---|
| public void setSticky(boolean sticky) Implements com. Doc from com. Sets the sticky flag. | |
| start | back to summary |
|---|---|
| public void start() throws ResolveError Implements com. Doc from com. Forces module startup. In most cases, the runtime will take care
of starting modules when they are first used. There could be cases where
code need to manually start a sub module. Invoking this method will
move the module to the | |
| stop | back to summary |
|---|---|
| public boolean stop() Implements com. Doc from com. Forces module stop. In most cases, the runtime will take care of stopping
modules when the last module user released its interest. However, in
certain cases, it may be interesting to manually stop the module.
Stopping the module means that the module is removed from the registry,
the class loader references are released (note : the class loaders will
only be released if all instances of any class loaded by them are gc'ed).
If a | |
| uninstall | back to summary |
|---|---|
| public void uninstall() Implements com. Doc from com. Removes the module from the registry backing store, the module will need be reinstalled to be loaded. | |