Interface ContextClassLoaderFactory
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. However, some limited environment is also available so implementations can have access to Accumulo's own system configuration.
- Since:
- 2.1.0
-
Method Summary
Modifier and TypeMethodDescriptiongetClassLoader
(String contextName) Get the class loader for the given contextName.default void
Pass the service environment to allow for additional class loader configuration
-
Method Details
-
init
Pass the service environment to allow for additional class loader configuration- Parameters:
env
- the class loader environment
-
getClassLoader
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. Currently, Accumulo will only call this method for non-null and non-empty context. For empty or null context, Accumulo will use the system classloader without consulting this plugin.- Returns:
- the class loader for the given contextName
-