Class ServiceModuleLoader
java.lang.Object
org.jboss.modules.ModuleLoader
org.jboss.as.server.moduleservice.ServiceModuleLoader
- All Implemented Interfaces:
org.jboss.msc.Service,org.jboss.msc.service.Service<ServiceModuleLoader>,org.jboss.msc.value.Value<ServiceModuleLoader>
public class ServiceModuleLoader
extends org.jboss.modules.ModuleLoader
implements org.jboss.msc.service.Service<ServiceModuleLoader>
ModuleLoader that loads module definitions from msc services. Module specs are looked up in msc services that
correspond to the module names.
Modules are automatically removed when the corresponding service comes down.
- Author:
- Stuart Douglas, Richard Opalka
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Stringstatic final org.jboss.msc.service.ServiceNamestatic final org.jboss.msc.service.ServiceNamestatic final org.jboss.msc.service.ServiceNameFields inherited from class org.jboss.modules.ModuleLoader
NO_FINDERSFields inherited from interface org.jboss.msc.service.Service
NULL -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidaddService(org.jboss.msc.service.ServiceTarget serviceTarget, Bootstrap.Configuration configuration) protected org.jboss.modules.ModuleSpecfindModule(String identifier) getValue()static voidinstallModuleResolvedService(org.jboss.msc.service.ServiceTarget serviceTarget, String identifier) static booleanisDynamicModule(String identifier) Returns true if the module identifier is a dynamic module that will be loaded by this module loaderstatic org.jboss.msc.service.ServiceNamemoduleResolvedServiceName(String identifier) Returns the corresponding module resolved service name for the given module.static org.jboss.msc.service.ServiceNamemoduleServiceName(String identifier) Returns the corresponding ModuleLoadService service name for the given module.static org.jboss.msc.service.ServiceNamemoduleSpecServiceName(String identifier) Returns the corresponding ModuleSpec service name for the given module.protected org.jboss.modules.ModulepreloadModule(String name) voidrelinkModule(org.jboss.modules.Module module) voidstart(org.jboss.msc.service.StartContext context) voidstop(org.jboss.msc.service.StopContext context) toString()Methods inherited from class org.jboss.modules.ModuleLoader
findLoadedModuleLocal, findLoadedModuleLocal, findModule, forClass, forClassLoader, getDependencies, getFinders, getModuleDescription, installMBeanServer, iterateModules, iterateModules, loadModule, loadModule, loadModuleLocal, loadModuleLocal, preloadExportedModule, preloadExportedModule, preloadModule, preloadModule, preloadModule, refreshResourceLoaders, relink, setAndRefreshResourceLoaders, setAndRelinkDependencies, unloadModuleLocal, unloadModuleLocal
-
Field Details
-
MODULE_SPEC_SERVICE_PREFIX
public static final org.jboss.msc.service.ServiceName MODULE_SPEC_SERVICE_PREFIX -
MODULE_SERVICE_PREFIX
public static final org.jboss.msc.service.ServiceName MODULE_SERVICE_PREFIX -
MODULE_RESOLVED_SERVICE_PREFIX
public static final org.jboss.msc.service.ServiceName MODULE_RESOLVED_SERVICE_PREFIX -
MODULE_PREFIX
- See Also:
-
-
Constructor Details
-
ServiceModuleLoader
public ServiceModuleLoader(org.jboss.modules.ModuleLoader mainModuleLoader)
-
-
Method Details
-
preloadModule
protected org.jboss.modules.Module preloadModule(String name) throws org.jboss.modules.ModuleLoadException - Overrides:
preloadModulein classorg.jboss.modules.ModuleLoader- Throws:
org.jboss.modules.ModuleLoadException
-
findModule
protected org.jboss.modules.ModuleSpec findModule(String identifier) throws org.jboss.modules.ModuleLoadException - Overrides:
findModulein classorg.jboss.modules.ModuleLoader- Throws:
org.jboss.modules.ModuleLoadException
-
toString
- Overrides:
toStringin classorg.jboss.modules.ModuleLoader
-
start
public void start(org.jboss.msc.service.StartContext context) throws org.jboss.msc.service.StartException - Specified by:
startin interfaceorg.jboss.msc.Service- Throws:
org.jboss.msc.service.StartException
-
stop
public void stop(org.jboss.msc.service.StopContext context) - Specified by:
stopin interfaceorg.jboss.msc.Service
-
getValue
- Specified by:
getValuein interfaceorg.jboss.msc.value.Value<ServiceModuleLoader>- Throws:
IllegalStateExceptionIllegalArgumentException
-
relinkModule
public void relinkModule(org.jboss.modules.Module module) throws org.jboss.modules.ModuleLoadException - Throws:
org.jboss.modules.ModuleLoadException
-
addService
public static void addService(org.jboss.msc.service.ServiceTarget serviceTarget, Bootstrap.Configuration configuration) -
moduleSpecServiceName
Returns the corresponding ModuleSpec service name for the given module.- Parameters:
identifier- The module identifier string, method does not support non-canonized identifiers- Returns:
- The service name of the ModuleSpec service
-
installModuleResolvedService
public static void installModuleResolvedService(org.jboss.msc.service.ServiceTarget serviceTarget, String identifier) - Parameters:
serviceTarget- service target to use to install the service. Cannot benull.identifier- The module identifier string, method does not support non-canonized identifiers
-
moduleResolvedServiceName
Returns the corresponding module resolved service name for the given module. The module resolved service is basically a latch that prevents the module from being loaded until all the transitive dependencies that it depends upon have have their module spec services come up.- Parameters:
identifier- The module identifier string, method does not support non-canonized identifiers- Returns:
- The service name of the ModuleSpec service
-
isDynamicModule
Returns true if the module identifier is a dynamic module that will be loaded by this module loader- Parameters:
identifier- The module identifier string, method does not support non-canonized identifiers- Returns:
- Whether the module identifier is a dynamic module
-
moduleServiceName
Returns the corresponding ModuleLoadService service name for the given module.- Parameters:
identifier- The module identifier string, method does not support non-canonized identifiers- Returns:
- The service name of the ModuleLoadService service
-