Top Description Inners Fields Constructors Methods
org.jboss.modules

public abstract Class ModuleSpec

extends Object
Class Inheritance
Known Direct Subclasses
org.jboss.modules.AliasModuleSpec, org.jboss.modules.ConcreteModuleSpec
Imports
java.lang.instrument.ClassFileTransformer, java.security.AllPermission, .PermissionCollection, .Permissions, java.util.ArrayList, .HashMap, .LinkedHashMap, .List, .Map, org.jboss.modules.filter.PathFilters

A Module specification which is used by a ModuleLoader to define new modules.
Author
David M. Lloyd

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static interface
ModuleSpec.AliasBuilder

A builder for new alias module specifications.

public static interface
ModuleSpec.Builder

A builder for new concrete module specifications.

pack-priv static class

Field Summary

Modifier and TypeField and Description
private final String

Constructor Summary

AccessConstructor and Description
pack-priv
ModuleSpec(final String name)

Method Summary

Modifier and TypeMethod and Description
public static ModuleSpec.Builder

Returns:

the builder
build
(final ModuleIdentifier
the module identifier
moduleIdentifier
)

Deprecated Use build(String) instead.
Get a builder for a new module specification.
public static ModuleSpec.Builder

Returns:

the builder
build
(final String
the module name
name
)

Get a builder for a new module specification.

pack-priv static ModuleSpec.Builder
build(final String name, final boolean addBaseDep)

public static ModuleSpec.AliasBuilder

Returns:

the builder
buildAlias
(final ModuleIdentifier
the module identifier
moduleIdentifier
,
final ModuleIdentifier
the alias target identifier
aliasTarget
)

Deprecated Use buildAlias(String, String) instead.
Get a builder for a new module alias specification.
public static ModuleSpec.AliasBuilder

Returns:

the builder
buildAlias
(final String
the module name
name
,
final String
the alias target name
aliasName
)

Get a builder for a new module alias specification.

public ModuleIdentifier

Returns:

the module identifier
getModuleIdentifier
()

Deprecated Use getName() instead.
Get the module identifier for the module which is specified by this object.
public String

Returns:

the module name
getName
()

Get the module name for the module which is specified by this object.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

nameback to summary
private final String name

Constructor Detail

ModuleSpecback to summary
pack-priv ModuleSpec(final String name)

Method Detail

buildback to summary
public static ModuleSpec.Builder build(final ModuleIdentifier moduleIdentifier)

Deprecated

Use build(String) instead.

Get a builder for a new module specification.

Parameters
moduleIdentifier:ModuleIdentifier

the module identifier

Returns:ModuleSpec.Builder

the builder

Annotations
@Deprecated
buildback to summary
public static ModuleSpec.Builder build(final String name)

Get a builder for a new module specification.

Parameters
name:String

the module name

Returns:ModuleSpec.Builder

the builder

buildback to summary
pack-priv static ModuleSpec.Builder build(final String name, final boolean addBaseDep)
buildAliasback to summary
public static ModuleSpec.AliasBuilder buildAlias(final ModuleIdentifier moduleIdentifier, final ModuleIdentifier aliasTarget)

Deprecated

Use buildAlias(String, String) instead.

Get a builder for a new module alias specification.

Parameters
moduleIdentifier:ModuleIdentifier

the module identifier

aliasTarget:ModuleIdentifier

the alias target identifier

Returns:ModuleSpec.AliasBuilder

the builder

Annotations
@Deprecated
buildAliasback to summary
public static ModuleSpec.AliasBuilder buildAlias(final String name, final String aliasName)

Get a builder for a new module alias specification.

Parameters
name:String

the module name

aliasName:String

the alias target name

Returns:ModuleSpec.AliasBuilder

the builder

getModuleIdentifierback to summary
public ModuleIdentifier getModuleIdentifier()

Deprecated

Use getName() instead.

Get the module identifier for the module which is specified by this object.

Returns:ModuleIdentifier

the module identifier

Annotations
@Deprecated
getNameback to summary
public String getName()

Get the module name for the module which is specified by this object.

Returns:String

the module name

org.jboss.modules back to summary

public Interface ModuleSpec.AliasBuilder


A builder for new alias module specifications.

Method Summary

Modifier and TypeMethod and Description
public ModuleSpec

Returns:

the module specification
create
()

Create the module specification from this builder.

public String

Returns:

the module name
getAliasName
()

Get the name of the module being referenced by this builder.

public default ModuleIdentifier

Returns:

the module identifier
getAliasTarget
()

