org.jacorb.notification.engine
Class AbstractTask

java.lang.Object
  extended byorg.jacorb.notification.util.AbstractPoolable
      extended byorg.jacorb.notification.engine.AbstractTask
All Implemented Interfaces:
org.picocontainer.Disposable, Disposable, java.lang.Runnable, Schedulable
Direct Known Subclasses:
AbstractMessageTask, PullFromSupplierTask

public abstract class AbstractTask
extends AbstractPoolable
implements java.lang.Runnable, Schedulable

Version:
$Id: AbstractTask.java,v 1.17 2005/10/02 15:18:39 alphonse.bendt Exp $
Author:
Alphonse Bendt

Field Summary
 
Fields inherited from class org.jacorb.notification.util.AbstractPoolable
logger_
 
Constructor Summary
AbstractTask()
           
 
Method Summary
protected  void checkInterrupt()
           
abstract  void doWork()
          Override this Method in Subclasses to do the "real work".
protected  TaskExecutor getTaskExecutor()
           
protected  boolean isRunnable()
           
 void run()
          run method invoked by TaskExecutor.
protected  void schedule(boolean directRunAllowed)
          schedule this Task for execution.
protected  void schedule(TaskExecutor executor, boolean directRunAllowed)
          schedule this Task for execution.
protected  void setTaskExecutor(TaskExecutor taskExecutor)
           
 
Methods inherited from class org.jacorb.notification.util.AbstractPoolable
dispose, reset, setObjectPool
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.jacorb.notification.engine.Schedulable
schedule
 

Constructor Detail

AbstractTask

public AbstractTask()
Method Detail

getTaskExecutor

protected TaskExecutor getTaskExecutor()

setTaskExecutor

protected void setTaskExecutor(TaskExecutor taskExecutor)

doWork

public abstract void doWork()
                     throws java.lang.Exception
Override this Method in Subclasses to do the "real work".

Throws:
java.lang.Exception

isRunnable

protected boolean isRunnable()

run

public void run()
run method invoked by TaskExecutor.

Specified by:
run in interface java.lang.Runnable

checkInterrupt

protected void checkInterrupt()
                       throws java.lang.InterruptedException
Throws:
java.lang.InterruptedException

schedule

protected void schedule(boolean directRunAllowed)
schedule this Task for execution.

Parameters:
directRunAllowed - true, if the task may be run in the calling thread. false, if the TaskExecutor should be used.

schedule

protected void schedule(TaskExecutor executor,
                        boolean directRunAllowed)
schedule this Task for execution.

Parameters:
executor - TaskExecutor that should execute this Task
directRunAllowed - true, if the task may be run in the calling thread. false, if the TaskExecutor should be used.