Class ThreadRenamingRunnable

    • Constructor Detail

      • ThreadRenamingRunnable

        public ThreadRenamingRunnable​(Runnable runnable,
                                      String proposedThreadName,
                                      ThreadNameDeterminer determiner)
        Creates a new instance which wraps the specified runnable and changes the thread name to the specified thread name when the specified runnable is running.
      • ThreadRenamingRunnable

        public ThreadRenamingRunnable​(Runnable runnable,
                                      String proposedThreadName)
    • Method Detail

      • setThreadNameDeterminer

        public static void setThreadNameDeterminer​(ThreadNameDeterminer threadNameDeterminer)
        Sets the ThreadNameDeterminer which overrides the proposed new thread name. Please note that the specified ThreadNameDeterminer affects only new ThreadRenamingRunnables; the existing instances are not affected at all. Therefore, you should make sure to call this method at the earliest possible point (i.e. before any Netty worker thread starts) for consistent thread naming. Otherwise, you might see the default thread names and the new names appear at the same time in the full thread dump.
      • run

        public void run()
        Specified by:
        run in interface Runnable