Deprecated Use getAliasName() instead.
Get the identifier of the module being referenced by this builder.
public default ModuleIdentifier

Returns:

the module identifier
getIdentifier
()

Deprecated Use getName() instead.
Get the identifier of the module being defined by this builder.
public String

Returns:

the module name
getName
()

Get the name of the module being defined by this builder.

Method Detail

createback to summary
public ModuleSpec create()

Create the module specification from this builder.

Returns:ModuleSpec

the module specification

getAliasNameback to summary
public String getAliasName()

Get the name of the module being referenced by this builder.

Returns:String

the module name

getAliasTargetback to summary
public default ModuleIdentifier getAliasTarget()

Deprecated

Use getAliasName() instead.

Get the identifier of the module being referenced by this builder.

Returns:ModuleIdentifier

the module identifier

Annotations
@Deprecated
getIdentifierback to summary
public default ModuleIdentifier getIdentifier()

Deprecated

Use getName() instead.

Get the identifier of the module being defined by this builder.

Returns:ModuleIdentifier

the module identifier

Annotations
@Deprecated
getNameback to summary
public String getName()

Get the name of the module being defined by this builder.

Returns:String

the module name

org.jboss.modules back to summary

public Interface ModuleSpec.Builder


A builder for new concrete module specifications.

Method Summary

Modifier and TypeMethod and Description
public ModuleSpec.Builder

Returns:

this builder
addDependency
(DependencySpec
the dependency specification
dependencySpec
)

Add a dependency specification.

public ModuleSpec.Builder

Returns:

this builder
addProperty
(String
the property name
name
,
String
the property value
value
)

Add a property to this module specification.

public ModuleSpec.Builder

Returns:

this builder
addProvide
(String
the service type name (must not be null)
serviceTypeName
,
String
the service implementation class name (must not be null)
serviceImplClassName
)

Declare that this module provides a service with the given type name with the implementation class with the given class name.

public ModuleSpec.Builder

Returns:

this builder
addResourceRoot
(ResourceLoaderSpec
the resource loader for the root
resourceLoader
)

Add a local resource root, from which this module will load class definitions and resources.

public ModuleSpec

Returns:

the module specification
create
()

Create the module specification from this builder.

public default ModuleIdentifier

Returns:

the module identifier
getIdentifier
()

Deprecated use getName() instead
Get the identifier of the module being defined by this builder.
public String

Returns:

the module name
getName
()

Get the name of the module being defined by this builder.

public Version

Returns:

the currently-set version, or null if none was set
getVersion
()

Get the version for this module specification, or null if none was set.

public ModuleSpec.Builder

Returns:

this builder
setAssertionSetting
(AssertionSetting
the assertion setting
assertionSetting
)

Set the default assertion setting for this module.

public ModuleSpec.Builder

Returns:

this builder
setClassFileTransformer
(ClassFileTransformer
the class file transformer
classFileTransformer
)

Set the class file transformer to use for this module.
public ModuleSpec.Builder

Returns:

this builder
setClassFileTransformer
(ClassTransformer
the class file transformer (must not be null)
transformer
)

Set the class file transformer function to use for this module.

public ModuleSpec.Builder

Returns:

this builder
setFallbackLoader
(final LocalLoader
the fall-back loader
fallbackLoader
)

Sets a "fall-back" loader that will attempt to load a class if all other mechanisms are unsuccessful.

public ModuleSpec.Builder

Returns:

this builder
setMainClass
(String
the main class name
mainClass
)

Set the main class for this module, or null for none.

public ModuleSpec.Builder

Returns:

this builder
setModuleClassLoaderFactory
(ModuleClassLoaderFactory
the factory
moduleClassLoaderFactory
)

Set the module class loader factory to use to create the module class loader for this module.

public ModuleSpec.Builder

Returns:

this builder
setPermissionCollection
(PermissionCollection
the permission collection
permissionCollection
)

Set the permission collection for this module specification.

public ModuleSpec.Builder

Returns:

this builder
setVersion
(Version
the module version
version
)

Set the version for this module specification, or null to set no version for this module.

Method Detail

addDependencyback to summary
public ModuleSpec.Builder addDependency(DependencySpec dependencySpec)

Add a dependency specification.

Parameters
dependencySpec:DependencySpec

the dependency specification

Returns:ModuleSpec.Builder

this builder

addPropertyback to summary
public ModuleSpec.Builder addProperty(String name, String value)

Add a property to this module specification.

Parameters
name:String

the property name

value:String

the property value

Returns:ModuleSpec.Builder

this builder

addProvideback to summary
public ModuleSpec.Builder addProvide(String serviceTypeName, 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:String

the service type name (must not be null)

serviceImplClassName:String

the service implementation class name (must not be null)

Returns:ModuleSpec.Builder

this builder

addResourceRootback to summary
public ModuleSpec.Builder addResourceRoot(ResourceLoaderSpec resourceLoader)

Add a local resource root, from which this module will load class definitions and resources.

Parameters
resourceLoader:ResourceLoaderSpec

the resource loader for the root

Returns:ModuleSpec.Builder

this builder

createback to summary
public ModuleSpec create()

Create the module specification from this builder.

Returns:ModuleSpec

the module specification

getIdentifierback to summary
public default ModuleIdentifier getIdentifier()

Deprecated

use getName() instead

Get the identifier of the module being defined by this builder.

Returns:ModuleIdentifier

the module identifier

Annotations
@Deprecated
getNameback to summary
public String getName()

Get the name of the module being defined by this builder.

Returns:String

the module name

getVersionback to summary
public Version getVersion()

Get the version for this module specification, or null if none was set.

Returns:Version

the currently-set version, or null if none was set

setAssertionSettingback to summary
public ModuleSpec.Builder setAssertionSetting(AssertionSetting assertionSetting)

Set the default assertion setting for this module.

Parameters
assertionSetting:AssertionSetting

the assertion setting

Returns:ModuleSpec.Builder

this builder

setClassFileTransformerback to summary
public ModuleSpec.Builder setClassFileTransformer(ClassFileTransformer classFileTransformer)

Set the class file transformer to use for this module.

Parameters
classFileTransformer:ClassFileTransformer

the class file transformer

Returns:ModuleSpec.Builder

this builder

Annotations
@Deprecated
setClassFileTransformerback to summary
public ModuleSpec.Builder setClassFileTransformer(ClassTransformer transformer)

Set the class file transformer function to use for this module. If the given function returns null then no transformation will take place. The function may accept and return a direct or heap byte buffer.

Parameters
transformer:ClassTransformer

the class file transformer (must not be null)

Returns:ModuleSpec.Builder

this builder

setFallbackLoaderback to summary
public ModuleSpec.Builder setFallbackLoader(final LocalLoader fallbackLoader)

Sets a "fall-back" loader that will attempt to load a class if all other mechanisms are unsuccessful.

Parameters
fallbackLoader:LocalLoader

the fall-back loader

Returns:ModuleSpec.Builder

this builder

setMainClassback to summary
public ModuleSpec.Builder setMainClass(String mainClass)

Set the main class for this module, or null for none.

Parameters
mainClass:String

the main class name

Returns:ModuleSpec.Builder

this builder

setModuleClassLoaderFactoryback to summary
public ModuleSpec.Builder setModuleClassLoaderFactory(ModuleClassLoaderFactory moduleClassLoaderFactory)

Set the module class loader factory to use to create the module class loader for this module.

Parameters
moduleClassLoaderFactory:ModuleClassLoaderFactory

the factory

Returns:ModuleSpec.Builder

this builder

setPermissionCollectionback to summary
public ModuleSpec.Builder setPermissionCollection(PermissionCollection permissionCollection)

Set the permission collection for this module specification. If none is given, a collection implying AllPermission is assumed.

Parameters
permissionCollection:PermissionCollection

the permission collection

Returns:ModuleSpec.Builder

this builder

setVersionback to summary
public ModuleSpec.Builder setVersion(Version version)

Set the version for this module specification, or null to set no version for this module.

Parameters
version:Version

the module version

Returns:ModuleSpec.Builder

this builder

org.jboss.modules back to summary

pack-priv final Class ModuleSpec.ServiceInfo

extends Object
Class Inheritance

Field Summary

Modifier and TypeField and Description
private final String
private final String

Constructor Summary

AccessConstructor and Description
pack-priv
ServiceInfo(final String serviceTypeName, final String implClassName)

Method Summary

Modifier and TypeMethod and Description
pack-priv String
pack-priv String
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

implClassNameback to summary
private final String implClassName
serviceTypeNameback to summary
private final String serviceTypeName

Constructor Detail

ServiceInfoback to summary
pack-priv ServiceInfo(final String serviceTypeName, final String implClassName)

Method Detail

getImplClassNameback to summary
pack-priv String getImplClassName()
getServiceTypeNameback to summary
pack-priv String getServiceTypeName()