org.jacorb.notification.engine

Class TaskProcessor

Implemented Interfaces:
Configurable, Disposable

public class TaskProcessor
extends java.lang.Object
implements Disposable, Configurable

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

Author:
Alphonse Bendt

Constructor Summary

TaskProcessor()
Start ClockDaemon Set up TaskExecutors Set up TaskFactory

Method Summary

void
cancelTask(Object id)
void
configure(Configuration conf)
void
configureTaskExecutor(AbstractProxySupplier proxySupplier)
configure a AbstractProxySupplier to use a TaskExecutor dependent on the settings for the current Channel.
void
dispose()
shutdown this TaskProcessor.
Object
executeTaskPeriodically(long intervall, Runnable task, boolean startImmediately)
long
getBackoutInterval()
TaskFactory
getTaskFactory()
void
processMessage(Message mesg)
process a Message. the various settings for the Message (timeout, starttime, stoptime) are checked and applied.
protected void
processMessageInternal(Message event)
process a Message. create FilterTask and schedule it.
void
scheduleTimedPullTask(MessageSupplier dest)
Schedule ProxyPullConsumer for pull-Operation.
void
scheduleTimedPushTask(MessageConsumer consumer)
Schedule MessageConsumer for a deliver-Operation.

Constructor Details

TaskProcessor

public TaskProcessor()
Start ClockDaemon Set up TaskExecutors Set up TaskFactory

Method Details

cancelTask

public void cancelTask(Object id)


configure

public void configure(Configuration conf)


configureTaskExecutor

public void configureTaskExecutor(AbstractProxySupplier proxySupplier)
configure a AbstractProxySupplier to use a TaskExecutor dependent on the settings for the current Channel.


dispose

public void dispose()
shutdown this TaskProcessor. The TaskExecutors will be shutdown, the running Threads interrupted and all allocated ressources will be freed. As the active Threads will be interrupted pending Events will be discarded.
Specified by:
dispose in interface Disposable


executeTaskPeriodically

public Object executeTaskPeriodically(long intervall,
                                      Runnable task,
                                      boolean startImmediately)


getBackoutInterval

public long getBackoutInterval()


getTaskFactory

public TaskFactory getTaskFactory()


processMessage

public void processMessage(Message mesg)
process a Message. the various settings for the Message (timeout, starttime, stoptime) are checked and applied.


processMessageInternal

protected void processMessageInternal(Message event)
process a Message. create FilterTask and schedule it. visibility is protected so that method is accessible in test code.


scheduleTimedPullTask

public void scheduleTimedPullTask(MessageSupplier dest)
            throws InterruptedException
Schedule ProxyPullConsumer for pull-Operation. If a Supplier connects to a ProxyPullConsumer the ProxyPullConsumer needs to regularely poll the Supplier. This method queues a Task to run runPullEvent on the specified TimerEventSupplier


scheduleTimedPushTask

public void scheduleTimedPushTask(MessageConsumer consumer)
            throws InterruptedException
Schedule MessageConsumer for a deliver-Operation. Some MessageConsumers (namely SequenceProxyPushSuppliers) need to push Messages regularely to its connected Consumer. Schedule a Task to call deliverPendingEvents on the specified MessageConsumer. Also used after a disabled MessageConsumer is enabled again to push the pending Messages.