org.sakaiproject.component.framework.courier
Class BasicCourierService

java.lang.Object
  extended byorg.sakaiproject.component.framework.courier.BasicCourierService
All Implemented Interfaces:
CourierService

public class BasicCourierService
extends Object
implements CourierService

BasicCourierService is the implementation for a CHEF CourierService, implemented as a Turbine service.

Version:
$Revision: 632 $
Author:
University of Michigan, CHEF Software Development Team

Field Summary
protected  Map m_addresses
          Stores a List of Deliveries for each address, keyed by address.
protected  Logger m_logger
          Dependency: logging service
 
Fields inherited from interface org.sakaiproject.service.framework.courier.CourierService
SERVICE_NAME
 
Constructor Summary
BasicCourierService()
           
 
Method Summary
 void clear(String address)
          Clear any pending delivery requests to this session client window.
 void clear(String address, String elementId)
          Clear any pending delivery requests to the particular client window for this element.
 void deliver(Delivery delivery)
          Queue up a delivery for the client window identified in the Delivery object.
 void destroy()
          Returns to uninitialized state.
 List getDeliveries(String address)
          Access and de-queue the Deliveries queued up for a particular session client window.
 boolean hasDeliveries(String address)
          Check to see if there are any deliveries queued up for a particular session client window.
 void init()
          Final initialization, once all dependencies are set.
 void setLogger(Logger service)
          Dependency: logging service.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

m_addresses

protected Map m_addresses
Stores a List of Deliveries for each address, keyed by address.


m_logger

protected Logger m_logger
Dependency: logging service

Constructor Detail

BasicCourierService

public BasicCourierService()
Method Detail

setLogger

public void setLogger(Logger service)
Dependency: logging service.

Parameters:
service - The logging service.

init

public void init()
Final initialization, once all dependencies are set.


destroy

public void destroy()
Returns to uninitialized state.


deliver

public void deliver(Delivery delivery)
Queue up a delivery for the client window identified in the Delivery object. The particular form of delivery is determined by the type of Delivery object sent.

Specified by:
deliver in interface CourierService
Parameters:
delivery - The Delivery (or extension) object to deliver.

clear

public void clear(String address,
                  String elementId)
Clear any pending delivery requests to the particular client window for this element.

Specified by:
clear in interface CourierService
Parameters:
address - The address of the client window.
elementId - The id of the html element.

clear

public void clear(String address)
Clear any pending delivery requests to this session client window.

Specified by:
clear in interface CourierService
Parameters:
address - The address of client window.

getDeliveries

public List getDeliveries(String address)
Access and de-queue the Deliveries queued up for a particular session client window.

Specified by:
getDeliveries in interface CourierService
Parameters:
address - The address of client window.
Returns:
a List of Delivery objects addressed to this session client window.

hasDeliveries

public boolean hasDeliveries(String address)
Check to see if there are any deliveries queued up for a particular session client window.

Specified by:
hasDeliveries in interface CourierService
Parameters:
address - The address of the client window.
Returns:
true if there are deliveries for this client window, false if not.