KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > enhydra > barracuda > core > event > DispatchQueue


1 /*
2  * Copyright (C) 2003 Christian Cryder [christianc@granitepeaks.com]
3  *
4  * This library is free software; you can redistribute it and/or
5  * modify it under the terms of the GNU Lesser General Public
6  * License as published by the Free Software Foundation; either
7  * version 2.1 of the License, or (at your option) any later version.
8  *
9  * This library is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12  * Lesser General Public License for more details.
13  *
14  * You should have received a copy of the GNU Lesser General Public
15  * License along with this library; if not, write to the Free Software
16  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17  *
18  * $Id: DispatchQueue.java,v 1.8 2004/02/01 05:16:28 christianc Exp $
19  */

20 package org.enhydra.barracuda.core.event;
21
22 import java.io.*;
23 import java.util.*;
24
25 import org.enhydra.barracuda.plankton.data.StateMap;
26
27 /**
28  * This interface defines the methods needed to implement a
29  * DispatchQueue
30  */

31 public interface DispatchQueue { //extends StateMap {
32

33     /**
34      * Does this queue require a response?
35      *
36      * @return true if this queue requires a response
37      */

38     public boolean requiresResponse();
39
40     /**
41      * Programatically tell the dispatcher that a response is required
42      *
43      * @param true if a response is required
44      */

45     public void setRequiresResponse(boolean val);
46
47     /**
48      * Has the response for this queue been handled?
49      *
50      * @return true if the response has been handled
51      */

52     public boolean responseHandled();
53
54     /**
55      * Programatically tell the dispatcher that the response has been handled
56      *
57      * @param true if the response has been handled
58      */

59     public void setResponseHandled(boolean val);
60
61     /**
62      * Adds an event to the queue. When this happens, we first remove
63      * any existing events in the queue that this event .equals(), and
64      * then this event is added. This has the effect of collapsing
65      * duplicates.
66      *
67      * @param baseEvent the event to be added to the queue
68      */

69     public void addEvent(BaseEvent baseEvent);
70
71     /**
72      * get the number of events remaining in the queue
73      *
74      * @return the number of events remaining in the queue
75      */

76     public int numberOfEventsRemaining();
77
78     /**
79      * List all events remaining in the queue (Request events first, then
80      * Response events)
81      *
82      * @return a list of all events remaining in the queue
83      */

84     public List listRemainingEvents();
85
86     /**
87      * get the number of events that have been processed
88      *
89      * @return the number of events processed in the queue
90      */

91     public int numberOfEventsProcessed();
92
93     /**
94      * List events which have already been processed through the queue
95      *
96      * @return a list of all events processed in the queue
97      */

98     public List listProcessedEvents();
99
100 }
101
Popular Tags