public class OSGiObrModuleImpl extends OSGiModuleImpl
Constructor and Description |
---|
OSGiObrModuleImpl(OSGiObrModulesRegistryImpl registry,
org.osgi.framework.Bundle bundle,
ModuleDefinition moduleDef) |
OSGiObrModuleImpl(OSGiObrModulesRegistryImpl registry,
File file) |
OSGiObrModuleImpl(OSGiObrModulesRegistryImpl registry,
ModuleDefinition moduleDef) |
Modifier and Type | Method and Description |
---|---|
void |
detach()
Detach this module from its registry.
|
void |
dumpState(PrintStream writer) |
ClassLoader |
getClassLoader()
Return the
ClassLoader instance associated with this module. |
List<Module> |
getImports()
Returns the list of imported modules.
|
OSGiObrModulesRegistryImpl |
getRegistry()
Returns the registry owning this module
|
ModuleState |
getState()
Returns the module's state
|
void |
refresh()
Trigger manual refresh mechanism, the module will check all its
URLs and generate change events if any of them has changed.
|
void |
resolve()
Ensure that this module is
resolved . |
void |
start()
Forces module startup.
|
boolean |
stop()
Forces module stop.
|
String |
toString() |
void |
uninstall()
Removes the module from the registry backing store, the module will need
be reinstalled to be loaded.
|
addImport, addImport, addListener, equals, getBundle, getMetadata, getModuleDefinition, getName, getProvidersClass, getProvidersClass, hashCode, hasProvider, isShared, isSticky, isTransientlyActive, removeListener, setBundle, setSticky
public OSGiObrModuleImpl(OSGiObrModulesRegistryImpl registry, File file) throws IOException
IOException
public OSGiObrModuleImpl(OSGiObrModulesRegistryImpl registry, ModuleDefinition moduleDef)
public OSGiObrModuleImpl(OSGiObrModulesRegistryImpl registry, org.osgi.framework.Bundle bundle, ModuleDefinition moduleDef)
public OSGiObrModulesRegistryImpl getRegistry()
Module
getRegistry
in interface Module
getRegistry
in class OSGiModuleImpl
public ModuleState getState()
Module
getState
in interface Module
getState
in class OSGiModuleImpl
public void resolve() throws ResolveError
Module
resolved
.
If the module is already resolved, this method does nothing.
Otherwise, iterate over all declared ModuleDependency instances and use the
associated ModuleRegistry
to resolve it. After successful
completion of this method, the module state is
ModuleState.RESOLVED
.
resolve
in interface Module
resolve
in class OSGiModuleImpl
ResolveError
- if any of the declared dependency of this module
cannot be satisfiedpublic void start() throws ResolveError
Module
ModuleState.READY
, the
Lifecycle.start
method will be invoked.start
in interface Module
start
in class OSGiModuleImpl
ResolveError
public boolean stop()
Module
LifecyclePolicy
for this module is defined, the
Lifecycle.stop(Module)
method will be called and finally the module state will be
returned to ModuleState.NEW
.stop
in interface Module
stop
in class OSGiModuleImpl
public void detach()
Module
detach
in interface Module
detach
in class OSGiModuleImpl
public void uninstall()
Module
uninstall
in interface Module
uninstall
in class OSGiModuleImpl
public void refresh()
Module
refresh
in interface Module
refresh
in class OSGiModuleImpl
public void dumpState(PrintStream writer)
dumpState
in interface Module
dumpState
in class OSGiModuleImpl
public ClassLoader getClassLoader()
Module
ClassLoader
instance associated with this module.
Only designated public interfaces will be loaded and returned by
this classloadergetClassLoader
in interface Module
getClassLoader
in class OSGiModuleImpl
ClassLoader
public List<Module> getImports()
Module
This is the module version of ModuleDefinition.getDependencies()
,
but after fully resolved.
To enforce the stable class visibility, once Module
is
created, dependencies cannot be changed — that is, we
don't want "a.b.C" to suddenly mean something different once
the code starts running.
getImports
in interface Module
getImports
in class OSGiModuleImpl
public String toString()
toString
in class OSGiModuleImpl
Copyright © 2009–2023 Oracle Corporation. All rights reserved.