Class 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 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
    • Constructor Detail

      • ServiceModuleLoader

        public ServiceModuleLoader​(org.jboss.modules.ModuleLoader mainModuleLoader)
    • Method Detail

      • 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
      • 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

        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