org.sonatype.sisu.goodies.thread
Class PeriodicThreadSupport

java.lang.Object
  extended by java.lang.Thread
      extended by org.sonatype.sisu.goodies.thread.ThreadSupport
          extended by org.sonatype.sisu.goodies.thread.PeriodicThreadSupport
All Implemented Interfaces:
Runnable, LifecycleAware

public abstract class PeriodicThreadSupport
extends ThreadSupport
implements LifecycleAware

Support for periodic Thread implementations.

Since:
1.0

Nested Class Summary
 
Nested classes/interfaces inherited from class java.lang.Thread
Thread.State, Thread.UncaughtExceptionHandler
 
Field Summary
 
Fields inherited from class org.sonatype.sisu.goodies.thread.ThreadSupport
log
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
protected PeriodicThreadSupport()
           
protected PeriodicThreadSupport(String name)
           
protected PeriodicThreadSupport(ThreadGroup group, String name)
           
 
Method Summary
protected  void doContinue()
           
protected  void doRun()
           
protected abstract  void doTask()
           
 Lifecycle getLifecycle()
           
protected  void pause(Time time)
           
 
Methods inherited from class org.sonatype.sisu.goodies.thread.ThreadSupport
cancel, createLogger, doStop, getLock, isCanceled, onFailure, run, 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
 

Constructor Detail

PeriodicThreadSupport

protected PeriodicThreadSupport()

PeriodicThreadSupport

protected PeriodicThreadSupport(String name)

PeriodicThreadSupport

protected PeriodicThreadSupport(ThreadGroup group,
                                String name)
Method Detail

doRun

protected final void doRun()
                    throws Exception
Specified by:
doRun in class ThreadSupport
Throws:
Exception

doTask

protected abstract void doTask()
                        throws Exception
Throws:
Exception

doContinue

protected void doContinue()
                   throws Exception
Throws:
Exception

pause

protected void pause(Time time)
              throws InterruptedException
Throws:
InterruptedException

getLifecycle

public Lifecycle getLifecycle()
Specified by:
getLifecycle in interface LifecycleAware


Copyright © 2008-2012 Sonatype, Inc.. All Rights Reserved.