public class ExternalModuleService extends Object implements org.jboss.msc.service.Service<ExternalModuleService>, ExternalModule
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 Module will be unloaded.
TODO: support removing modules when msc can tell us that nothing depends on the service.
EXTERNAL_MODULE_PREFIX| Modifier and Type | Method and Description |
|---|---|
org.jboss.modules.ModuleIdentifier |
addExternalModule(String moduleName,
org.jboss.msc.service.ServiceRegistry serviceRegistry,
org.jboss.msc.service.ServiceTarget serviceTarget)
Prepares and install a new
ModuleIdentifier and ExternalModuleSpecService to manage this module. |
org.jboss.modules.ModuleIdentifier |
addExternalModule(String moduleName,
String path,
org.jboss.msc.service.ServiceRegistry serviceRegistry,
org.jboss.msc.service.ServiceTarget serviceTarget)
Prepares and install a new
ModuleIdentifier and ExternalModuleSpecService to manage this module. |
static void |
addService(org.jboss.msc.service.ServiceTarget serviceTarget,
org.jboss.msc.service.ServiceName externalModuleServiceName) |
ExternalModuleService |
getValue() |
boolean |
isValidFile(String path)
Checks if the path argument refers to a file and the file is valid to be used as a class-path entry.
|
void |
start(org.jboss.msc.service.StartContext context) |
void |
stop(org.jboss.msc.service.StopContext context) |
public boolean isValidFile(String path)
ExternalModuleisValidFile in interface ExternalModulepath - value to test.true if and only if the path refers to a file and the file is considered valid as a class-path entry,
otherwise returns false.public org.jboss.modules.ModuleIdentifier addExternalModule(String moduleName, org.jboss.msc.service.ServiceRegistry serviceRegistry, org.jboss.msc.service.ServiceTarget serviceTarget)
ExternalModuleModuleIdentifier and ExternalModuleSpecService to 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.
addExternalModule in interface ExternalModulemoduleName - 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 be nullserviceRegistry - The MSC service registry which will be used to find if there is already an ExternalModuleSpecService
created for the given path. Cannot be null.serviceTarget - The ServiceTarget to use to install the service. Cannot be null.ModuleIdentifier created for the given path.public org.jboss.modules.ModuleIdentifier addExternalModule(String moduleName, String path, org.jboss.msc.service.ServiceRegistry serviceRegistry, org.jboss.msc.service.ServiceTarget serviceTarget)
ExternalModuleModuleIdentifier and ExternalModuleSpecService to 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.addExternalModule in interface ExternalModulemoduleName - 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 be nullserviceRegistry - The MSC service registry which will be used to find if there is already an ExternalModuleSpecService
created for the given module name. Cannot be null.serviceTarget - The ServiceTarget to use to install the service. Cannot be null.ModuleIdentifier created for the given module name.public void start(org.jboss.msc.service.StartContext context)
throws org.jboss.msc.service.StartException
start in interface org.jboss.msc.Serviceorg.jboss.msc.service.StartExceptionpublic void stop(org.jboss.msc.service.StopContext context)
stop in interface org.jboss.msc.Servicepublic ExternalModuleService getValue() throws IllegalStateException, IllegalArgumentException
getValue in interface org.jboss.msc.value.Value<ExternalModuleService>IllegalStateExceptionIllegalArgumentExceptionpublic static void addService(org.jboss.msc.service.ServiceTarget serviceTarget,
org.jboss.msc.service.ServiceName externalModuleServiceName)
Copyright © 2019 JBoss by Red Hat. All rights reserved.