Class ScopeHelper


  • @ThreadSafe
    public final class ScopeHelper
    extends Object
    Global scope utility methods that don't nicely fit somewhere else.
    Author:
    Philip Helger
    • Field Detail

      • DEFAULT_DEBUG_LIFE_CYCLE

        public static final boolean DEFAULT_DEBUG_LIFE_CYCLE
        See Also:
        Constant Field Values
      • DEFAULT_DEBUG_GLOBAL_SCOPE

        public static final boolean DEFAULT_DEBUG_GLOBAL_SCOPE
        See Also:
        Constant Field Values
      • DEFAULT_DEBUG_SESSION_SCOPE

        public static final boolean DEFAULT_DEBUG_SESSION_SCOPE
        See Also:
        Constant Field Values
      • DEFAULT_DEBUG_REQUEST_SCOPE

        public static final boolean DEFAULT_DEBUG_REQUEST_SCOPE
        See Also:
        Constant Field Values
      • DEFAULT_DEBUG_WITH_STACK_TRACE

        public static final boolean DEFAULT_DEBUG_WITH_STACK_TRACE
        See Also:
        Constant Field Values
    • Method Detail

      • setLifeCycleDebuggingEnabled

        public static void setLifeCycleDebuggingEnabled​(boolean bDebugLifeCycle)
        Enable or disable scope life cycle debugging for all scopes.
        Parameters:
        bDebugLifeCycle - true if the scope life cycle should be debugged, false to disable it. By default is is disabled.
      • isLifeCycleDebuggingEnabled

        public static boolean isLifeCycleDebuggingEnabled()
        Returns:
        true if life cycle debugging for all scopes is enabled, false if it is disabled. The default value is disabled.
      • setDebugGlobalScopeEnabled

        public static void setDebugGlobalScopeEnabled​(boolean bDebugScope)
        Enable or disable global scope life cycle debugging.
        Parameters:
        bDebugScope - true if the global scope life cycle should be debugged, false to disable it. By default is is disabled.
      • isDebugGlobalScopeEnabled

        public static boolean isDebugGlobalScopeEnabled()
        Returns:
        true if global scope life cycle debugging is enabled, false if it is disabled. The default value is disabled.
      • setDebugSessionScopeEnabled

        public static void setDebugSessionScopeEnabled​(boolean bDebugScope)
        Enable or disable session scope life cycle debugging.
        Parameters:
        bDebugScope - true if the session scope life cycle should be debugged, false to disable it. By default is is disabled.
      • isDebugSessionScopeEnabled

        public static boolean isDebugSessionScopeEnabled()
        Returns:
        true if session scope life cycle debugging is enabled, false if it is disabled. The default value is disabled.
      • setDebugRequestScopeEnabled

        public static void setDebugRequestScopeEnabled​(boolean bDebugScope)
        Enable or disable request scope life cycle debugging.
        Parameters:
        bDebugScope - true if the request scope life cycle should be debugged, false to disable it. By default is is disabled.
      • isDebugRequestScopeEnabled

        public static boolean isDebugRequestScopeEnabled()
        Returns:
        true if request scope life cycle debugging is enabled, false if it is disabled. The default value is disabled.
      • setDebugWithStackTrace

        public static void setDebugWithStackTrace​(boolean bDebugWithStackTrace)
        Enable or disable stack traces when debugging scopes.
        Parameters:
        bDebugWithStackTrace - true to enable stack traces, false to disable them. By default is is disabled.
      • isDebugWithStackTrace

        public static boolean isDebugWithStackTrace()
        Returns:
        true if stack traces should be logged, false if not. The default value is disabled.
      • isDebugGlobalScopeLifeCycle

        @Deprecated(forRemoval=true,
                    since="11.0.4")
        public static boolean isDebugGlobalScopeLifeCycle​(@Nonnull
                                                          org.slf4j.Logger aLogger)
        Deprecated, for removal: This API element is subject to removal in a future version.
        This is a just a helper method to determine whether global scope creation/deletion issues should be logged or not.
        Parameters:
        aLogger - The logger to check.
        Returns:
        true if global scope creation/deletion should be logged, false otherwise.
        Since:
        9.4.7
      • isDebugGlobalScopeLifeCycle

        public static boolean isDebugGlobalScopeLifeCycle()
        This is a just a helper method to determine whether global scope creation/deletion issues should be logged or not.
        Returns:
        true if global scope creation/deletion should be logged, false otherwise.
        Since:
        11.0.4
      • isDebugSessionScopeLifeCycle

        @Deprecated(forRemoval=true,
                    since="11.0.4")
        public static boolean isDebugSessionScopeLifeCycle​(@Nonnull
                                                           org.slf4j.Logger aLogger)
        Deprecated, for removal: This API element is subject to removal in a future version.
        This is a just a helper method to determine whether session scope creation/deletion issues should be logged or not.
        Parameters:
        aLogger - The logger to check.
        Returns:
        true if session scope creation/deletion should be logged, false otherwise.
        Since:
        9.4.7
      • isDebugSessionScopeLifeCycle

        public static boolean isDebugSessionScopeLifeCycle()
        This is a just a helper method to determine whether session scope creation/deletion issues should be logged or not.
        Returns:
        true if session scope creation/deletion should be logged, false otherwise.
        Since:
        11.0.4
      • isDebugRequestScopeLifeCycle

        @Deprecated(forRemoval=true,
                    since="11.0.4")
        public static boolean isDebugRequestScopeLifeCycle​(@Nonnull
                                                           org.slf4j.Logger aLogger)
        Deprecated, for removal: This API element is subject to removal in a future version.
        This is a just a helper method to determine whether request scope creation/deletion issues should be logged or not.
        Parameters:
        aLogger - The logger to check.
        Returns:
        true if request scope creation/deletion should be logged, false otherwise.
        Since:
        9.4.7
      • isDebugRequestScopeLifeCycle

        public static boolean isDebugRequestScopeLifeCycle()
        This is a just a helper method to determine whether request scope creation/deletion issues should be logged or not.
        Returns:
        true if request scope creation/deletion should be logged, false otherwise.
        Since:
        11.0.4