Class ObserverProxy
- java.lang.Object
-
- com.hybris.cockpitng.core.model.impl.ObserverProxy
-
- All Implemented Interfaces:
ValueObserver
public class ObserverProxy extends java.lang.Object implements ValueObserver
A proxy observer to pass model change events with some prefix. Whenever a source model changes, destination model is asked to notify all its observers about a change, but with prefix prepended.Observer is available in two versions:
- destination model may be referenced strongly: this proxy should be used whenever a link between source and destination is permanent and should last as long both of them exist
- destination model may be referenced weekly: this proxy should be used whenever a link between source and destination is temporary and should not prevent GC from collecting destination model
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static ValueObservercreateProxy(Observable destination, ObjectValuePath prefix)Creates a proxy observer with strong reference to destinationstatic ValueObservercreateWeakProxy(Observable destination, ObjectValuePath prefix)Creates a proxy observer with weak reference to destinationvoidmodelChanged()Will be called after some value of the model was changed.voidmodelChanged(java.lang.String property)Will be called after some value of the model was changed.
-
-
-
Method Detail
-
createProxy
public static ValueObserver createProxy(Observable destination, ObjectValuePath prefix)
Creates a proxy observer with strong reference to destination- Parameters:
destination- destination modelprefix- prefix added to notification of destination- Returns:
- prefix observer ready to be registered in source model
-
createWeakProxy
public static ValueObserver createWeakProxy(Observable destination, ObjectValuePath prefix)
Creates a proxy observer with weak reference to destination- Parameters:
destination- destination modelprefix- prefix added to notification of destination- Returns:
- prefix observer ready to be registered in source model
-
modelChanged
public void modelChanged()
Description copied from interface:ValueObserverWill be called after some value of the model was changed.- Specified by:
modelChangedin interfaceValueObserver
-
modelChanged
public void modelChanged(java.lang.String property)
Description copied from interface:ValueObserverWill be called after some value of the model was changed.- Specified by:
modelChangedin interfaceValueObserver- Parameters:
property- exact model property which has been changed.
-
-