org.indy
Class IndyThread

java.lang.Object
  |
  +--org.indy.IndyThread
All Implemented Interfaces:
java.lang.Runnable
Direct Known Subclasses:
ListenerThread, PeerThread

public abstract class IndyThread
extends java.lang.Object
implements java.lang.Runnable

Provides the basis for Indy threading as used by PeerThread in TCPServer.

Version:
1.0
Author:
OTG
See Also:
IndyThread.StopMode, IndyThread.Priority

Inner Class Summary
static class IndyThread.Priority
          Represents IndyThread priority.
static class IndyThread.StopMode
          An enumertaed class describing the possible stopping modes for an IndyThread.
 
Field Summary
protected  boolean stopRequested
          Description of the Field
protected  java.lang.Thread threadImpl
           
 
Constructor Summary
IndyThread()
          Constructor for the IdThread object
 
Method Summary
 void addThreadListener(IndyThreadListener l)
          Adds a feature to the ThreadListener attribute of the IdThread object
protected  void afterExecute()
          Description of the Method
protected  void afterRun()
          Description of the Method
protected  void beforeExecute()
          Description of the Method
protected  void beforeRun()
          Description of the Method
protected  void cleanup()
           
 IndyThread.Priority getPriority()
           
 IndyThread.StopMode getStopMode()
           
protected  java.lang.Thread getThreadImpl()
           
 boolean isStopped()
          Gets the stopped attribute of the IdThread object
 void join()
          Description of the Method
 void removeThreadListener(IndyThreadListener l)
           
 void setPriority(IndyThread.Priority p)
           
 void setStopMode(IndyThread.StopMode mode)
           
 void start()
          Description of the Method
 void stop()
          Description of the Method
 void terminate()
           
 void terminateAndWait()
          Description of the Method
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface java.lang.Runnable
run
 

Field Detail

threadImpl

protected final java.lang.Thread threadImpl

stopRequested

protected volatile boolean stopRequested
Description of the Field
Constructor Detail

IndyThread

public IndyThread()
Constructor for the IdThread object
Method Detail

isStopped

public boolean isStopped()
Gets the stopped attribute of the IdThread object
Returns:
The stopped value

getThreadImpl

protected java.lang.Thread getThreadImpl()
Returns:
 

start

public final void start()
Description of the Method

stop

public final void stop()
Description of the Method

terminate

public void terminate()

join

public void join()
          throws java.lang.InterruptedException
Description of the Method
Throws:
java.lang.InterruptedException - Description of the Exception

terminateAndWait

public void terminateAndWait()
                      throws java.lang.InterruptedException
Description of the Method
Throws:
java.lang.InterruptedException - Description of the Exception

getStopMode

public IndyThread.StopMode getStopMode()
Returns:
 

setStopMode

public void setStopMode(IndyThread.StopMode mode)
Parameters:
mode -  

getPriority

public IndyThread.Priority getPriority()
Returns:
 

setPriority

public void setPriority(IndyThread.Priority p)
Parameters:
p -  

cleanup

protected void cleanup()
                throws java.lang.InterruptedException

beforeRun

protected void beforeRun()
                  throws java.lang.InterruptedException
Description of the Method

afterRun

protected void afterRun()
                 throws java.lang.InterruptedException
Description of the Method

beforeExecute

protected void beforeExecute()
                      throws java.lang.InterruptedException
Description of the Method

afterExecute

protected void afterExecute()
                     throws java.lang.InterruptedException
Description of the Method

addThreadListener

public void addThreadListener(IndyThreadListener l)
Adds a feature to the ThreadListener attribute of the IdThread object
Parameters:
l - The feature to be added to the ThreadListener attribute

removeThreadListener

public void removeThreadListener(IndyThreadListener l)
Parameters:
l -  


Copyright © 2002-2002 IndyJ. All Rights Reserved.