Interface ContextClassLoaderFactory

  • All Known Implementing Classes:
    DefaultContextClassLoaderFactory

    public interface ContextClassLoaderFactory
    The ContextClassLoaderFactory provides a mechanism for various Accumulo components to use a custom ClassLoader for specific contexts, such as loading table iterators. This factory is initialized at startup and supplies ClassLoaders when provided a context.

    This factory can be configured using the general.context.class.loader.factory property. All implementations of this factory must have a default (no-argument) public constructor.

    A default implementation is provided for Accumulo 2.x to retain existing context class loader behavior based on per-table configuration. However, after Accumulo 2.x, the default is expected to change to a simpler implementation, and users will need to provide their own implementation to support advanced context class loading features. Some implementations may be maintained by the Accumulo developers in a separate package. Check the Accumulo website or contact the developers for more details on the status of these implementations.

    Because this factory is expected to be instantiated early in the application startup process, configuration is expected to be provided within the environment (such as in Java system properties or process environment variables), and is implementation-specific.

    Since:
    2.1.0
    • Method Detail

      • getClassLoader

        ClassLoader getClassLoader​(String contextName)
        Get the class loader for the given contextName. Callers should not cache the ClassLoader result as it may change if/when the ClassLoader reloads. Implementations should throw a RuntimeException of some type (such as IllegalArgumentException) if the provided contextName is not supported or fails to be constructed.
        Parameters:
        contextName - the name of the context that represents a class loader that is managed by this factory (can be null)
        Returns:
        the class loader for the given contextName