com.sun.enterprise.module.common_impl
Class DefaultModuleDefinition

java.lang.Object
  extended by com.sun.enterprise.module.common_impl.DefaultModuleDefinition
All Implemented Interfaces:
ModuleDefinition
Direct Known Subclasses:
CookedModuleDefinition

public class DefaultModuleDefinition
extends Object
implements ModuleDefinition

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
protected  List<URI> classPath
           
protected  List<ModuleDependency> dependencies
           
protected  Attributes mainAttributes
          Main attributes section of the manifest.
 
Constructor Summary
DefaultModuleDefinition(File location)
          TO DO need to support a URI constructor
DefaultModuleDefinition(File location, Attributes attr)
           
 
Method Summary
protected  String decorateClassPath(String classpathElement)
          Extension point to manipulate the classpath element before it's parsed.
 ModuleDependency[] getDependencies()
          Returns the list of module dependencies
 String getImportPolicyClassName()
          Returns the class name implementing the ImportPolicy interface for this module or null if there is no such implementation
 String getLifecyclePolicyClassName()
          Returns the class name implementing the LifecyclePolicy interface for this module or null if there is no such implementation
 URI[] getLocations()
          Returns the list of URI locations forming the classpath for this module.
 Manifest getManifest()
          Returns the manifest file from the module's implementation jar file
 ModuleMetadata getMetadata()
          Gets the metadata that describes various components and services in this module.
 String getName()
          Returns the name of the module
 String[] getPublicInterfaces()
          Returns the list of classes and packages that have been designated as public interfaces of this module.
 String getVersion()
          Returns the module's version
protected  void parseAttributes(Attributes attr)
          Extensibility point to parse more information from Manifest attributes.
protected  void parseClassPath(Attributes attr, URI baseURI)
          Parses from manifest attributes and updates URI list.
 String toString()
          Assists debugging.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

dependencies

protected final List<ModuleDependency> dependencies

classPath

protected final List<URI> classPath

mainAttributes

protected final Attributes mainAttributes
Main attributes section of the manifest. Always non-null.

Constructor Detail

DefaultModuleDefinition

public DefaultModuleDefinition(File location)
                        throws IOException
TO DO need to support a URI constructor

Throws:
IOException

DefaultModuleDefinition

public DefaultModuleDefinition(File location,
                               Attributes attr)
                        throws IOException
Throws:
IOException
Method Detail

parseClassPath

protected void parseClassPath(Attributes attr,
                              URI baseURI)
                       throws IOException
Parses from manifest attributes and updates URI list.

Throws:
IOException

decorateClassPath

protected String decorateClassPath(String classpathElement)
Extension point to manipulate the classpath element before it's parsed.

See Also:
parseClassPath(Attributes,URI)

parseAttributes

protected void parseAttributes(Attributes attr)
Extensibility point to parse more information from Manifest attributes.

Parameters:
attr - Main attributes of the manifest. Always non-null.

getName

public String getName()
Returns the name of the module

Specified by:
getName in interface ModuleDefinition
Returns:
the name

getPublicInterfaces

public String[] getPublicInterfaces()
Returns the list of classes and packages that have been designated as public interfaces of this module.

Specified by:
getPublicInterfaces in interface ModuleDefinition
Returns:
the list of public packages or classes

getDependencies

public ModuleDependency[] getDependencies()
Returns the list of module dependencies

Specified by:
getDependencies in interface ModuleDefinition
Returns:
the ModuleDependency

getLocations

public URI[] getLocations()
Returns the list of URI locations forming the classpath for this module.

Specified by:
getLocations in interface ModuleDefinition
Returns:
the list of URI locations for this module

getVersion

public String getVersion()
Returns the module's version

Specified by:
getVersion in interface ModuleDefinition
Returns:
the module's version

getImportPolicyClassName

public String getImportPolicyClassName()
Returns the class name implementing the ImportPolicy interface for this module or null if there is no such implementation

Specified by:
getImportPolicyClassName in interface ModuleDefinition
Returns:
the ImportPolicy implementation class name

getLifecyclePolicyClassName

public String getLifecyclePolicyClassName()
Returns the class name implementing the LifecyclePolicy interface for this module or null if there is no such implementation

Specified by:
getLifecyclePolicyClassName in interface ModuleDefinition
Returns:
the LifecyclePolicy implementation class name

getManifest

public Manifest getManifest()
Returns the manifest file from the module's implementation jar file

Specified by:
getManifest in interface ModuleDefinition
Returns:
never null.

getMetadata

public ModuleMetadata getMetadata()
Description copied from interface: ModuleDefinition
Gets the metadata that describes various components and services in this module.

Specified by:
getMetadata in interface ModuleDefinition
Returns:
Always non-null.

toString

public String toString()
Assists debugging.

Overrides:
toString in class Object


Copyright © 2013 Oracle Corporation. All Rights Reserved.