Interface ClassCodeBaseHandler

All Known Implementing Classes:
OSGIListener.ClassCodeBaseHandlerImpl

public interface ClassCodeBaseHandler
  • Method Summary

    Modifier and Type
    Method
    Description
    Returns some sort of codebase for the given class, or null.
    loadClass(String codebase, String className)
    load a class given the classname and a codebase.
  • Method Details

    • getCodeBase

      String getCodeBase(Class<?> cls)
      Returns some sort of codebase for the given class, or null. It is expected that, if str is the result of getCodeBase( cls ), then loadClass( str, cls.getClassName() ) will return cls.
      Parameters:
      cls - Class for which we need a codebase
      Returns:
      A codebase to use with this handler, or null if this handler does not apply to this class.
    • loadClass

      Class<?> loadClass(String codebase, String className)
      load a class given the classname and a codebase. The className will always satisfy cls.getClassName().equals( className ) if the call succeeds and returns a Class.
      Parameters:
      codebase - A string that somehow describes which ClassLoader to use. For example, the string could be an ordinary URL that a URL ClassLoader can use, or something more specialized, such as a description of an OSGi bundles and version.
      className - The name of the class to load
      Returns:
      The loaded class, or null if the class could not be loaded.