Package org.jboss.modules
Class ModuleLoader.MXBeanImpl
- java.lang.Object
-
- org.jboss.modules.ModuleLoader.MXBeanImpl
-
- All Implemented Interfaces:
ModuleLoaderMXBean
- Enclosing class:
- ModuleLoader
static final class ModuleLoader.MXBeanImpl extends java.lang.Object implements ModuleLoaderMXBean
-
-
Field Summary
Fields Modifier and Type Field Description private Reference<ModuleLoader,javax.management.ObjectName>
reference
-
Constructor Summary
Constructors Constructor Description MXBeanImpl(ModuleLoader moduleLoader, javax.management.ObjectName objectName)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private void
doDumpModuleInformation(java.lang.String name, java.lang.StringBuilder b)
private java.util.List<DependencyInfo>
doGetDependencies(Module module)
private java.util.List<ResourceLoaderInfo>
doGetResourceLoaders(Module module)
java.lang.String
dumpAllModuleInformation()
Dump all information for all modules as a string.java.lang.String
dumpModuleInformation(java.lang.String name)
Dump all information for a single module as a string.int
getClassCount()
Get the number of classes defined in this module loader.long
getClassDefineTime()
Get the estimated CPU time (in nanoseconds) spent defining classes for this loader.java.util.List<DependencyInfo>
getDependencies(java.lang.String name)
Get the dependencies of the named module.java.lang.String
getDescription()
Get a description of this module loader.long
getLinkTime()
Get the estimated CPU time (in nanoseconds) spent linking in the life of this module loader.int
getLoadedModuleCount()
Get the number of modules currently loaded.long
getLoadTime()
Get the estimated CPU time (in nanoseconds) spent loading modules into this loader.ModuleInfo
getModuleDescription(java.lang.String name)
Get the complete description of this module.private ModuleLoader
getModuleLoader()
java.util.SortedMap<java.lang.String,java.util.List<java.lang.String>>
getModulePathsInfo(java.lang.String name, boolean exports)
Get a paths map for a given module.int
getRaceCount()
Get the number of times a class was defined by two threads at once.java.util.List<ResourceLoaderInfo>
getResourceLoaders(java.lang.String name)
Get the resource loaders of the named module.int
getScanCount()
Get the number of times that dependencies of a module from this loader have been scanned.private Module
loadModule(java.lang.String name, ModuleLoader loader)
java.util.List<java.lang.String>
queryLoadedModuleNames()
Obtain a list of the current module names.void
refreshResourceLoaders(java.lang.String name)
Attempt to refresh the resource loaders of the given module.void
relink(java.lang.String name)
Attempt to relink the given module.boolean
unloadModule(java.lang.String name)
Attempt to unload a module from this module loader.
-
-
-
Field Detail
-
reference
private final Reference<ModuleLoader,javax.management.ObjectName> reference
-
-
Constructor Detail
-
MXBeanImpl
MXBeanImpl(ModuleLoader moduleLoader, javax.management.ObjectName objectName)
-
-
Method Detail
-
getDescription
public java.lang.String getDescription()
Description copied from interface:ModuleLoaderMXBean
Get a description of this module loader.- Specified by:
getDescription
in interfaceModuleLoaderMXBean
- Returns:
- a description of this module loader
-
getLinkTime
public long getLinkTime()
Description copied from interface:ModuleLoaderMXBean
Get the estimated CPU time (in nanoseconds) spent linking in the life of this module loader.- Specified by:
getLinkTime
in interfaceModuleLoaderMXBean
- Returns:
- the estimated time in nanoseconds
-
getLoadTime
public long getLoadTime()
Description copied from interface:ModuleLoaderMXBean
Get the estimated CPU time (in nanoseconds) spent loading modules into this loader.- Specified by:
getLoadTime
in interfaceModuleLoaderMXBean
- Returns:
- the estimated time in nanoseconds
-
getClassDefineTime
public long getClassDefineTime()
Description copied from interface:ModuleLoaderMXBean
Get the estimated CPU time (in nanoseconds) spent defining classes for this loader.- Specified by:
getClassDefineTime
in interfaceModuleLoaderMXBean
- Returns:
- the estimated time in nanoseconds
-
getScanCount
public int getScanCount()
Description copied from interface:ModuleLoaderMXBean
Get the number of times that dependencies of a module from this loader have been scanned.- Specified by:
getScanCount
in interfaceModuleLoaderMXBean
- Returns:
- the count
-
getLoadedModuleCount
public int getLoadedModuleCount()
Description copied from interface:ModuleLoaderMXBean
Get the number of modules currently loaded.- Specified by:
getLoadedModuleCount
in interfaceModuleLoaderMXBean
- Returns:
- the loaded module count
-
getRaceCount
public int getRaceCount()
Description copied from interface:ModuleLoaderMXBean
Get the number of times a class was defined by two threads at once.- Specified by:
getRaceCount
in interfaceModuleLoaderMXBean
- Returns:
- the race count
-
getClassCount
public int getClassCount()
Description copied from interface:ModuleLoaderMXBean
Get the number of classes defined in this module loader.- Specified by:
getClassCount
in interfaceModuleLoaderMXBean
- Returns:
- the number of classes defined in this module loader
-
queryLoadedModuleNames
public java.util.List<java.lang.String> queryLoadedModuleNames()
Description copied from interface:ModuleLoaderMXBean
Obtain a list of the current module names.- Specified by:
queryLoadedModuleNames
in interfaceModuleLoaderMXBean
- Returns:
- the module names
-
dumpAllModuleInformation
public java.lang.String dumpAllModuleInformation()
Description copied from interface:ModuleLoaderMXBean
Dump all information for all modules as a string.- Specified by:
dumpAllModuleInformation
in interfaceModuleLoaderMXBean
- Returns:
- the string of module information
-
dumpModuleInformation
public java.lang.String dumpModuleInformation(java.lang.String name)
Description copied from interface:ModuleLoaderMXBean
Dump all information for a single module as a string.- Specified by:
dumpModuleInformation
in interfaceModuleLoaderMXBean
- Parameters:
name
- the module name- Returns:
- the string of module information
-
doDumpModuleInformation
private void doDumpModuleInformation(java.lang.String name, java.lang.StringBuilder b)
-
unloadModule
public boolean unloadModule(java.lang.String name)
Description copied from interface:ModuleLoaderMXBean
Attempt to unload a module from this module loader.- Specified by:
unloadModule
in interfaceModuleLoaderMXBean
- Parameters:
name
- the string form of the module identifier to unload- Returns:
true
if the module was unloaded
-
refreshResourceLoaders
public void refreshResourceLoaders(java.lang.String name)
Description copied from interface:ModuleLoaderMXBean
Attempt to refresh the resource loaders of the given module.- Specified by:
refreshResourceLoaders
in interfaceModuleLoaderMXBean
- Parameters:
name
- the name of the module to refresh
-
relink
public void relink(java.lang.String name)
Description copied from interface:ModuleLoaderMXBean
Attempt to relink the given module.- Specified by:
relink
in interfaceModuleLoaderMXBean
- Parameters:
name
- the name of the module to relink
-
getDependencies
public java.util.List<DependencyInfo> getDependencies(java.lang.String name)
Description copied from interface:ModuleLoaderMXBean
Get the dependencies of the named module.- Specified by:
getDependencies
in interfaceModuleLoaderMXBean
- Parameters:
name
- the module name- Returns:
- the module's dependencies
-
doGetDependencies
private java.util.List<DependencyInfo> doGetDependencies(Module module)
-
getResourceLoaders
public java.util.List<ResourceLoaderInfo> getResourceLoaders(java.lang.String name)
Description copied from interface:ModuleLoaderMXBean
Get the resource loaders of the named module.- Specified by:
getResourceLoaders
in interfaceModuleLoaderMXBean
- Parameters:
name
- the module name- Returns:
- the module's resource loaders
-
doGetResourceLoaders
private java.util.List<ResourceLoaderInfo> doGetResourceLoaders(Module module)
-
getModuleDescription
public ModuleInfo getModuleDescription(java.lang.String name)
Description copied from interface:ModuleLoaderMXBean
Get the complete description of this module.- Specified by:
getModuleDescription
in interfaceModuleLoaderMXBean
- Parameters:
name
- the module name- Returns:
- the module description
-
getModulePathsInfo
public java.util.SortedMap<java.lang.String,java.util.List<java.lang.String>> getModulePathsInfo(java.lang.String name, boolean exports)
Description copied from interface:ModuleLoaderMXBean
Get a paths map for a given module.- Specified by:
getModulePathsInfo
in interfaceModuleLoaderMXBean
- Parameters:
name
- the module nameexports
-true
for the exported paths,false
for all paths- Returns:
- the paths map information
-
loadModule
private Module loadModule(java.lang.String name, ModuleLoader loader)
-
getModuleLoader
private ModuleLoader getModuleLoader()
-
-