view src/org/dancres/blitz/notify/DispatchTask.java @ 35:6f68e94c1fb8 default tip

Add CondensedStats monitoring utility, equivalent to vmstat
author Dominic Cleal <dominic-cleal@cdo2.com>
date Thu, 05 Aug 2010 11:07:25 +0100
parents 3dc0c5604566
children
line wrap: on
line source

package org.dancres.blitz.notify;

/**
 * DispatchTask represents an event processing task for the event queue.
 * The lifecycle of this event is as follows:
 *
 * <ol>
 * <li>The poster of the event invokes block() having enqueued this task.  It may or may
 * not actually block depending on the task's implementation.</li>
 *
 * <li>For each event generated, newDispatch is invoked to indicate an event
 * will be posted.</li>
 *
 * <li>For each event generated, dispatched is invoked to indicate the event has
 * been sent.</li>
 *
 * <li>When the event queue (as to the event senders) has finished generating events it
 * invokes enableResolve which for suitable implementations indicates that the blocker
 * can be released at the appropriate moment.</li>
 * </ol>
 */
public interface DispatchTask extends Runnable {
    public QueueEvent getEvent();
    public void block() throws InterruptedException;
    public void newDispatch();
    public void dispatched();
    public void enableResolve();
}