|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jboss.classloading.spi.helpers.NameAndVersionSupport
org.jboss.classloading.spi.dependency.Module
public abstract class Module
Module.
Constructor Summary | |
---|---|
Module(String name)
Create a new Module with the default version |
|
Module(String name,
Object version)
Create a new Module with the given version |
|
Module(String name,
String contextName,
Object version)
Create a new Module with the given version |
Method Summary | |
---|---|
protected void |
addDelegates(Module module,
List<DelegateLoader> delegates,
List<DelegateLoader> dynamic,
Set<Module> visited,
boolean reExport)
Add delegates |
protected void |
addIDependOn(RequirementDependencyItem item)
Add a dependency |
protected void |
createDependencies()
Create the dependencies for the module |
abstract DelegateLoader |
createLazyDelegateLoader(Domain domain,
RequirementDependencyItem item)
Create a lazy delegate loader |
protected List<Capability> |
defaultCapabilities()
Determine the default capabilities. |
protected List<Capability> |
determineCapabilities()
Determine the capabilities |
List<String> |
determinePackageNames(boolean optional)
Determine the package names TODO JBCL-23 Better handling of conflicts for optional packages |
List<Requirement> |
determineRequirements()
Determine the requirements. |
boolean |
equals(Object obj)
|
List<Capability> |
getCapabilities()
Get the capabilities. |
protected ClassLoader |
getClassLoader()
Get the classloader for this module |
protected ClassLoader |
getClassLoaderForClass(String className)
Get the classloader for a class name |
org.jboss.dependency.spi.ControllerState |
getClassLoaderState()
Get the state for the classloader |
String |
getContextName()
Get the context name |
protected org.jboss.dependency.spi.ControllerContext |
getControllerContext()
Get the controller context. |
abstract DelegateLoader |
getDelegateLoader(Module requiringModule,
Requirement requirement)
Get the delegate loader |
List<? extends DelegateLoader> |
getDelegates()
Get the delegate loaders for this module |
String |
getDeterminedDomainName()
Get the determined domain name. |
String |
getDeterminedParentDomainName()
Get the determined parentDomain name. |
ParentPolicy |
getDeterminedParentPolicy()
|
String |
getDomainName()
Get the domain name. |
URL |
getDynamicClassRoot()
Return a URL where dynamic classes can be stored |
ClassFilter |
getExcluded()
Get a filter for the excluded packages |
ClassFilter |
getExcludedExport()
Get a filter for the excluded export packages |
ExportAll |
getExportAll()
Get the export all for the module |
ClassFilter |
getIncluded()
Get a filter for the included packages |
Module |
getModuleForClass(String className)
Find the module that loads a class |
String[] |
getPackageNames()
Get the package names |
String |
getParentDomainName()
Get the parent domain name. |
protected List<RequirementDependencyItem> |
getRequirementDependencyItems()
Get the dependency items |
List<Requirement> |
getRequirements()
Get the requirements. |
URL |
getResource(String resourceName)
Get a resource for this module |
Enumeration<URL> |
getResources(String resourceName)
Get resources for this module |
protected boolean |
isBlackListable()
Whether to cache misses |
protected boolean |
isCacheable()
Whether to cache |
boolean |
isImportAll()
Get the import all for the module |
boolean |
isJ2seClassLoadingCompliance()
Get delegate policy |
boolean |
isValid()
Whether this is a valid module |
Class<?> |
loadClass(String className)
Load a class for this module |
protected static void |
registerModuleClassLoader(Module module,
ClassLoader classLoader)
Register a classloader for a module |
void |
release()
Release the module |
protected void |
removeDependencies()
Remove dependencies |
protected void |
removeIDependOn(RequirementDependencyItem item)
Remove a dependency |
void |
reset()
Reset the module |
protected Module |
resolveModule(RequirementDependencyItem dependency,
boolean resolveSpace)
Resolve a requirement |
protected void |
setControllerContext(org.jboss.dependency.spi.ControllerContext context)
Set the controller context |
protected static void |
unregisterModuleClassLoader(Module module,
ClassLoader classLoader)
Register a classloader for a module |
void |
visit(ResourceVisitor visitor)
Visit the resources in this module using the filter defined on the visitor |
void |
visit(ResourceVisitor visitor,
ResourceFilter filter)
Visit the resources in this module using the given filter |
void |
visit(ResourceVisitor visitor,
ResourceFilter filter,
ResourceFilter recurseFilter,
URL... urls)
Visit the resources in this module using the given filter(s) Typically the filter is used to determine which types of files to visit, e.g. |
Methods inherited from class org.jboss.classloading.spi.helpers.NameAndVersionSupport |
---|
clone, getName, getTheVersion, getVersion, hashCode, setName, setTheVersion, setVersion, toString |
Methods inherited from class java.lang.Object |
---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public Module(String name)
name
- the name
IllegalArgumentException
- for a null parameterpublic Module(String name, Object version)
name
- the nameversion
- pass null for the default version
IllegalArgumentException
- for a null parameterpublic Module(String name, String contextName, Object version)
name
- the namecontextName
- the real name of the module in the controllerversion
- pass null for the default version
IllegalArgumentException
- for a null parameterMethod Detail |
---|
protected static void registerModuleClassLoader(Module module, ClassLoader classLoader)
module
- the moduleclassLoader
- the classloader
IllegalArgumentException
- for a null parameterprotected static void unregisterModuleClassLoader(Module module, ClassLoader classLoader)
module
- the moduleclassLoader
- the classloader
IllegalArgumentException
- for a null parameterpublic String getContextName()
public boolean isValid()
public String getDomainName()
public String getDeterminedDomainName()
public String getParentDomainName()
public String getDeterminedParentDomainName()
public ExportAll getExportAll()
public ClassFilter getIncluded()
public ClassFilter getExcluded()
public ClassFilter getExcludedExport()
public boolean isImportAll()
public boolean isJ2seClassLoadingCompliance()
public ParentPolicy getDeterminedParentPolicy()
protected boolean isCacheable()
protected boolean isBlackListable()
public Module getModuleForClass(String className) throws ClassNotFoundException
className
- the class name
ClassNotFoundException
- when the class is not found
IllegalStateException
- when the module is not associated with a classloaderprotected ClassLoader getClassLoaderForClass(String className) throws ClassNotFoundException
className
- the class name
ClassNotFoundException
- when the class is not found
IllegalStateException
- when the module is not associated with a classloaderpublic Class<?> loadClass(String className) throws ClassNotFoundException
className
- the class name
ClassNotFoundException
- when the class is not found
IllegalStateException
- when the module is not associated with a classloaderpublic URL getResource(String resourceName)
resourceName
- the resource name
IllegalStateException
- when the module is not associated with a classloaderpublic Enumeration<URL> getResources(String resourceName) throws IOException
resourceName
- the resource name
IOException
- for an error
IllegalStateException
- when the module is not associated with a classloaderprotected ClassLoader getClassLoader()
public void visit(ResourceVisitor visitor)
visitor
- the visitorpublic void visit(ResourceVisitor visitor, ResourceFilter filter)
visitor
- the visitorfilter
- the filterpublic void visit(ResourceVisitor visitor, ResourceFilter filter, ResourceFilter recurseFilter, URL... urls)
visitor
- the visitorfilter
- the filterrecurseFilter
- the recursion filter (null means recurse into everything)urls
- the urls we should visitpublic List<? extends DelegateLoader> getDelegates()
protected List<RequirementDependencyItem> getRequirementDependencyItems()
protected void addDelegates(Module module, List<DelegateLoader> delegates, List<DelegateLoader> dynamic, Set<Module> visited, boolean reExport)
module
- the module to add delegates fromdelegates
- the current list of delegatesdynamic
- the dynamic delegatesvisited
- the visited modulesreExport
- whether to only add re-exportspublic abstract DelegateLoader createLazyDelegateLoader(Domain domain, RequirementDependencyItem item)
domain
- the domainitem
- the dependency item
public abstract DelegateLoader getDelegateLoader(Module requiringModule, Requirement requirement)
requiringModule
- the requiring modulerequirement
- the requirement
public List<Capability> getCapabilities()
protected List<Capability> determineCapabilities()
protected List<Capability> defaultCapabilities()
By default it is just the module capability
public String[] getPackageNames()
public List<String> determinePackageNames(boolean optional)
optional
- whether to include optional packages
public org.jboss.dependency.spi.ControllerState getClassLoaderState()
public List<Requirement> getRequirements()
public List<Requirement> determineRequirements()
public URL getDynamicClassRoot()
protected void createDependencies()
protected void removeDependencies()
protected org.jboss.dependency.spi.ControllerContext getControllerContext()
protected void setControllerContext(org.jboss.dependency.spi.ControllerContext context)
context
- the contextprotected void addIDependOn(RequirementDependencyItem item)
item
- the dependency itemprotected void removeIDependOn(RequirementDependencyItem item)
item
- the dependency itemprotected Module resolveModule(RequirementDependencyItem dependency, boolean resolveSpace)
dependency
- the dependency the dependencyresolveSpace
- whether to resolve the module in the classloading space
public void release()
public void reset()
public boolean equals(Object obj)
equals
in class NameAndVersionSupport
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |