Class ExternalModuleService
- java.lang.Object
-
- org.jboss.as.server.moduleservice.ExternalModuleService
-
- All Implemented Interfaces:
ExternalModule,org.jboss.msc.Service,org.jboss.msc.service.Service<ExternalModuleService>,org.jboss.msc.value.Value<ExternalModuleService>
public class ExternalModuleService extends Object implements org.jboss.msc.service.Service<ExternalModuleService>, ExternalModule
Service that manages external modules.Once external modules are installed there is currently no way to safely remove the module spec service, however as they are on-demand services if all dependent services are stopped then the actual
Modulewill be unloaded.TODO: support removing modules when msc can tell us that nothing depends on the service.
- Author:
- Stuart Douglas, Ales Justin
-
-
Field Summary
-
Fields inherited from interface org.jboss.as.server.moduleservice.ExternalModule
EXTERNAL_MODULE_PREFIX
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description org.jboss.modules.ModuleIdentifieraddExternalModule(String moduleName, String path, org.jboss.msc.service.ServiceRegistry serviceRegistry, org.jboss.msc.service.ServiceTarget serviceTarget)Prepares and install a newModuleIdentifierandExternalModuleSpecServiceto manage this module.org.jboss.modules.ModuleIdentifieraddExternalModule(String moduleName, org.jboss.msc.service.ServiceRegistry serviceRegistry, org.jboss.msc.service.ServiceTarget serviceTarget)Prepares and install a newModuleIdentifierandExternalModuleSpecServiceto manage this module.static voidaddService(org.jboss.msc.service.ServiceTarget serviceTarget, org.jboss.msc.service.ServiceName externalModuleServiceName)ExternalModuleServicegetValue()booleanisValidFile(String path)Checks if the path argument refers to a file and the file is valid to be used as a class-path entry.voidstart(org.jboss.msc.service.StartContext context)voidstop(org.jboss.msc.service.StopContext context)
-
-
-
Method Detail
-
isValidFile
public boolean isValidFile(String path)
Description copied from interface:ExternalModuleChecks if the path argument refers to a file and the file is valid to be used as a class-path entry.- Specified by:
isValidFilein interfaceExternalModule- Parameters:
path- value to test.- Returns:
trueif and only if the path refers to a file and the file is considered valid as a class-path entry, otherwise returnsfalse.
-
addExternalModule
public org.jboss.modules.ModuleIdentifier addExternalModule(String moduleName, org.jboss.msc.service.ServiceRegistry serviceRegistry, org.jboss.msc.service.ServiceTarget serviceTarget)
Description copied from interface:ExternalModulePrepares and install a newModuleIdentifierandExternalModuleSpecServiceto manage this module.This method does not use a specific module name, instead the module name is derived from the given path. This method prevents the creation of duplicate external module spec services for the given path looking at the service registry, so it can be called multiple times using the same path.
- Specified by:
addExternalModulein interfaceExternalModule- Parameters:
moduleName- An absolute path pointing out to a directory or jar file that will be used as source for the resources backed by the given module name we want to install. Cannot benullserviceRegistry- The MSC service registry which will be used to find if there is already anExternalModuleSpecServicecreated for the given path. Cannot benull.serviceTarget- TheServiceTargetto use to install the service. Cannot benull.- Returns:
- The
ModuleIdentifiercreated for the given path.
-
addExternalModule
public org.jboss.modules.ModuleIdentifier addExternalModule(String moduleName, String path, org.jboss.msc.service.ServiceRegistry serviceRegistry, org.jboss.msc.service.ServiceTarget serviceTarget)
Description copied from interface:ExternalModulePrepares and install a newModuleIdentifierandExternalModuleSpecServiceto manage this module. This method prevents the creation of duplicate external module spec services for the given module name looking at the service registry, so it can be called multiple times for the same module name.- Specified by:
addExternalModulein interfaceExternalModule- Parameters:
moduleName- The module name to add.path- An absolute path pointing out to a directory or jar file that will be used as source for the resources backed by the given module name we want to install. Cannot benullserviceRegistry- The MSC service registry which will be used to find if there is already anExternalModuleSpecServicecreated for the given module name. Cannot benull.serviceTarget- TheServiceTargetto use to install the service. Cannot benull.- Returns:
- The
ModuleIdentifiercreated for the given module name.
-
start
public void start(org.jboss.msc.service.StartContext context) throws org.jboss.msc.service.StartException- Specified by:
startin interfaceorg.jboss.msc.Service- Specified by:
startin interfaceorg.jboss.msc.service.Service<ExternalModuleService>- Throws:
org.jboss.msc.service.StartException
-
stop
public void stop(org.jboss.msc.service.StopContext context)
- Specified by:
stopin interfaceorg.jboss.msc.Service- Specified by:
stopin interfaceorg.jboss.msc.service.Service<ExternalModuleService>
-
getValue
public ExternalModuleService getValue() throws IllegalStateException, IllegalArgumentException
- Specified by:
getValuein interfaceorg.jboss.msc.value.Value<ExternalModuleService>- Throws:
IllegalStateExceptionIllegalArgumentException
-
addService
public static void addService(org.jboss.msc.service.ServiceTarget serviceTarget, org.jboss.msc.service.ServiceName externalModuleServiceName)
-
-