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

    Fields
    Modifier and Type
    Field
    Description
    static final String
     
    static final org.jboss.msc.service.ServiceName
     
    static final org.jboss.msc.service.ServiceName
     
    static final org.jboss.msc.service.ServiceName
     

    Fields inherited from class org.jboss.modules.ModuleLoader

    NO_FINDERS

    Fields inherited from interface org.jboss.msc.service.Service

    NULL
  • Constructor Summary

    Constructors
    Constructor
    Description
    ServiceModuleLoader(org.jboss.modules.ModuleLoader mainModuleLoader)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static void
    addService(org.jboss.msc.service.ServiceTarget serviceTarget, Bootstrap.Configuration configuration)
     
    protected org.jboss.modules.ModuleSpec
    findModule(String identifier)
     
    org.jboss.modules.ModuleSpec
    findModule(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 Use findModule(String)
     
    static void
    installModuleResolvedService(org.jboss.msc.service.ServiceTarget serviceTarget, String identifier)
     
    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.
    static boolean
    isDynamicModule(String identifier)
    Returns true if the module identifier is a dynamic module that will be loaded by this module loader
    static boolean
    isDynamicModule(org.jboss.modules.ModuleIdentifier identifier)
    Deprecated, for removal: This API element is subject to removal in a future version.
    static org.jboss.msc.service.ServiceName
    Returns the corresponding module resolved service name for the given module.
    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.
    static org.jboss.msc.service.ServiceName
    Returns the corresponding ModuleLoadService service name for the given module.
    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.
    static org.jboss.msc.service.ServiceName
    Returns the corresponding ModuleSpec service name for the given module.
    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.
    protected org.jboss.modules.Module
     
    void
    relinkModule(org.jboss.modules.Module module)
     
    void
    start(org.jboss.msc.service.StartContext context)
     
    void
    stop(org.jboss.msc.service.StopContext context)
     
     

    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

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • 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

      public static final String 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:
      preloadModule in class org.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 Use findModule(String)
      Overrides:
      findModule in class org.jboss.modules.ModuleLoader
      Throws:
      org.jboss.modules.ModuleLoadException
    • findModule

      protected org.jboss.modules.ModuleSpec findModule(String identifier) throws org.jboss.modules.ModuleLoadException
      Overrides:
      findModule in class org.jboss.modules.ModuleLoader
      Throws:
      org.jboss.modules.ModuleLoadException
    • toString

      public String toString()
      Overrides:
      toString in class org.jboss.modules.ModuleLoader
    • start

      public void start(org.jboss.msc.service.StartContext context) throws org.jboss.msc.service.StartException
      Specified by:
      start in interface org.jboss.msc.Service
      Throws:
      org.jboss.msc.service.StartException
    • stop

      public void stop(org.jboss.msc.service.StopContext context)
      Specified by:
      stop in interface org.jboss.msc.Service
    • getValue

      Specified by:
      getValue in interface org.jboss.msc.value.Value<ServiceModuleLoader>
      Throws:
      IllegalStateException
      IllegalArgumentException
    • 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 be null.
      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