GridGain™ 2.0.3
Java API Specification

org.gridgain.grid.spi
Class GridSpiThread

java.lang.Object
  extended by java.lang.Thread
      extended by org.gridgain.grid.spi.GridSpiThread
All Implemented Interfaces:
Runnable

public abstract class GridSpiThread
extends Thread

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





See Also:

  Documentation
  Email Support
  Online Forums
  Issue Tracking

Author:   2005-2008 Copyright © GridGain Systems. All Rights Reserved. ver. 2.0.3

 

Nested Class Summary
 
Nested classes/interfaces inherited from class java.lang.Thread
Thread.State, Thread.UncaughtExceptionHandler
 
Field Summary
static ThreadGroup DFLT_GRP
          Default thread's group.
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
protected GridSpiThread(String gridName, String name, GridLogger log)
          Creates thread with given name.
 
Method Summary
protected abstract  void body()
          Body of SPI thread.
protected  void cleanup()
          Should be overridden by child classes if cleanup logic is required.
 void interrupt()
          
 boolean isInterrupted()
          
 void run()
          
 String toString()
          
 
Methods inherited from class java.lang.Thread
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupted, isAlive, isDaemon, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, yield
 
Methods inherited from class java.lang.Object
clone, 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

GridSpiThread

protected GridSpiThread(String gridName,
                        String name,
                        GridLogger 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

isInterrupted

public boolean isInterrupted()

Overrides:
isInterrupted in class Thread

interrupt

public void interrupt()

Overrides:
interrupt in class Thread

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

GridGain™ 2.0.3
Java API Specification

GridGain™ - Grid Computing Made Simple, ver. 2.0.3.20052008
2005-2008 Copyright © GridGain Systems. All Rights Reserved.