Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.jboss.classloading.plugins
Class AbstractClassLoadingDomain

    java.lang.Object
      org.jboss.util.JBossObject
          org.jboss.classloading.plugins.AbstractClassLoadingDomain

All Implemented Interfaces:
  ClassLoadingDomain, Cloneable, org.jboss.util.JBossInterface, KernelRegistryPlugin

public class AbstractClassLoadingDomain
extends org.jboss.util.JBossObject
implements ClassLoadingDomain, KernelRegistryPlugin

An abstract classloading domain.

Version:
  $Revision: 1.8 $
Author:
  Adrian Brock

Field Summary
`protected Map` | `cachedClasses` The cached classes
`protected Map` | `cachedResources` The cached resources
`protected Map` | `failedClasses` The failed classloading attempts
`protected Set` | `failedResources` The failed resource attempts
`protected boolean` | `java2ClassLoadingCompliance` Whether java2 classloading compliance is supported
`protected ClassLoadingDomain` | `parent` The parent classloading domain
`protected Map` | `pkgToCLs` The classloaders by package name
`protected static AbstractClassLoadingDomain` | `root`

Fields inherited from class org.jboss.util.JBossObject
`hashCode, log, toString`

Constructor Summary
`AbstractClassLoadingDomain()` Create a new AbstractClassLoadingDomain.
`AbstractClassLoadingDomain(boolean java2ClassLoadingCompliance)` Create a new AbstractClassLoadingDomain.
`AbstractClassLoadingDomain(boolean java2ClassLoadingCompliance, ClassLoadingDomain parent)` Create a new AbstractClassLoadingDomain.
`AbstractClassLoadingDomain(ClassLoadingDomain parent)` Create a new AbstractClassLoadingDomain.

Method Summary
`void` | `addDomainClassLoader(DomainClassLoader cl)` Add a domain classloader
`protected void` | `checkLoadClassFailed(boolean trace, String name, boolean resolve, DomainClassLoader classLoader)` Check whether the request has already failed
`protected boolean` | `checkLoadResourceFailed(boolean trace, String name, DomainClassLoader classLoader)` Check whether the request has already failed
`void` | `flushCache()` Flush the cache
`void` | `flushFailures()` Flush the failures
`KernelRegistryEntry` | `getEntry(Object name)` Get a registration
`boolean` | `getJava2ClassLoadingCompliance()` Whether we implement java2 classloading compliance
`ClassLoadingDomain` | `getParent()` Get the parent classloading domain
`Class` | `loadClass(String name, boolean resolve, DomainClassLoader classLoader)` Load a class from this domain
`protected void` | `loadClassFailed(boolean trace, String name, boolean resolve, DomainClassLoader classLoader)` Fail this classloading attempt
`protected Class` | `loadClassFromCache(boolean trace, String name, boolean resolve, DomainClassLoader classLoader)` Load a class from the cache
`protected Class` | `loadClassFromClassLoaders(boolean trace, String name, boolean resolve, DomainClassLoader classLoader)` Load a class from the classloaders
`protected Class` | `loadClassFromParent(boolean trace, String name, boolean resolve, DomainClassLoader classLoader)` Load a class from the parent
`URL` | `loadResource(String name, DomainClassLoader classLoader)` Get a resource
`protected void` | `loadResourceFailed(boolean trace, String name, DomainClassLoader classLoader)` Fail this resource attempt
`protected URL` | `loadResourceFromCache(boolean trace, String name, DomainClassLoader classLoader)` Load a resource from the cache
`protected URL` | `loadResourceFromClassLoader(boolean trace, String name, DomainClassLoader classLoader)` Load a resource from the specified classloader
`protected URL` | `loadResourceFromClassLoaders(boolean trace, String name, DomainClassLoader classLoader)` Load a resource from the classloaders
`protected URL` | `loadResourceFromParent(boolean trace, String name, DomainClassLoader classLoader)` Load a resource from the parent
`void` | `removeDomainClassLoader(DomainClassLoader cl)` Remove a domain classloader
`void` | `toShortString(org.jboss.util.JBossStringBuilder buffer)`
`protected void` | `toString(org.jboss.util.JBossStringBuilder buffer)`

Methods inherited from class org.jboss.util.JBossObject
`cacheGetHashCode, cacheToString, clone, equals, flushJBossObjectCache, getClassShortName, getHashCode, hashCode, list, notEqual, toShortString, toString, toStringImplementation`

