Top Description Fields Constructors Methods
com.sun.enterprise.module.common_impl

public Class DefaultModuleDefinition

extends Object
implements ModuleDefinition
Class Inheritance
All Implemented Interfaces
com.sun.enterprise.module.ModuleDefinition
Known Direct Subclasses
com.sun.enterprise.module.impl.CookedModuleDefinition
Imports
com.sun.enterprise.module.ManifestConstants, .ModuleDefinition, .ModuleDependency, .ModuleMetadata, java.io.File, .IOException, java.net.URI, .URLConnection, java.util.ArrayList, .List, java.util.jar.Attributes, .Manifest, java.util.logging.Logger

ModuleDefinition implementation that picks up most of the module properties from the manifest file of the jar, as baked in by the hk2-maven-plugin.
Author
Jerome Dochez

Field Summary

Modifier and TypeField and Description
protected final List<URI>
protected final List<ModuleDependency>
private static final Manifest
private final String
private final String
private static final Logger
protected final Attributes
mainAttributes

Main attributes section of the manifest.

private final Manifest
private final ModuleMetadata
metadata

Metadata that works like index.

private final String
private final String[]
private final String

Constructor Summary

AccessConstructor and Description
public
DefaultModuleDefinition(File location)

TO DO need to support a URI constructor

public

Method Summary

Modifier and TypeMethod and Description
protected String
decorateClassPath(String classpathElement)

Extension point to manipulate the classpath element before it's parsed.

public ModuleDependency[]

Returns:

the ModuleDependency
getDependencies
()

Implements com.sun.enterprise.module.ModuleDefinition.getDependencies.

Returns the list of module dependencies

public String

Returns:

the ImportPolicy implementation class name
getImportPolicyClassName
()

Implements com.sun.enterprise.module.ModuleDefinition.getImportPolicyClassName.

Returns the class name implementing the ImportPolicy interface for this module or null if there is no such implementation

public String

Returns:

the LifecyclePolicy implementation class name
getLifecyclePolicyClassName
()

Implements com.sun.enterprise.module.ModuleDefinition.getLifecyclePolicyClassName.

Returns the class name implementing the LifecyclePolicy interface for this module or null if there is no such implementation

public URI[]

Returns:

the list of URI locations for this module
getLocations
()

Implements com.sun.enterprise.module.ModuleDefinition.getLocations.

Returns the list of URI locations forming the classpath for this module.

public Manifest

Returns:

never null.
getManifest
()

Implements com.sun.enterprise.module.ModuleDefinition.getManifest.

Returns the manifest file from the module's implementation jar file

public ModuleMetadata
getMetadata()

Implements com.sun.enterprise.module.ModuleDefinition.getMetadata.

Gets the metadata that describes various components and services in this module.

public String

Returns:

the name
getName
()

Implements com.sun.enterprise.module.ModuleDefinition.getName.

Returns the name of the module

public String[]

Returns:

the list of public packages or classes
getPublicInterfaces
()

Implements com.sun.enterprise.module.ModuleDefinition.getPublicInterfaces.

Returns the list of classes and packages that have been designated as public interfaces of this module.

public String

Returns:

the module's version
getVersion
()

Implements com.sun.enterprise.module.ModuleDefinition.getVersion.

Returns the module's version

protected void
parseAttributes(Attributes
Main attributes of the manifest. Always non-null.
attr
)

Extensibility point to parse more information from Manifest attributes.

protected void
parseClassPath(Attributes attr, URI baseURI)

Parses Class-Path from manifest attributes and updates URI list.

private boolean
testClassPath(URI uri)

Optional error diagnostics performed during the development time to check if the URL pointed by the path actually exists.

public String
toString()

Overrides java.lang.Object.toString.

Assists debugging.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAllwaitwaitwait

Field Detail

classPathback to summary
protected final List<URI> classPath
dependenciesback to summary
protected final List<ModuleDependency> dependencies
EMPTY_MANIFESTback to summary
private static final Manifest EMPTY_MANIFEST
importPolicyback to summary
private final String importPolicy
lifecyclePolicyback to summary
private final String lifecyclePolicy
LOGGERback to summary
private static final Logger LOGGER
mainAttributesback to summary
protected final Attributes mainAttributes

Main attributes section of the manifest. Always non-null.

manifestback to summary
private final Manifest manifest
metadataback to summary
private final ModuleMetadata metadata

Metadata that works like index.

nameback to summary
private final String name
publicPkgsback to summary
private final String[] publicPkgs
versionback to summary
private final String version

Constructor Detail

DefaultModuleDefinitionback to summary
public DefaultModuleDefinition(File location) throws IOException

TO DO need to support a URI constructor

DefaultModuleDefinitionback to summary
public DefaultModuleDefinition(File location, Attributes attr) throws IOException

Method Detail

decorateClassPathback to summary
protected String decorateClassPath(String classpathElement)

Extension point to manipulate the classpath element before it's parsed.

See Also
parseClassPath(Attributes, URI)
getDependenciesback to summary
public ModuleDependency[] getDependencies()

Implements com.sun.enterprise.module.ModuleDefinition.getDependencies.

Returns the list of module dependencies

Returns:ModuleDependency[]

the ModuleDependency

getImportPolicyClassNameback to summary
public String getImportPolicyClassName()

Implements com.sun.enterprise.module.ModuleDefinition.getImportPolicyClassName.

Returns the class name implementing the ImportPolicy interface for this module or null if there is no such implementation

Returns:String

the ImportPolicy implementation class name

getLifecyclePolicyClassNameback to summary
public String getLifecyclePolicyClassName()

Implements com.sun.enterprise.module.ModuleDefinition.getLifecyclePolicyClassName.

Returns the class name implementing the LifecyclePolicy interface for this module or null if there is no such implementation

Returns:String

the LifecyclePolicy implementation class name

getLocationsback to summary
public URI[] getLocations()

Implements com.sun.enterprise.module.ModuleDefinition.getLocations.

Returns the list of URI locations forming the classpath for this module.

Returns:URI[]

the list of URI locations for this module

getManifestback to summary
public Manifest getManifest()

Implements com.sun.enterprise.module.ModuleDefinition.getManifest.

Returns the manifest file from the module's implementation jar file

Returns:Manifest

never null.

getMetadataback to summary
public ModuleMetadata getMetadata()

Implements com.sun.enterprise.module.ModuleDefinition.getMetadata.

Doc from com.sun.enterprise.module.ModuleDefinition.getMetadata.

Gets the metadata that describes various components and services in this module.

getNameback to summary
public String getName()

Implements com.sun.enterprise.module.ModuleDefinition.getName.

Returns the name of the module

Returns:String

the name

getPublicInterfacesback to summary
public String[] getPublicInterfaces()

Implements com.sun.enterprise.module.ModuleDefinition.getPublicInterfaces.

Returns the list of classes and packages that have been designated as public interfaces of this module.

Returns:String[]

the list of public packages or classes

getVersionback to summary
public String getVersion()

Implements com.sun.enterprise.module.ModuleDefinition.getVersion.

Returns the module's version

Returns:String

the module's version

parseAttributesback to summary
protected void parseAttributes(Attributes attr)

Extensibility point to parse more information from Manifest attributes.

Parameters
attr:Attributes

Main attributes of the manifest. Always non-null.

parseClassPathback to summary
protected void parseClassPath(Attributes attr, URI baseURI) throws IOException

Parses Class-Path from manifest attributes and updates URI list.

testClassPathback to summary
private boolean testClassPath(URI uri)

Optional error diagnostics performed during the development time to check if the URL pointed by the path actually exists.

toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Assists debugging.