com.esri.adf.web.data
Interface WebContextObserver

All Known Implementing Classes:
ExtentHistory, MapToolsTask, PrintTask, RoutingTask, SearchAttributesTask, WebMap, WebOverview, WebScaleBar, WebToc

public interface WebContextObserver

The WebContextObserver interface is implemented by classes that want to update themselves when the WebContext is refreshed. This interface defines a callback method which is called when users call any of the refresh() methods on the context.

To setup an object to be updated by the context, one needs to use the WebContext.addObserver(WebContextObserver) to register itself with the context. All context attributes are wired up to the WebContext. When users change state on any of the attributes and need to inform other attributes of the context to react to the change they call either the WebContext.refresh() or WebContext.refresh(Object) methods. The context in turns calls the update(WebContext, Object) methods on all its registered observers.

This is a classic implementation of the Observer-Observable model. The WebContext is the observable object in this case and the registered WebContextObservers are the observers.


Method Summary
 void update(WebContext context, Object arg)
           This method is called by the WebContext on its registered WebContextObservers when users call the refresh() methods on the context.
 

Method Detail

update

void update(WebContext context,
            Object arg)

This method is called by the WebContext on its registered WebContextObservers when users call the refresh() methods on the context.

To setup an object to be updated by the context, one needs to use the WebContext.addObserver(WebContextObserver) to register itself with the context. All context attributes are wired up to the WebContext. When users change state on any of the attributes and need to intimate other attributes of the context to react to the change they call either the WebContext.refresh() or WebContext.refresh(Object) methods. The context in turns calls the update(WebContext, Object) methods on all its registered observers.

Parameters:
context - the WebContext that has been refreshed
arg - the argument passed to the WebContext's refresh(arg) method
See Also:
WebContext.refresh(Object), WebContext.addObserver(WebContextObserver), WebContext.removeObserver(WebContextObserver)