Package org.jboss.modules
Interface ModuleSpec.Builder
- Enclosing class:
ModuleSpec
public static interface ModuleSpec.Builder
A builder for new concrete module specifications.
-
Method Summary
Modifier and TypeMethodDescriptionaddDependency
(DependencySpec dependencySpec) Add a dependency specification.addProperty
(String name, String value) Add a property to this module specification.addResourceRoot
(ResourceLoaderSpec resourceLoader) Add a local resource root, from which this module will load class definitions and resources.create()
Create the module specification from this builder.Get the identifier of the module being defined by this builder.setAssertionSetting
(AssertionSetting assertionSetting) Set the default assertion setting for this module.setClassFileTransformer
(ClassFileTransformer classFileTransformer) Set the class file transformer to use for this module.setFallbackLoader
(LocalLoader fallbackLoader) Sets a "fall-back" loader that will attempt to load a class if all other mechanisms are unsuccessful.setMainClass
(String mainClass) Set the main class for this module, ornull
for none.setModuleClassLoaderFactory
(ModuleClassLoaderFactory moduleClassLoaderFactory) Set the module class loader factory to use to create the module class loader for this module.setPermissionCollection
(PermissionCollection permissionCollection) Set the permission collection for this module specification.
-
Method Details
-
setMainClass
Set the main class for this module, ornull
for none.- Parameters:
mainClass
- the main class name- Returns:
- this builder
-
setAssertionSetting
Set the default assertion setting for this module.- Parameters:
assertionSetting
- the assertion setting- Returns:
- this builder
-
addDependency
Add a dependency specification.- Parameters:
dependencySpec
- the dependency specification- Returns:
- this builder
-
addResourceRoot
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
ModuleIdentifier getIdentifier()Get the identifier of the module being defined by this builder.- Returns:
- the module identifier
-
setFallbackLoader
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
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
Set the class file transformer to use for this module.- Parameters:
classFileTransformer
- the class file transformer- Returns:
- this builder
-
addProperty
Add a property to this module specification.- Parameters:
name
- the property namevalue
- the property value- Returns:
- this builder
-
setPermissionCollection
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
-