Interface SharingComponentClassLoader


  • public interface SharingComponentClassLoader
    This interface provides information on whether a class from an ExecutableComponent is shared between different invocations or not. This is especially useful for some Apache-frameworks that use static fields. Usually all invocations of an ExecutableComponent use an own classloader and therefore cannot share any information. This requires loading used frameworks every time. By sharing classes, information can be shared and also less loading is required. However, executable components may need to know whether classes are shared or not, for instance for shutting down frameworks. In case a framework is shared, it usually must not be shut down by an executable component.
    If no SharingComponentClassLoader is used, an executable component can assume it is shared.
    Author:
    Ulrich Kreher
    • Method Detail

      • isSharedClass

        boolean isSharedClass​(Class<?> cls)
        Gets whether the designated class is shared between different invocations of an ExecutableComponent. Unshared classes have own classloaders and therefore do not share static fields.
        Parameters:
        cls - The class which is either shared between different invocations of an ExecutableComponent or not.
        Returns:
        Whether the designated class is shared between different invocations of an ExecutableComponent.