|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
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
WebContextObserver
s are the observers.
Method Summary | |
---|---|
void |
update(WebContext context,
Object arg)
This method is called by the WebContext on its registered WebContextObserver s when users call the
refresh() methods on the context. |
Method Detail |
---|
void update(WebContext context, Object arg)
This method is called by the WebContext
on its registered WebContextObserver
s 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.
context
- the WebContext
that has been refreshedarg
- the argument passed to the WebContext
's refresh(arg)
methodWebContext.refresh(Object)
,
WebContext.addObserver(WebContextObserver)
,
WebContext.removeObserver(WebContextObserver)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |