Class CategorizedThreadFactory

  • All Implemented Interfaces:
    ThreadFactory

    public class CategorizedThreadFactory
    extends Object
    implements ThreadFactory
    A ThreadFactory that adds LittleProxy-specific information to the threads' names.
    • Field Detail

      • log

        private static final org.slf4j.Logger log
      • name

        private final String name
      • category

        private final String category
      • uniqueServerGroupId

        private final int uniqueServerGroupId
      • UNCAUGHT_EXCEPTION_HANDLER

        private static final Thread.UncaughtExceptionHandler UNCAUGHT_EXCEPTION_HANDLER
        Exception handler for proxy threads. Logs the name of the thread and the exception that was caught.
    • Constructor Detail

      • CategorizedThreadFactory

        public CategorizedThreadFactory​(String name,
                                        String category,
                                        int uniqueServerGroupId)
        Parameters:
        name - the user-supplied name of this proxy
        category - the type of threads this factory is creating (acceptor, client-to-proxy worker, proxy-to-server worker)
        uniqueServerGroupId - a unique number for the server group creating this thread factory, to differentiate multiple proxy instances with the same name