Interface ContextProducer

  • All Known Subinterfaces:
    JavaEEContextUtil
    All Known Implementing Classes:
    JavaEEContextUtilImpl

    public interface ContextProducer
    Utility to create / push Jakarta EE and CDI thread contexts Example:
    Author:
    lprimak
    • Method Detail

      • empty

        ContextProducer.Instance empty()
        Creates an empty instance, i.e. if the empty context is pushed on top of another context, the other context will be 'suppressed' for the duration of this context
        Returns:
        new empty instance
      • getInvocationClassLoader

        ClassLoader getInvocationClassLoader()
        Returns:
        Class Loader that's associated with current invocation or null if there is no current invocation
      • getInvocationComponentId

        String getInvocationComponentId()
        Returns:
        component ID for the current invocation or null
      • isInvocationLoaded

        boolean isInvocationLoaded()
        This is different from class loaded, as there are some situations where class is loaded but initialization is not complete, such as CDI initializations, extensions start, etc.
        Returns:
        true if current invocation exists and is loaded / ready
      • moduleMatches

        boolean moduleMatches​(ModuleInfo moduleInfo,
                              String appOrComponentId)
        Checks if the supplied module matches the component / application ID Works for both EAR application IDs or other module (WAR, JAR) IDs
        Parameters:
        moduleInfo -
        appOrComponentId -
        Returns:
        true if matches