Interface ExternalModule
-
- All Known Implementing Classes:
ExternalModuleService
public interface ExternalModuleAllows callers to add external modules that can be used as dependencies for a DeploymentUnit.A module is considered external when it resides outside ot the default "modules" directory from which JBoss Modules looks to find modules. Adding an external module consists of creating a
ModuleIdentifierandExternalModuleSpecServicethat manages the life cycle of the module specification that defines the module. To be created it is necessary to specify a path to its location. That path could be a jar file or a directory, in which case the directory will be scanned searching for jar files in it.- Author:
- Yeray Borges
-
-
Field Summary
Fields Modifier and Type Field Description static StringEXTERNAL_MODULE_PREFIXPrefix name used for the new installed module identifier.
-
Method Summary
All Methods Instance Methods Abstract 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 path, org.jboss.msc.service.ServiceRegistry serviceRegistry, org.jboss.msc.service.ServiceTarget serviceTarget)Prepares and install a newModuleIdentifierandExternalModuleSpecServiceto manage this module.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.
-
-
-
Field Detail
-
EXTERNAL_MODULE_PREFIX
static final String EXTERNAL_MODULE_PREFIX
Prefix name used for the new installed module identifier.- See Also:
- Constant Field Values
-
-
Method Detail
-
addExternalModule
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 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.- 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.
-
addExternalModule
org.jboss.modules.ModuleIdentifier addExternalModule(String path, org.jboss.msc.service.ServiceRegistry serviceRegistry, org.jboss.msc.service.ServiceTarget serviceTarget)
Prepares 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.
- Parameters:
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 path. Cannot benull.serviceTarget- TheServiceTargetto use to install the service. Cannot benull.- Returns:
- The
ModuleIdentifiercreated for the given path.
-
isValidFile
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.- 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.
-
-