org.jacorb.notification.engine

Class AbstractTask

Implemented Interfaces:
Configurable, Runnable, Disposable
Known Direct Subclasses:
AbstractDeliverTask, PullFromSupplierTask

public abstract class AbstractTask
extends AbstractPoolable
implements Runnable

Version:
$Id: AbstractTask.java,v 1.9 2004/05/06 12:39:59 nicolas Exp $

Author:
Alphonse Bendt

Field Summary

protected Message
message_

Fields inherited from class org.jacorb.notification.interfaces.AbstractPoolable

logger_

Constructor Summary

AbstractTask(TaskProcessor tp)

Method Summary

protected void
checkInterrupt()
Message
copyMessage()
void
doWork()
Override this Method in Subclasses to do the "real work".
protected TaskExecutor
getTaskExecutor()
protected TaskProcessor
getTaskProcessor()
Message
removeMessage()
void
reset()
Reset the Object to an initial state.
void
run()
template method.
void
schedule()
protected void
schedule(boolean directRunAllowed)
Run this Task on its configured Executor.
protected void
schedule(TaskExecutor executor, boolean directRunAllowed)
Run this Task on the provided Executor.
void
setMessage(Message event)
set the Message for this Task to use.
protected void
setTaskExecutor(TaskExecutor taskExecutor)

Methods inherited from class org.jacorb.notification.interfaces.AbstractPoolable

configure, dispose, reset, setObjectPool

Field Details

message_

protected Message message_

Constructor Details

AbstractTask

protected AbstractTask(TaskProcessor tp)

Method Details

checkInterrupt

protected void checkInterrupt()
            throws InterruptedException


copyMessage

public Message copyMessage()


doWork

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


getTaskExecutor

protected TaskExecutor getTaskExecutor()


getTaskProcessor

protected TaskProcessor getTaskProcessor()


removeMessage

public Message removeMessage()


reset

public void reset()
Reset the Object to an initial state. Subclasses should override this method appropiately to reset the instance to an initial state.
Overrides:
reset in interface AbstractPoolable


run

public void run()
template method.
  1. Call doWork()


schedule

public void schedule()
            throws InterruptedException


schedule

protected void schedule(boolean directRunAllowed)
            throws InterruptedException
Run this Task on its configured Executor.

Parameters:
directRunAllowed - this param specified if its allowed to run this Task on the calling Thread.


schedule

protected void schedule(TaskExecutor executor,
                        boolean directRunAllowed)
            throws InterruptedException
Run this Task on the provided Executor.

Parameters:
executor - a TaskExecutor value
directRunAllowed - a boolean value


setMessage

public void setMessage(Message event)
set the Message for this Task to use.


setTaskExecutor

protected void setTaskExecutor(TaskExecutor taskExecutor)