Class NamedThreadFactory

    • Constructor Detail

      • NamedThreadFactory

        public NamedThreadFactory​(String namePrefix)
    • Method Detail

      • getThreadDump

        public String getThreadDump()
        Deprecated.
        Returns:
        complete thread dump
      • executeWithNewThreadName

        public static void executeWithNewThreadName​(@NotNull
                                                    String newDetails,
                                                    @NotNull
                                                    Runnable action)
        Inserts newDetails to the thread name and executes given action. Restores original thread name when action finishes.
        Parameters:
        newDetails - new details to set in thread name
        action - action to execute
        Since:
        7.1.4
      • executeWithNewThreadNameFuncThrow

        public static <T,​E extends Throwable> T executeWithNewThreadNameFuncThrow​(@NotNull
                                                                                        String newDetails,
                                                                                        @NotNull
                                                                                        FuncThrow<T,​E> function)
                                                                                 throws E extends Throwable
        Same as executeWithNewThreadName(String, Runnable) but for arbitrary thrown exception
        Parameters:
        newDetails - new details to set in thread name
        function - function to execute
        Throws:
        E extends Throwable
        Since:
        2017.1
      • patchThreadName

        @NotNull
        public static Disposable patchThreadName​(@NotNull
                                                 String newDetails)
        Parameters:
        newDetails - new details to add to thread name
        Returns:
        Disposable which should be disposed manually to return original thread name
        Since:
        8.1