Methods inherited from class java.lang.Object
`equals, finalize, getClass, notify, notifyAll, wait, wait, wait`

Methods inherited from interface org.jboss.util.JBossInterface
`clone, toShortString`

Field Detail

### java2ClassLoadingCompliance

    protected boolean java2ClassLoadingCompliance

  Whether java2 classloading compliance is supported

### parent

    protected ClassLoadingDomain parent

  The parent classloading domain

### pkgToCLs

    protected Map pkgToCLs

  The classloaders by package name

### cachedClasses

    protected Map cachedClasses

  The cached classes

### failedClasses

    protected Map failedClasses

  The failed classloading attempts

### cachedResources

    protected Map cachedResources

  The cached resources

### failedResources

    protected Set failedResources

  The failed resource attempts

### root

    protected static AbstractClassLoadingDomain root

Constructor Detail

### AbstractClassLoadingDomain

    public AbstractClassLoadingDomain()

  Create a new AbstractClassLoadingDomain.

### AbstractClassLoadingDomain

    public AbstractClassLoadingDomain(boolean java2ClassLoadingCompliance)

  Create a new AbstractClassLoadingDomain.

Parameters:
  `java2ClassLoadingCompliance` - whether java2 classloading complaince is enabled

### AbstractClassLoadingDomain

    public AbstractClassLoadingDomain(ClassLoadingDomain parent)

  Create a new AbstractClassLoadingDomain.

Parameters:
  `parent` - the parent domain

### AbstractClassLoadingDomain

    public AbstractClassLoadingDomain(boolean java2ClassLoadingCompliance,
                                      ClassLoadingDomain parent)

  Create a new AbstractClassLoadingDomain.

Parameters:
  `java2ClassLoadingCompliance` - whether java2 classloading complaince is enabled
  `parent` - the parent domain

Method Detail

### addDomainClassLoader

    public void addDomainClassLoader(DomainClassLoader cl)

  Add a domain classloader

  Parameters:
    `cl` - the classloader to add

### removeDomainClassLoader

    public void removeDomainClassLoader(DomainClassLoader cl)

  Remove a domain classloader

  Parameters:
    `cl` - the classloader to remove

### flushCache

    public void flushCache()

  Flush the cache

### flushFailures

    public void flushFailures()

  Flush the failures

### getEntry

    public KernelRegistryEntry getEntry(Object name)

  Description copied from interface: `KernelRegistryPlugin`
  Get a registration

  Specified by:
    `getEntry` in interface `KernelRegistryPlugin`
  Parameters:
    `name` - the name of the object
  Returns:
    the registration

### getJava2ClassLoadingCompliance

    public boolean getJava2ClassLoadingCompliance()

  Description copied from interface: `ClassLoadingDomain`
  Whether we implement java2 classloading compliance

  Specified by:
    `getJava2ClassLoadingCompliance` in interface `ClassLoadingDomain`
  Returns:
    true when delegate first to parent

### getParent

    public ClassLoadingDomain getParent()

  Description copied from interface: `ClassLoadingDomain`
  Get the parent classloading domain

  Specified by:
    `getParent` in interface `ClassLoadingDomain`
  Returns:
    the parent or null if there isn't one

### loadClass

    public Class loadClass(String name,
                           boolean resolve,
                           DomainClassLoader classLoader)
                    throws ClassNotFoundException

  Description copied from interface: `ClassLoadingDomain`
  Load a class from this domain

  Specified by:
    `loadClass` in interface `ClassLoadingDomain`
  Parameters:
    `name` - the class to load
    `resolve` - whether to resolve the class
    `classLoader` - the requesting classloader
  Returns:
    the class
  Throws:
    `ClassNotFoundException` - when the class is not found

### loadResource

    public URL loadResource(String name,
                            DomainClassLoader classLoader)

  Description copied from interface: `ClassLoadingDomain`
  Get a resource

  Specified by:
    `loadResource` in interface `ClassLoadingDomain`
  Parameters:
    `name` - the resource name
    `classLoader` - the requesting classloader
  Returns:
    the resource or null if not found

### toString

    protected void toString(org.jboss.util.JBossStringBuilder buffer)

### toShortString

    public void toShortString(org.jboss.util.JBossStringBuilder buffer)

  Specified by:
    `toShortString` in interface `org.jboss.util.JBossInterface`

