org.sf.cafebabe.util
Class LongOperation

java.lang.Object
  extended by java.lang.Thread
      extended by org.sf.cafebabe.util.LongOperation
All Implemented Interfaces:
java.lang.Runnable
Direct Known Subclasses:
TimerLongOperation

public abstract class LongOperation
extends java.lang.Thread

This class represents some long operation as Thread. It allows correctly kill such task. Additionally it produces event ActionEvent each delay mc for registered listener ActionListener.


Nested Class Summary
 
Nested classes/interfaces inherited from class java.lang.Thread
java.lang.Thread.State, java.lang.Thread.UncaughtExceptionHandler
 
Field Summary
static int CANCEL_OPERATION
           
protected  int delay
           
static int ERROR_OPERATION
           
static int OK_OPERATION
           
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
LongOperation(int delay)
           
 
Method Summary
protected abstract  void execute()
           
 java.lang.String getResultMessage()
           
 int getResultType()
           
 void run()
           
 void startLoading()
           
 void stopLoading()
           
 
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, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yield
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

OK_OPERATION

public static final int OK_OPERATION
See Also:
Constant Field Values

CANCEL_OPERATION

public static final int CANCEL_OPERATION
See Also:
Constant Field Values

ERROR_OPERATION

public static final int ERROR_OPERATION
See Also:
Constant Field Values

delay

protected int delay
Constructor Detail

LongOperation

public LongOperation(int delay)
Method Detail

startLoading

public void startLoading()

stopLoading

public void stopLoading()

run

public void run()
Specified by:
run in interface java.lang.Runnable
Overrides:
run in class java.lang.Thread

execute

protected abstract void execute()
                         throws java.lang.Exception
Throws:
java.lang.Exception

getResultType

public int getResultType()

getResultMessage

public java.lang.String getResultMessage()


Copyright 2006 Dream Programs Inc.. All Rights Reserved.