| Modifier and Type | Method and Description |
|---|---|
| public void | |
| public HK2Module | addImport(ModuleDependency
new module's definition dependency)Create and add a new module to this module's list of imports. |
| public void | |
| public void | |
| public void | |
| public ClassLoader | Returns: the publicClassLoaderReturn the |
| public List | |
| public ModuleMetadata | |
| public ModuleDefinition | Returns: the module definitionReturns the module definition for this module instance |
| public String | |
| public <T> Iterable | |
| public Iterable | |
| public ModulesRegistry | |
| public ModuleState | |
| public boolean | hasProvider(Class<T> serviceClass)
Returns true if this module has any provider for the given service class. |
| public boolean | |
| public boolean | |
| public void | refresh()
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
the listener to unregister listener)Unregister a module change listener |
| public void | |
| public void | |
| public void | |
| public boolean | |
| public void | uninstall()
Removes the module from the registry backing store, the module will need be reinstalled to be loaded. |
| addImport | back to summary |
|---|---|
| public void addImport(HK2Module module) | |
| addImport | back to summary |
|---|---|
| public HK2Module addImport(ModuleDependency dependency) Create and add a new module to this module's list of imports.
| |
| addListener | back to summary |
|---|---|
| public void addListener(ModuleChangeListener listener) Add a new module change listener
| |
| detach | back to summary |
|---|---|
| public void detach() 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) | |
| getClassLoader | back to summary |
|---|---|
| public ClassLoader getClassLoader() Return the
| |
| getImports | back to summary |
|---|---|
| public List 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() Gets the metadata of this module. | |
| getModuleDefinition | back to summary |
|---|---|
| public ModuleDefinition getModuleDefinition() Returns the module definition for this module instance
| |
| getName | back to summary |
|---|---|
| public String getName() Short-cut for | |
| getProvidersClass | back to summary |
|---|---|
| public <T> Iterable | |
| getProvidersClass | back to summary |
|---|---|
| public Iterable | |
| getRegistry | back to summary |
|---|---|
| public ModulesRegistry getRegistry() Returns the registry owning this module
| |
| getState | back to summary |
|---|---|
| public ModuleState getState() Returns the module's state
| |
| hasProvider | back to summary |
|---|---|
| public boolean hasProvider(Class<T> serviceClass) Returns true if this module has any provider for the given service class. | |
| isShared | back to summary |
|---|---|
| public boolean isShared() 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() 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() 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) Unregister a module change listener
| |
| resolve | back to summary |
|---|---|
| public void resolve() throws ResolveError 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) Sets the sticky flag.
| |
| start | back to summary |
|---|---|
| public void start() throws ResolveError 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() 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() Removes the module from the registry backing store, the module will need be reinstalled to be loaded. | |