org.sakaiproject.util
Class ObservingCourier

java.lang.Object
  extended by org.sakaiproject.util.ObservingCourier
All Implemented Interfaces:
Observer, ObservingCourier
Direct Known Subclasses:
EventObservingCourier

public abstract class ObservingCourier
extends Object
implements ObservingCourier, Observer

ObservingCourier is an observer which uses the courier service to notify when things change.


Field Summary
protected  CourierService m_courierService
          Constructor discovered injected CourierService.
protected  String m_deliveryId
          The key identifying the Portal PageSession.
protected  String m_elementId
          The key identifying the element on the Portal Page.
protected  boolean m_enabled
          The enabled state.
protected  String m_location
          The location (id not ref).
 
Constructor Summary
ObservingCourier(String location, String elementId)
          Construct.
 
Method Summary
 boolean check(Object arg)
          Check to see if we want to process or ignore this update.
 void disable()
           
 void enable()
           
 String getDeliveryId()
           
 String getElementId()
           
 boolean getEnabled()
           
 String getLocation()
          Access the location this observer is observing.
 void justDelivered()
          Accept notification that the portal element has just been delivered.
 void setDeliveryId(String id)
           
 void setElementId(String id)
           
 void update(Observable o, Object arg)
          This method is called whenever the observed object is changed.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

m_courierService

protected CourierService m_courierService
Constructor discovered injected CourierService.


m_location

protected String m_location
The location (id not ref).


m_deliveryId

protected String m_deliveryId
The key identifying the Portal PageSession.


m_elementId

protected String m_elementId
The key identifying the element on the Portal Page.


m_enabled

protected boolean m_enabled
The enabled state.

Constructor Detail

ObservingCourier

public ObservingCourier(String location,
                        String elementId)
Construct.

Parameters:
location - The key identifying the client window to which this courier delivers updates.
elementId - The key identifying the element on the Portal Page that would need a courier delivered message when things change.
Method Detail

getDeliveryId

public String getDeliveryId()
Specified by:
getDeliveryId in interface ObservingCourier

setDeliveryId

public void setDeliveryId(String id)
Specified by:
setDeliveryId in interface ObservingCourier

getElementId

public String getElementId()
Specified by:
getElementId in interface ObservingCourier

setElementId

public void setElementId(String id)
Specified by:
setElementId in interface ObservingCourier

getEnabled

public boolean getEnabled()
Specified by:
getEnabled in interface ObservingCourier

enable

public void enable()
Specified by:
enable in interface ObservingCourier

disable

public void disable()
Specified by:
disable in interface ObservingCourier

justDelivered

public void justDelivered()
Accept notification that the portal element has just been delivered. If there are pending requests to deliver, they can be cleared.

Specified by:
justDelivered in interface ObservingCourier

check

public boolean check(Object arg)
Check to see if we want to process or ignore this update.

Specified by:
check in interface ObservingCourier
Parameters:
arg - The arg from the update.
Returns:
true to continue, false to quit.

getLocation

public String getLocation()
Access the location this observer is observing.

Specified by:
getLocation in interface ObservingCourier
Returns:
the location this observer is observing.

update

public void update(Observable o,
                   Object arg)
This method is called whenever the observed object is changed. An application calls an Observable object's notifyObservers method to have all the object's observers notified of the change. default implementation is to cause the courier service to deliver to the interface controlled by my controller. Extensions can override.

Specified by:
update in interface Observer
Parameters:
o - the observable object.
arg - an argument passed to the notifyObservers method.


Copyright © 2003-2013 The Sakai Foundation. All Rights Reserved.