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>
ModuleLoaderthat 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
Fields Modifier and Type Field Description static StringMODULE_PREFIXstatic org.jboss.msc.service.ServiceNameMODULE_RESOLVED_SERVICE_PREFIXstatic org.jboss.msc.service.ServiceNameMODULE_SERVICE_PREFIXstatic org.jboss.msc.service.ServiceNameMODULE_SPEC_SERVICE_PREFIX
-
Constructor Summary
Constructors Constructor Description ServiceModuleLoader(org.jboss.modules.ModuleLoader mainModuleLoader)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description static voidaddService(org.jboss.msc.service.ServiceTarget serviceTarget, Bootstrap.Configuration configuration)protected org.jboss.modules.ModuleSpecfindModule(String identifier)org.jboss.modules.ModuleSpecfindModule(org.jboss.modules.ModuleIdentifier identifier)Deprecated, for removal: This API element is subject to removal in a future version.Will be made protected in line with this method in the parent class UsefindModule(String)ServiceModuleLoadergetValue()static voidinstallModuleResolvedService(org.jboss.msc.service.ServiceTarget serviceTarget, String identifier)static voidinstallModuleResolvedService(org.jboss.msc.service.ServiceTarget serviceTarget, org.jboss.modules.ModuleIdentifier identifier)Deprecated, for removal: This API element is subject to removal in a future version.static booleanisDynamicModule(String identifier)Returns true if the module identifier is a dynamic module that will be loaded by this module loaderstatic booleanisDynamicModule(org.jboss.modules.ModuleIdentifier identifier)Deprecated, for removal: This API element is subject to removal in a future version.static org.jboss.msc.service.ServiceNamemoduleResolvedServiceName(String identifier)Returns the corresponding module resolved service name for the given module.static org.jboss.msc.service.ServiceNamemoduleResolvedServiceName(org.jboss.modules.ModuleIdentifier identifier)Deprecated, for removal: This API element is subject to removal in a future version.static org.jboss.msc.service.ServiceNamemoduleServiceName(String identifier)Returns the corresponding ModuleLoadService service name for the given module.static org.jboss.msc.service.ServiceNamemoduleServiceName(org.jboss.modules.ModuleIdentifier identifier)Deprecated, for removal: This API element is subject to removal in a future version.static org.jboss.msc.service.ServiceNamemoduleSpecServiceName(String identifier)Returns the corresponding ModuleSpec service name for the given module.static org.jboss.msc.service.ServiceNamemoduleSpecServiceName(org.jboss.modules.ModuleIdentifier identifier)Deprecated, for removal: This API element is subject to removal in a future version.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)StringtoString()-
Methods inherited from class org.jboss.modules.ModuleLoader
findLoadedModuleLocal, findLoadedModuleLocal, forClass, forClassLoader, getDependencies, getFinders, getModuleDescription, installMBeanServer, iterateModules, iterateModules, loadModule, loadModule, loadModuleLocal, loadModuleLocal, preloadExportedModule, preloadExportedModule, preloadModule, preloadModule, preloadModule, refreshResourceLoaders, relink, setAndRefreshResourceLoaders, setAndRelinkDependencies, unloadModuleLocal, unloadModuleLocal
-
-
-
-
Field Detail
-
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
public static final String MODULE_PREFIX
- See Also:
- Constant Field Values
-
-
Method Detail
-
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
@Deprecated(forRemoval=true, since="27.0.0") public org.jboss.modules.ModuleSpec findModule(org.jboss.modules.ModuleIdentifier identifier) throws org.jboss.modules.ModuleLoadException
Deprecated, for removal: This API element is subject to removal in a future version.Will be made protected in line with this method in the parent class UsefindModule(String)- Overrides:
findModulein 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
public String 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
public ServiceModuleLoader getValue() throws IllegalStateException, IllegalArgumentException
- 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
@Deprecated(forRemoval=true, since="27.0.0") public static org.jboss.msc.service.ServiceName moduleSpecServiceName(org.jboss.modules.ModuleIdentifier identifier)
Deprecated, for removal: This API element is subject to removal in a future version.Returns the corresponding ModuleSpec service name for the given module.- Parameters:
identifier- The module identifier- Returns:
- The service name of the ModuleSpec service
-
moduleSpecServiceName
public static org.jboss.msc.service.ServiceName moduleSpecServiceName(String identifier)
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
@Deprecated(forRemoval=true, since="27.0.0") public static void installModuleResolvedService(org.jboss.msc.service.ServiceTarget serviceTarget, org.jboss.modules.ModuleIdentifier identifier)
Deprecated, for removal: This API element is subject to removal in a future version.
-
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
@Deprecated(forRemoval=true, since="27.0.0") public static org.jboss.msc.service.ServiceName moduleResolvedServiceName(org.jboss.modules.ModuleIdentifier identifier)
Deprecated, for removal: This API element is subject to removal in a future version.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- Returns:
- The service name of the ModuleSpec service
-
moduleResolvedServiceName
public static org.jboss.msc.service.ServiceName moduleResolvedServiceName(String identifier)
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
@Deprecated(forRemoval=true, since="27.0.0") public static boolean isDynamicModule(org.jboss.modules.ModuleIdentifier identifier)
Deprecated, for removal: This API element is subject to removal in a future version.Returns true if the module identifier is a dynamic module that will be loaded by this module loader
-
isDynamicModule
public static boolean isDynamicModule(String identifier)
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
@Deprecated(forRemoval=true, since="27.0.0") public static org.jboss.msc.service.ServiceName moduleServiceName(org.jboss.modules.ModuleIdentifier identifier)
Deprecated, for removal: This API element is subject to removal in a future version.Returns the corresponding ModuleLoadService service name for the given module.- Parameters:
identifier- The module identifier- Returns:
- The service name of the ModuleLoadService service
-
moduleServiceName
public static org.jboss.msc.service.ServiceName moduleServiceName(String identifier)
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
-
-