org.barracudamvc.core.event
Interface DispatchQueue

All Known Implementing Classes:
DefaultDispatchQueue

public interface DispatchQueue

This interface defines the methods needed to implement a DispatchQueue


Method Summary
 void addEvent(BaseEvent baseEvent)
          Adds an event to the queue.
 List listProcessedEvents()
          List events which have already been processed through the queue
 List listRemainingEvents()
          List all events remaining in the queue (Request events first, then Response events)
 int numberOfEventsProcessed()
          get the number of events that have been processed
 int numberOfEventsRemaining()
          get the number of events remaining in the queue
 boolean requiresResponse()
          Does this queue require a response?
 boolean responseHandled()
          Has the response for this queue been handled?
 void setRequiresResponse(boolean val)
          Programatically tell the dispatcher that a response is required
 void setResponseHandled(boolean val)
          Programatically tell the dispatcher that the response has been handled
 

Method Detail

requiresResponse

public boolean requiresResponse()
Does this queue require a response?

Returns:
true if this queue requires a response

setRequiresResponse

public void setRequiresResponse(boolean val)
Programatically tell the dispatcher that a response is required


responseHandled

public boolean responseHandled()
Has the response for this queue been handled?

Returns:
true if the response has been handled

setResponseHandled

public void setResponseHandled(boolean val)
Programatically tell the dispatcher that the response has been handled


addEvent

public void addEvent(BaseEvent baseEvent)
Adds an event to the queue. When this happens, we first remove any existing events in the queue that this event .equals(), and then this event is added. This has the effect of collapsing duplicates.

Parameters:
baseEvent - the event to be added to the queue

numberOfEventsRemaining

public int numberOfEventsRemaining()
get the number of events remaining in the queue

Returns:
the number of events remaining in the queue

listRemainingEvents

public List listRemainingEvents()
List all events remaining in the queue (Request events first, then Response events)

Returns:
a list of all events remaining in the queue

numberOfEventsProcessed

public int numberOfEventsProcessed()
get the number of events that have been processed

Returns:
the number of events processed in the queue

listProcessedEvents

public List listProcessedEvents()
List events which have already been processed through the queue

Returns:
a list of all events processed in the queue


Copyright © 2004 BarracudaMVC.org All Rights Reserved.