Package org.jboss.modules
Interface ModuleSpec.Builder
-
- Enclosing class:
- ModuleSpec
public static interface ModuleSpec.Builder
A builder for new concrete module specifications.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Deprecated Methods Modifier and Type Method Description ModuleSpec.Builder
addDependency(DependencySpec dependencySpec)
Add a dependency specification.ModuleSpec.Builder
addProperty(java.lang.String name, java.lang.String value)
Add a property to this module specification.ModuleSpec.Builder
addProvide(java.lang.String serviceTypeName, java.lang.String serviceImplClassName)
Declare that this module provides a service with the given type name with the implementation class with the given class name.ModuleSpec.Builder
addResourceRoot(ResourceLoaderSpec resourceLoader)
Add a local resource root, from which this module will load class definitions and resources.ModuleSpec
create()
Create the module specification from this builder.default ModuleIdentifier
getIdentifier()
Deprecated, for removal: This API element is subject to removal in a future version.usegetName()
insteadjava.lang.String
getName()
Get the name of the module being defined by this builder.Version
getVersion()
Get the version for this module specification, ornull
if none was set.ModuleSpec.Builder
setAssertionSetting(AssertionSetting assertionSetting)
Set the default assertion setting for this module.ModuleSpec.Builder
setClassFileTransformer(java.lang.instrument.ClassFileTransformer classFileTransformer)
Deprecated.UsesetClassFileTransformer(ClassTransformer)
instead.ModuleSpec.Builder
setClassFileTransformer(ClassTransformer transformer)
Set the class file transformer function to use for this module.ModuleSpec.Builder
setFallbackLoader(LocalLoader fallbackLoader)
Sets a "fall-back" loader that will attempt to load a class if all other mechanisms are unsuccessful.ModuleSpec.Builder
setMainClass(java.lang.String mainClass)
Set the main class for this module, ornull
for none.ModuleSpec.Builder
setModuleClassLoaderFactory(ModuleClassLoaderFactory moduleClassLoaderFactory)
Set the module class loader factory to use to create the module class loader for this module.ModuleSpec.Builder
setPermissionCollection(java.security.PermissionCollection permissionCollection)
Set the permission collection for this module specification.ModuleSpec.Builder
setVersion(Version version)
Set the version for this module specification, ornull
to set no version for this module.
-
-
-
Method Detail
-
setMainClass
ModuleSpec.Builder setMainClass(java.lang.String mainClass)
Set the main class for this module, ornull
for none.- Parameters:
mainClass
- the main class name- Returns:
- this builder
-
setAssertionSetting
ModuleSpec.Builder setAssertionSetting(AssertionSetting assertionSetting)
Set the default assertion setting for this module.- Parameters:
assertionSetting
- the assertion setting- Returns:
- this builder
-
addDependency
ModuleSpec.Builder addDependency(DependencySpec dependencySpec)
Add a dependency specification.- Parameters:
dependencySpec
- the dependency specification- Returns:
- this builder
-
addResourceRoot
ModuleSpec.Builder addResourceRoot(ResourceLoaderSpec resourceLoader)
Add a local resource root, from which this module will load class definitions and resources.- Parameters:
resourceLoader
- the resource loader for the root- Returns:
- this builder
-
create
ModuleSpec create()
Create the module specification from this builder.- Returns:
- the module specification
-
getIdentifier
@Deprecated(forRemoval=true) default ModuleIdentifier getIdentifier()
Deprecated, for removal: This API element is subject to removal in a future version.usegetName()
insteadGet the identifier of the module being defined by this builder.- Returns:
- the module identifier
-
getName
java.lang.String getName()
Get the name of the module being defined by this builder.- Returns:
- the module name
-
setFallbackLoader
ModuleSpec.Builder setFallbackLoader(LocalLoader fallbackLoader)
Sets a "fall-back" loader that will attempt to load a class if all other mechanisms are unsuccessful.- Parameters:
fallbackLoader
- the fall-back loader- Returns:
- this builder
-
setModuleClassLoaderFactory
ModuleSpec.Builder setModuleClassLoaderFactory(ModuleClassLoaderFactory moduleClassLoaderFactory)
Set the module class loader factory to use to create the module class loader for this module.- Parameters:
moduleClassLoaderFactory
- the factory- Returns:
- this builder
-
setClassFileTransformer
@Deprecated ModuleSpec.Builder setClassFileTransformer(java.lang.instrument.ClassFileTransformer classFileTransformer)
Deprecated.UsesetClassFileTransformer(ClassTransformer)
instead.Set the class file transformer to use for this module.- Parameters:
classFileTransformer
- the class file transformer- Returns:
- this builder
-
setClassFileTransformer
ModuleSpec.Builder setClassFileTransformer(ClassTransformer transformer)
Set the class file transformer function to use for this module. If the given function returnsnull
then no transformation will take place. The function may accept and return a direct or heap byte buffer.- Parameters:
transformer
- the class file transformer (must not benull
)- Returns:
- this builder
-
addProperty
ModuleSpec.Builder addProperty(java.lang.String name, java.lang.String value)
Add a property to this module specification.- Parameters:
name
- the property namevalue
- the property value- Returns:
- this builder
-
setPermissionCollection
ModuleSpec.Builder setPermissionCollection(java.security.PermissionCollection permissionCollection)
Set the permission collection for this module specification. If none is given, a collection implyingAllPermission
is assumed.- Parameters:
permissionCollection
- the permission collection- Returns:
- this builder
-
setVersion
ModuleSpec.Builder setVersion(Version version)
Set the version for this module specification, ornull
to set no version for this module.- Parameters:
version
- the module version- Returns:
- this builder
-
addProvide
ModuleSpec.Builder addProvide(java.lang.String serviceTypeName, java.lang.String serviceImplClassName)
Declare that this module provides a service with the given type name with the implementation class with the given class name.- Parameters:
serviceTypeName
- the service type name (must not benull
)serviceImplClassName
- the service implementation class name (must not benull
)- Returns:
- this builder
-
getVersion
Version getVersion()
Get the version for this module specification, ornull
if none was set.- Returns:
- the currently-set version, or
null
if none was set
-
-