class IgniteThreadFactory implements ThreadFactory {
    /** Ignite instance name. */
    private final String igniteInstanceName;

    /** Thread name. */
    private final String threadName;

    /** Index generator for threads. */
    private final AtomicInteger idxGen = new AtomicInteger();

    /** */
    private final byte plc;

    /** Exception handler. */
    private final UncaughtExceptionHandler eHnd;

    /**
     * Constructs new thread factory for given grid. All threads will belong
     * to the same default thread group.
     *
     * @param igniteInstanceName Ignite instance name.
     * @param threadName Thread name.
     */
    public IgniteThreadFactory(String igniteInstanceName, String threadName) {
        this(igniteInstanceName, threadName, null);
    }

    /**
     * Constructs new thread factory for given grid. All threads will belong
     * to the same default thread group.
     *
     * @param igniteInstanceName Ignite instance name.
     * @param threadName Thread name.
     * @param eHnd Uncaught exception handler.
     */
    public IgniteThreadFactory(String igniteInstanceName, String threadName, UncaughtExceptionHandler eHnd) {
        this(igniteInstanceName, threadName, GridIoPolicy.UNDEFINED, eHnd);
    }

    /**
     * Constructs new thread factory for given grid. All threads will belong
     * to the same default thread group.
     *
     * @param igniteInstanceName Ignite instance name.
     * @param threadName Thread name.
     * @param plc {@link GridIoPolicy} for thread pool.
     * @param eHnd Uncaught exception handler.
     */
    public IgniteThreadFactory(String igniteInstanceName, String threadName, byte plc, UncaughtExceptionHandler eHnd) {
        this.igniteInstanceName = igniteInstanceName;
        this.threadName = threadName;
        this.plc = plc;
        this.eHnd = eHnd;
    }

    /** {@inheritDoc} */
    @Override public Thread newThread(@NotNull Runnable r) {<FILL_FUNCTION_BODY>}

    /** {@inheritDoc} */
    @Override public String toString() {
        return S.toString(IgniteThreadFactory.class, this, super.toString());
    }
}

        Thread thread = new IgniteThread(igniteInstanceName, threadName, r, idxGen.incrementAndGet(), -1, plc);

        if (eHnd != null)
            thread.setUncaughtExceptionHandler(eHnd);

        return thread;
    
<no_super_class>