org.apache.ignite.spi

## Class IgniteSpiThread

- java.lang.Object
- - java.lang.Thread
  - - org.apache.ignite.spi.IgniteSpiThread

All Implemented Interfaces:
  Runnable

    public abstract class IgniteSpiThread
    extends Thread

This class provides convenient adapter for threads used by SPIs. This class adds necessary plumbing on top of the `Thread` class:

- Consistent naming of threads
- Dedicated parent thread group

### Nested Class Summary

### Nested classes/interfaces inherited from class java.lang.Thread

`Thread.State, Thread.UncaughtExceptionHandler`

### Field Summary

Fields
`static ThreadGroup` `DFLT_GRP` Default thread's group.

### Fields inherited from class java.lang.Thread

`MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY`

### Constructor Summary

Constructors
`protected` `IgniteSpiThread(String gridName, String name, IgniteLogger log)` Creates thread with given `name`.

### Method Summary

Methods
`protected abstract void` `body()` Body of SPI thread.
`protected void` `cleanup()` Should be overridden by child classes if cleanup logic is required.
`void` `run()`
`String` `toString()`

### Methods inherited from class java.lang.Thread

`activeCount, checkAccess, clone, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, yield`

### Methods inherited from class java.lang.Object

`equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

### Field Detail

#### DFLT_GRP

    public static final ThreadGroup DFLT_GRP

Default thread's group.

### Constructor Detail

#### IgniteSpiThread

    protected IgniteSpiThread(String gridName,
                   String name,
                   IgniteLogger log)

Creates thread with given `name`.

Parameters:
  `gridName` - Name of grid this thread is created in.
  `name` - Thread's name.
  `log` - Grid logger to use.

### Method Detail

#### run

    public final void run()

Specified by:
  `run` in interface `Runnable`
Overrides:
  `run` in class `Thread`

#### cleanup

    protected void cleanup()

Should be overridden by child classes if cleanup logic is required.

#### body

    protected abstract void body()
                          throws InterruptedException

Body of SPI thread.

Throws:
  `InterruptedException` - If thread got interrupted.

#### toString

    public String toString()

Overrides:
  `toString` in class `Thread`

2015 Copyright © Apache Software Foundation

Follow @ApacheIgnite

Ignite Fabric | : ver. 1.1.0-incubating
Release Date | : May 20 2015