### loadClassFromParent

    protected Class loadClassFromParent(boolean trace,
                                        String name,
                                        boolean resolve,
                                        DomainClassLoader classLoader)

  Load a class from the parent

  Parameters:
    `trace` - whether trace is enabled
    `name` - the name of the class
    `resolve` - whether the class should be resolved
    `classLoader` - the classloader initiating the request
  Returns:
    the class or null if not found

### loadClassFromClassLoaders

    protected Class loadClassFromClassLoaders(boolean trace,
                                              String name,
                                              boolean resolve,
                                              DomainClassLoader classLoader)

  Load a class from the classloaders

  Parameters:
    `trace` - whether trace is enabled
    `name` - the name of the class
    `resolve` - whether the class should be resolved
    `classLoader` - the classloader initiating the request
  Returns:
    the class or null if not found

### loadClassFromCache

    protected Class loadClassFromCache(boolean trace,
                                       String name,
                                       boolean resolve,
                                       DomainClassLoader classLoader)

  Load a class from the cache

  Parameters:
    `trace` - whether trace is enabled
    `name` - the name of the class
    `resolve` - whether the class should be resolved
    `classLoader` - the classloader initiating the request
  Returns:
    the class or null if not found

### checkLoadClassFailed

    protected void checkLoadClassFailed(boolean trace,
                                        String name,
                                        boolean resolve,
                                        DomainClassLoader classLoader)
                                 throws ClassNotFoundException

  Check whether the request has already failed

  Parameters:
    `trace` - whether trace is enabled
    `name` - the name of the class
    `resolve` - whether the class should be resolved
    `classLoader` - the classloader initiating the request
  Throws:
    `ClassNotFoundException` - when already failed

### loadClassFailed

    protected void loadClassFailed(boolean trace,
                                   String name,
                                   boolean resolve,
                                   DomainClassLoader classLoader)
                            throws ClassNotFoundException

  Fail this classloading attempt

  Parameters:
    `trace` - whether trace is enabled
    `name` - the name of the class
    `resolve` - whether the class should be resolved
    `classLoader` - the classloader initiating the request
  Throws:
    `ClassNotFoundException` - always

### loadResourceFromParent

    protected URL loadResourceFromParent(boolean trace,
                                         String name,
                                         DomainClassLoader classLoader)

  Load a resource from the parent

  Parameters:
    `trace` - whether trace is enabled
    `name` - the name of the class
    `classLoader` - the classloader initiating the request
  Returns:
    the resource or null if not found

### loadResourceFromClassLoader

    protected URL loadResourceFromClassLoader(boolean trace,
                                              String name,
                                              DomainClassLoader classLoader)

  Load a resource from the specified classloader

  Parameters:
    `trace` - whether trace is enabled
    `name` - the name of the class
    `classLoader` - the classloader initiating the request
  Returns:
    the resource or null if not found

### loadResourceFromClassLoaders

    protected URL loadResourceFromClassLoaders(boolean trace,
                                               String name,
                                               DomainClassLoader classLoader)

  Load a resource from the classloaders

  Parameters:
    `trace` - whether trace is enabled
    `name` - the name of the class
    `classLoader` - the classloader initiating the request
  Returns:
    the resource or null if not found

### loadResourceFromCache

    protected URL loadResourceFromCache(boolean trace,
                                        String name,
                                        DomainClassLoader classLoader)

  Load a resource from the cache

  Parameters:
    `trace` - whether trace is enabled
    `name` - the name of the class
    `classLoader` - the classloader initiating the request
  Returns:
    the resource or null if not found

### checkLoadResourceFailed

    protected boolean checkLoadResourceFailed(boolean trace,
                                              String name,
                                              DomainClassLoader classLoader)

  Check whether the request has already failed

  Parameters:
    `trace` - whether trace is enabled
    `name` - the name of the class
    `classLoader` - the classloader initiating the request
  Returns:
    the true when it has already failed

### loadResourceFailed

    protected void loadResourceFailed(boolean trace,
                                      String name,
                                      DomainClassLoader classLoader)

  Fail this resource attempt

  Parameters:
    `trace` - whether trace is enabled
    `name` - the name of the class
    `classLoader` - the classloader initiating the request

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2004 JBoss Inc. All Rights Reserved.