protected ThreadFactory getThreadFactory() {
        return new ThreadFactory() {
            private final ThreadFactory parent = Executors.defaultThreadFactory();
            private final AtomicInteger tid = new AtomicInteger(1);

            @Override
            public Thread newThread(final Runnable task) {
              final Thread t = parent.newThread(task);
              t.setName(THREAD_PREFIX + tid.getAndIncrement());
              return t;
            }
          };
    }
protected ThreadFactory getThreadFactory ( ) { return new ThreadFactory ( ) { private final ThreadFactory parent = Executors . defaultThreadFactory ( ) ; private final AtomicInteger tid = new AtomicInteger ( 1 ) ; @ Override public Thread newThread ( final Runnable task ) { final Thread t = parent . newThread ( task ) ; t . setName ( THREAD_PREFIX + tid . getAndIncrement ( ) ) ; return t ; } } ; }
Returns a factory for creating worker threads for the receiving queue.
Overwrite when you have special requirements, e.g. security constraints

@return ThreadFactory