org.jacorb.notification.engine
Class DefaultTaskProcessor

java.lang.Object
  extended byorg.jacorb.notification.engine.DefaultTaskProcessor
All Implemented Interfaces:
DefaultTaskProcessorMBean, org.picocontainer.Disposable, Disposable, JMXManageable, NotifyingDisposable, TaskProcessor

public class DefaultTaskProcessor
extends java.lang.Object
implements TaskProcessor, Disposable, JMXManageable, DefaultTaskProcessorMBean

Version:
$Id: DefaultTaskProcessor.java,v 1.13 2005/11/11 19:37:44 alphonse.bendt Exp $
Author:
Alphonse Bendt

Nested Class Summary
 
Nested classes inherited from class org.jacorb.notification.interfaces.JMXManageable
JMXManageable.JMXCallback
 
Constructor Summary
DefaultTaskProcessor(org.apache.avalon.framework.configuration.Configuration config, TaskFactory taskFactory)
          Start ClockDaemon Set up TaskExecutors Set up TaskFactory
 
Method Summary
 void dispose()
          shutdown this TaskProcessor.
 edu.emory.mathcs.backport.java.util.concurrent.ScheduledFuture executeTaskAfterDelay(long delay, java.lang.Runnable task)
           
 edu.emory.mathcs.backport.java.util.concurrent.ScheduledFuture executeTaskPeriodically(long intervall, java.lang.Runnable task, boolean startImmediately)
           
 int getFilterWorkerPoolSize()
           
 java.lang.String[] getJMXNotificationTypes()
           
 java.lang.String getJMXObjectName()
           
 int getPullWorkerPoolSize()
           
 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 registerDisposable(Disposable disposable)
          the hooks registered by this method will be run when dispose is called.
 void scheduleTimedPullTask(MessageSupplier messageSupplier)
          Schedule ProxyPullConsumer for pull-Operation.
 void setJMXCallback(JMXManageable.JMXCallback callback)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultTaskProcessor

public DefaultTaskProcessor(org.apache.avalon.framework.configuration.Configuration config,
                            TaskFactory taskFactory)
Start ClockDaemon Set up TaskExecutors Set up TaskFactory

Method Detail

getTaskFactory

public TaskFactory getTaskFactory()
Specified by:
getTaskFactory in interface TaskProcessor

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 org.picocontainer.Disposable

processMessage

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

Specified by:
processMessage in interface TaskProcessor

processMessageInternal

protected void processMessageInternal(Message event)
process a Message. create FilterTask and schedule it.


scheduleTimedPullTask

public void scheduleTimedPullTask(MessageSupplier messageSupplier)
                           throws java.lang.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

Specified by:
scheduleTimedPullTask in interface TaskProcessor
Throws:
java.lang.InterruptedException

executeTaskPeriodically

public edu.emory.mathcs.backport.java.util.concurrent.ScheduledFuture executeTaskPeriodically(long intervall,
                                                                                              java.lang.Runnable task,
                                                                                              boolean startImmediately)
Specified by:
executeTaskPeriodically in interface TaskProcessor

executeTaskAfterDelay

public edu.emory.mathcs.backport.java.util.concurrent.ScheduledFuture executeTaskAfterDelay(long delay,
                                                                                            java.lang.Runnable task)
Specified by:
executeTaskAfterDelay in interface TaskProcessor

getJMXObjectName

public java.lang.String getJMXObjectName()
Specified by:
getJMXObjectName in interface JMXManageable

registerDisposable

public void registerDisposable(Disposable disposable)
Description copied from interface: NotifyingDisposable
the hooks registered by this method will be run when dispose is called.

Specified by:
registerDisposable in interface NotifyingDisposable

getJMXNotificationTypes

public java.lang.String[] getJMXNotificationTypes()
Specified by:
getJMXNotificationTypes in interface JMXManageable

setJMXCallback

public void setJMXCallback(JMXManageable.JMXCallback callback)
Specified by:
setJMXCallback in interface JMXManageable

getFilterWorkerPoolSize

public int getFilterWorkerPoolSize()
Specified by:
getFilterWorkerPoolSize in interface DefaultTaskProcessorMBean

getPullWorkerPoolSize

public int getPullWorkerPoolSize()
Specified by:
getPullWorkerPoolSize in interface DefaultTaskProcessorMBean