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

## org.jini.rio.boot
Class ServiceClassLoader

    java.lang.Object
      java.lang.ClassLoader
          java.security.SecureClassLoader
              java.net.URLClassLoader
                  edu.emory.mathcs.util.classloader.URIClassLoader
                      org.jini.rio.boot.ServiceClassLoader

All Implemented Interfaces:
  ClassAnnotation

    public class ServiceClassLoader

extends edu.emory.mathcs.util.classloader.URIClassLoader
implements ClassAnnotation

The ServiceClassLoader overrides getURLs(), ensuring all classes that need to be annotated with specific location(s) are returned appropriately

Constructor Summary
`ServiceClassLoader(URI[] searchPath, ClassAnnotator annotator, ClassLoader parent)` Constructs a new ServiceClassLoader for the specified URLs having the given parent.

Method Summary
`void` | `addURLs(URL[] urls)` Appends the specified URLs to the list of URLs to search for classes and resources.
`String` | `getClassAnnotation()` Get the class annotations as determined by the `ClassAnnotator`
`ClassAnnotator` | `getClassAnnotator()` Get the `ClassAnnotator` created at construction time
`URL[]` | `getSearchPath()` Get the search path of URLs for loading classes and resources
`static URI[]` | `getURIs(URL[] urls)` Convert a `URL[]` into a `URI[]`
`URL[]` | `getURLs()` Get the URLs to be used for class annotations as determined by the `ClassAnnotator`
`String` | `toString()` Returns a String representation of this class loader.

Methods inherited from class edu.emory.mathcs.util.classloader.URIClassLoader
`addURI, addURL, defineClass, findClass, findLibrary, findResource, findResources, getClassHandle, getJarHandler, getLibraryHandle, getResourceHandle, getResourceHandles`

Methods inherited from class java.net.URLClassLoader
`definePackage, getPermissions, newInstance, newInstance`

Methods inherited from class java.security.SecureClassLoader
`defineClass, defineClass`

Methods inherited from class java.lang.ClassLoader
`clearAssertionStatus, defineClass, defineClass, defineClass, defineClass, definePackage, findLoadedClass, findSystemClass, getPackage, getPackages, getParent, getResource, getResourceAsStream, getResources, getSystemClassLoader, getSystemResource, getSystemResourceAsStream, getSystemResources, loadClass, loadClass, resolveClass, setClassAssertionStatus, setDefaultAssertionStatus, setPackageAssertionStatus, setSigners`

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

Constructor Detail

### ServiceClassLoader

    public ServiceClassLoader(URI[] searchPath,
                              ClassAnnotator annotator,
                              ClassLoader parent)

  Constructs a new ServiceClassLoader for the specified URLs having the given parent. The constructor takes two sets of URLs. The first set is where the class loader loads classes from, the second set is what it returns when getURLs() is called.

  Parameters:
    `searchPath` - Array of URIs to search for classes
    `annotator` - Array of URLs to use for the codebase
    `parent` - Parent ClassLoader to delegate to

Method Detail

### getClassAnnotator

    public ClassAnnotator getClassAnnotator()

  Get the `ClassAnnotator` created at construction time

  Returns:
    The ClassAnnotator

### getURLs

    public URL[] getURLs()

  Get the URLs to be used for class annotations as determined by the `ClassAnnotator`

  Overrides:
    `getURLs` in class `edu.emory.mathcs.util.classloader.URIClassLoader`

### getSearchPath

    public URL[] getSearchPath()
                        throws MalformedURLException

  Get the search path of URLs for loading classes and resources

  Returns:
    The array of `URL[]` which corresponds to the search path for the class loader; that is, the array elements are the locations from which the class loader will load requested classes.
  Throws:
    `MalformedURLException` - If any of the URis cannot be transformed to URLs

### addURLs

    public void addURLs(URL[] urls)

  Appends the specified URLs to the list of URLs to search for classes and resources.

  Parameters:
    `urls` - The URLs to add

### getClassAnnotation

    public String getClassAnnotation()

  Get the class annotations as determined by the `ClassAnnotator`

  Specified by:
    `getClassAnnotation` in interface `ClassAnnotation`
  See Also:
    `ClassAnnotation.getClassAnnotation()`

### toString

    public String toString()

  Returns a String representation of this class loader.

  Overrides:
    `toString` in class `Object`

### getURIs

    public static URI[] getURIs(URL[] urls)
                         throws URISyntaxException

  Convert a `URL[]` into a `URI[]`

  Parameters:
    `urls` - Array of URLs to convert
  Returns:
    Converted array of URIs
  Throws:
    `URISyntaxException` - If there are errors converting the URLs to URIs

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

Copyright © Project Rio.