Package com.sun.enterprise.module.single
Class ProxyModuleDefinition
- java.lang.Object
-
- com.sun.enterprise.module.single.ProxyModuleDefinition
-
- All Implemented Interfaces:
ModuleDefinition
public class ProxyModuleDefinition extends java.lang.Object implements ModuleDefinition
Creates a ModuleDefinition backed up by a a single classloader. The implementation does not cache any data - everything is recalculated for each call. Callers are therefore encouraged to either supply their own caching, or minimize the calls to methods of this class.
-
-
Field Summary
Fields Modifier and Type Field Description private java.lang.ClassLoaderclassLoaderprivate java.util.List<ManifestProxy.SeparatorMappings>mappings
-
Constructor Summary
Constructors Constructor Description ProxyModuleDefinition(java.lang.ClassLoader classLoader)ProxyModuleDefinition(java.lang.ClassLoader classLoader, java.util.List<ManifestProxy.SeparatorMappings> mappings)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected java.util.jar.Manifestgenerate(ModuleMetadata metadata)ModuleDependency[]getDependencies()Returns the list of this module's dependencies.java.lang.StringgetImportPolicyClassName()Returns the import policy class name.java.lang.StringgetLifecyclePolicyClassName()Returns the lifecycle policy class name.java.net.URI[]getLocations()A Module is implemented by one to many jar files.java.util.jar.ManifestgetManifest()Returns the manifest file for the main module jar fileModuleMetadatagetMetadata()Gets the metadata that describes various components and services in this module.java.lang.StringgetName()Returns the module name, usually this is the same name as the jar file name containing the module's implementation.java.lang.String[]getPublicInterfaces()Returns a list of public interfaces for this module.java.lang.StringgetVersion()Returns the version of this module's implementationprivate static booleanok(java.lang.String s)private static booleanok(java.lang.String[] ss)private static byte[]readFully(java.net.URL url)
-
-
-
Field Detail
-
classLoader
private final java.lang.ClassLoader classLoader
-
mappings
private final java.util.List<ManifestProxy.SeparatorMappings> mappings
-
-
Constructor Detail
-
ProxyModuleDefinition
public ProxyModuleDefinition(java.lang.ClassLoader classLoader) throws java.io.IOException- Throws:
java.io.IOException
-
ProxyModuleDefinition
public ProxyModuleDefinition(java.lang.ClassLoader classLoader, java.util.List<ManifestProxy.SeparatorMappings> mappings) throws java.io.IOException- Throws:
java.io.IOException
-
-
Method Detail
-
readFully
private static byte[] readFully(java.net.URL url) throws java.io.IOException- Throws:
java.io.IOException
-
getName
public java.lang.String getName()
Description copied from interface:ModuleDefinitionReturns the module name, usually this is the same name as the jar file name containing the module's implementation.- Specified by:
getNamein interfaceModuleDefinition- Returns:
- module name
-
getPublicInterfaces
public java.lang.String[] getPublicInterfaces()
Description copied from interface:ModuleDefinitionReturns a list of public interfaces for this module. Public interface can be packages, interfaces, or classes- Specified by:
getPublicInterfacesin interfaceModuleDefinition- Returns:
- a array of public interfaces
-
getDependencies
public ModuleDependency[] getDependencies()
Description copied from interface:ModuleDefinitionReturns the list of this module's dependencies. Each dependency must be satisfied at run time for this module to function properly.- Specified by:
getDependenciesin interfaceModuleDefinition- Returns:
- list of dependencies
-
getLocations
public java.net.URI[] getLocations()
Description copied from interface:ModuleDefinitionA Module is implemented by one to many jar files. This method returns the list of jar files implementing the module- Specified by:
getLocationsin interfaceModuleDefinition- Returns:
- the module's list of implementation jars
-
getVersion
public java.lang.String getVersion()
Description copied from interface:ModuleDefinitionReturns the version of this module's implementation- Specified by:
getVersionin interfaceModuleDefinition- Returns:
- a version number
-
getImportPolicyClassName
public java.lang.String getImportPolicyClassName()
Description copied from interface:ModuleDefinitionReturns the import policy class name. Although the implementation of this policy does not necessary have to implement the ImportPolicy, but could use another interface, it is the responsibility of the associated Repository to invoke that interface when the module is started.- Specified by:
getImportPolicyClassNamein interfaceModuleDefinition- Returns:
- Fully qualified class name that's assignable to
ImportPolicy, or null if no import policy exists.
-
getLifecyclePolicyClassName
public java.lang.String getLifecyclePolicyClassName()
Description copied from interface:ModuleDefinitionReturns the lifecycle policy class name. Although the implementation of this policy does not necessary have to implement the LifecyclePolicy, but could use another interface, it is the responsibility of the associated Repository to invoke that interface when the module is started.- Specified by:
getLifecyclePolicyClassNamein interfaceModuleDefinition- Returns:
- Fully qualified class name that's assignable to
LifecyclePolicy, or null if no import policy exists.
-
getManifest
public java.util.jar.Manifest getManifest()
Description copied from interface:ModuleDefinitionReturns the manifest file for the main module jar file- Specified by:
getManifestin interfaceModuleDefinition- Returns:
- the manifest file
-
getMetadata
public ModuleMetadata getMetadata()
Description copied from interface:ModuleDefinitionGets the metadata that describes various components and services in this module.- Specified by:
getMetadatain interfaceModuleDefinition- Returns:
- Always non-null.
-
generate
protected java.util.jar.Manifest generate(ModuleMetadata metadata)
-
ok
private static boolean ok(java.lang.String s)
-
ok
private static boolean ok(java.lang.String[] ss)
-
-