|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.sun.enterprise.module.single.ProxyModule
public class ProxyModule
Creates a Module implementation based on a single class loader
| Constructor Summary | |
|---|---|
ProxyModule(ModulesRegistry registry,
ModuleDefinition moduleDef,
java.lang.ClassLoader cl)
|
|
| Method Summary | ||
|---|---|---|
void |
addImport(Module module)
|
|
Module |
addImport(ModuleDependency dependency)
Create and add a new module to this module's list of imports. |
|
void |
addListener(ModuleChangeListener listener)
Add a new module change listener |
|
void |
detach()
Detach this module from its registry. |
|
void |
dumpState(java.io.PrintStream writer)
|
|
java.lang.ClassLoader |
getClassLoader()
Return the ClassLoader instance associated with this module. |
|
java.util.List<Module> |
getImports()
Returns the list of imported modules. |
|
ModuleMetadata |
getMetadata()
Gets the metadata of this module. |
|
ModuleDefinition |
getModuleDefinition()
Returns the module definition for this module instance |
|
java.lang.String |
getName()
Short-cut for getModuleDefinition().getName(). |
|
|
getProvidersClass(java.lang.Class<T> serviceClass)
|
|
java.lang.Iterable<java.lang.Class> |
getProvidersClass(java.lang.String name)
|
|
ModulesRegistry |
getRegistry()
Returns the registry owning this module |
|
ModuleState |
getState()
Returns the module's state |
|
boolean |
hasProvider(java.lang.Class serviceClass)
Returns true if this module has any provider for the given service class. |
|
boolean |
isShared()
Returns true if this module is sharable. |
|
boolean |
isSticky()
Returns true if the module is sticky. |
|
void |
refresh()
Trigger manual refresh mechanism, the module will check all its URLs and generate change events if any of them has changed. |
|
void |
removeListener(ModuleChangeListener listener)
Unregister a module change listener |
|
void |
resolve()
Ensure that this module is resolved. |
|
void |
setSticky(boolean sticky)
Sets the sticky flag. |
|
void |
start()
Forces module startup. |
|
boolean |
stop()
Forces module stop. |
|
void |
uninstall()
Removes the module from the registry backing store, the module will need be reinstalled to be loaded. |
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public ProxyModule(ModulesRegistry registry,
ModuleDefinition moduleDef,
java.lang.ClassLoader cl)
| Method Detail |
|---|
public ModuleDefinition getModuleDefinition()
Module
getModuleDefinition in interface Modulepublic java.lang.String getName()
ModulegetModuleDefinition().getName().
getName in interface Modulepublic ModulesRegistry getRegistry()
Module
getRegistry in interface Modulepublic ModuleState getState()
Module
getState in interface Module
public void resolve()
throws ResolveError
Moduleresolved.
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 ModuleResolveError - if any of the declared dependency of this module
cannot be satisfied
public void start()
throws ResolveError
ModuleModuleState.READY, the
Lifecycle.start method will be invoked.
start in interface ModuleResolveErrorpublic boolean stop()
ModuleLifecyclePolicy 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 Modulepublic void detach()
Module
detach in interface Modulepublic void refresh()
Module
refresh in interface Modulepublic ModuleMetadata getMetadata()
Module
getMetadata in interface Modulepublic void addListener(ModuleChangeListener listener)
Module
addListener in interface Modulelistener - the listenerpublic void removeListener(ModuleChangeListener listener)
Module
removeListener in interface Modulelistener - the listener to unregisterpublic java.lang.ClassLoader getClassLoader()
ModuleClassLoader instance associated with this module.
Only designated public interfaces will be loaded and returned by
this classloader
getClassLoader in interface ModuleClassLoaderpublic java.util.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 Modulepublic void addImport(Module module)
addImport in interface Modulepublic Module addImport(ModuleDependency dependency)
Module
addImport in interface Moduledependency - new module's definitionpublic boolean isShared()
Module
isShared in interface Modulepublic boolean isSticky()
Module
isSticky in interface Modulepublic void setSticky(boolean sticky)
Module
setSticky in interface Modulesticky - true if the module should stick aroundpublic <T> java.lang.Iterable<java.lang.Class<? extends T>> getProvidersClass(java.lang.Class<T> serviceClass)
getProvidersClass in interface Modulepublic java.lang.Iterable<java.lang.Class> getProvidersClass(java.lang.String name)
getProvidersClass in interface Modulepublic boolean hasProvider(java.lang.Class serviceClass)
Module
hasProvider in interface Modulepublic void dumpState(java.io.PrintStream writer)
dumpState in interface Modulepublic void uninstall()
Module
uninstall in interface Module
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||